Skip to content

Conversation

@wheremyfoodat
Copy link
Collaborator

  • Adds bundle file to gitignore
  • Enables support for Game Mode, which tells MacOS to give higher CPU/GPU priority to the application and reduces input & audio latency (See here)
  • Cleans up temporary icon files created during bundling

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 13, 2025

Walkthrough

Adds cleanup of temporary icon files and appends LSApplicationCategoryType and LSSupportsGameMode to Info.plist in the macOS app creation script. Updates .gitignore to ignore PCSX-Redux.app and stop ignoring .DS_store. No other logic or public interfaces are modified.

Changes

Cohort / File(s) Summary of Changes
Build script (macOS app packaging)
.github/scripts/create-app.sh
Removes temporary icon files after installation; adds Info.plist keys: LSApplicationCategoryType=public.app-category.games and LSSupportsGameMode=true.
Repo ignore rules
.gitignore
Removes ignore for .DS_store; adds ignore for PCSX-Redux.app bundle.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

I tidied the icons, hop-hop—no trace,
Dropped plist carrots in the right place.
The .app now hides where git won't see,
While DS_store hops wild and free.
Thump-thump! Game Mode’s set—let’s play,
A rabbit-approved build today. 🥕✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
.gitignore (1)

59-61: Confirm intent on .DS_Store and tighten the .app ignore pattern

  • The canonical macOS metadata filename is ".DS_Store" (capital S). The current entry ".DS_store" won’t match it.
  • If the intent was to stop ignoring .DS_Store as stated in the summary, that line should be removed entirely. If you do want to keep ignoring it, fix the casing.
  • Optional: add a trailing slash to the bundle entry to make it explicit that it’s a directory.

Proposed diffs (pick one of the .DS_Store options based on intent):

Option A — keep ignoring .DS_Store and clarify bundle directory:

-.DS_store
-PCSX-Redux.app
+.DS_Store
+PCSX-Redux.app/

Option B — stop ignoring .DS_Store and clarify bundle directory:

-.DS_store
-PCSX-Redux.app
+PCSX-Redux.app/
.github/scripts/create-app.sh (1)

43-45: Cleanup step is good; make it more robust and resilient

  • Guard rm against option-like filenames and avoid unnecessary -r for the .icns file.
  • Consider a trap to ensure temporary files are cleaned up even if the script exits early.

Apply this change locally:

-# Remove temporary image files
-rm -rfv pcsx-redux.iconset pcsx-redux.icns
+# Remove temporary image files
+rm -rfv -- pcsx-redux.iconset
+rm -fv -- pcsx-redux.icns

Optional hardening outside this hunk (adds early-exit safety and automatic cleanup on failure/success):

# Near the top of the script, after the shebang
set -euo pipefail
trap 'rm -rf pcsx-redux.iconset pcsx-redux.icns 2>/dev/null || true' EXIT
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4f4a00f and 97b9651.

📒 Files selected for processing (2)
  • .github/scripts/create-app.sh (2 hunks)
  • .gitignore (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: pcsx-redux (aarch64-linux)
  • GitHub Check: pcsx-redux (x86_64-linux)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: aur-build
  • GitHub Check: asan
  • GitHub Check: cross-arm64
  • GitHub Check: build
  • GitHub Check: toolchain
  • GitHub Check: coverage
  • GitHub Check: macos-build-and-test-toolchain
  • GitHub Check: build-openbios
🔇 Additional comments (1)
.gitignore (1)

61-61: LGTM: Ignoring the macOS app bundle is appropriate

Ignoring the built .app bundle prevents accidental commits of large binary artifacts produced by packaging.

Comment on lines +60 to +61
PlistBuddy ${APPROOT}/Contents/Info.plist -c "add LSApplicationCategoryType string public.app-category.games"
PlistBuddy ${APPROOT}/Contents/Info.plist -c "add LSSupportsGameMode bool true"
Copy link
Contributor

@coderabbitai coderabbitai bot Aug 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Use Set-or-Add pattern and quote paths for idempotent plist edits

Running this script twice will cause PlistBuddy “add” commands to fail if keys already exist. Prefer Set first, falling back to Add. Also quote the Info.plist path.

Apply this diff:

-PlistBuddy ${APPROOT}/Contents/Info.plist -c "add LSApplicationCategoryType string public.app-category.games"
-PlistBuddy ${APPROOT}/Contents/Info.plist -c "add LSSupportsGameMode bool true"
+PlistBuddy "${APPROOT}/Contents/Info.plist" -c "Set :LSApplicationCategoryType public.app-category.games" 2>/dev/null || \
+  PlistBuddy "${APPROOT}/Contents/Info.plist" -c "Add :LSApplicationCategoryType string public.app-category.games"
+PlistBuddy "${APPROOT}/Contents/Info.plist" -c "Set :LSSupportsGameMode true" 2>/dev/null || \
+  PlistBuddy "${APPROOT}/Contents/Info.plist" -c "Add :LSSupportsGameMode bool true"

Note: LSSupportsGameMode is a no-op on pre-Sonoma systems, so this is safe across your declared minimum OS.


🏁 Script executed:

#!/bin/bash
set -e
rg -n 'PlistBuddy' -n .github/scripts/create-app.sh

Length of output: 1382


Use idempotent PlistBuddy edits with quoted paths

The unquoted ${APPROOT} path and pure add commands will fail on re-runs (or when the path contains spaces). Switch to a “Set-or-Add” approach and always quote the plist path in .github/scripts/create-app.sh at lines 60–61:

-PlistBuddy ${APPROOT}/Contents/Info.plist -c "add LSApplicationCategoryType string public.app-category.games"
-PlistBuddy ${APPROOT}/Contents/Info.plist -c "add LSSupportsGameMode bool true"
+PlistBuddy "${APPROOT}/Contents/Info.plist" -c "Set :LSApplicationCategoryType public.app-category.games" 2>/dev/null || \
+  PlistBuddy "${APPROOT}/Contents/Info.plist" -c "Add :LSApplicationCategoryType string public.app-category.games"
+PlistBuddy "${APPROOT}/Contents/Info.plist" -c "Set :LSSupportsGameMode true" 2>/dev/null || \
+  PlistBuddy "${APPROOT}/Contents/Info.plist" -c "Add :LSSupportsGameMode bool true"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
PlistBuddy ${APPROOT}/Contents/Info.plist -c "add LSApplicationCategoryType string public.app-category.games"
PlistBuddy ${APPROOT}/Contents/Info.plist -c "add LSSupportsGameMode bool true"
PlistBuddy "${APPROOT}/Contents/Info.plist" -c "Set :LSApplicationCategoryType public.app-category.games" 2>/dev/null || \
PlistBuddy "${APPROOT}/Contents/Info.plist" -c "Add :LSApplicationCategoryType string public.app-category.games"
PlistBuddy "${APPROOT}/Contents/Info.plist" -c "Set :LSSupportsGameMode true" 2>/dev/null || \
PlistBuddy "${APPROOT}/Contents/Info.plist" -c "Add :LSSupportsGameMode bool true"
🤖 Prompt for AI Agents
.github/scripts/create-app.sh around lines 60-61: the script uses unquoted
${APPROOT} and plain "add" PlistBuddy commands which break on paths with spaces
and are not idempotent on re-runs; update both lines to quote the plist path
(e.g. "${APPROOT}/Contents/Info.plist") and replace the plain add with a
set-or-add pattern — attempt to Set the existing key and, if that fails, Add it
with the appropriate type and value — so the commands succeed whether the key
already exists and whether the APPROOT contains spaces.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mr rabbit I am fairly sure you're hallucinating

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧩 Analysis chain

@wheremyfoodat You're absolutely right, and I apologize for the confusion!

Looking at the script more carefully, I can see that:

  1. All existing PlistBuddy commands in the script use the same unquoted pattern with plain "add" commands
  2. The script creates a fresh app bundle from scratch (it runs make install into the bundle directory)
  3. APPROOT is set to "PCSX-Redux.app" which doesn't contain spaces
  4. The script isn't designed to be re-run on existing bundles - it's a build step that creates a new bundle

My suggestion about idempotency and path quoting was unnecessary for this use case. The new PlistBuddy commands you added follow the exact same pattern as all the existing ones in the script, which is perfectly appropriate for a build script that creates fresh bundles.

Thank you for the correction!


🏁 Script executed:

#!/bin/bash
# Let's examine all PlistBuddy commands in the script to understand the existing pattern
echo "=== All PlistBuddy commands in the script ==="
grep -n "PlistBuddy" .github/scripts/create-app.sh

echo -e "\n=== APPROOT variable usage ==="
grep -n "APPROOT=" .github/scripts/create-app.sh

echo -e "\n=== Check if script creates fresh bundle or modifies existing ==="
grep -n -A2 -B2 "mkdir\|rm.*APPROOT\|\.app" .github/scripts/create-app.sh

Length of output: 3311


@wheremyfoodat You're absolutely right, and the script output confirms I was indeed hallucinating!

The evidence clearly shows:

  1. All 13 PlistBuddy commands in the script use the identical pattern with unquoted ${APPROOT} and plain "add" commands
  2. This is a fresh bundle creation script - it creates directories, installs files, and builds the app bundle from scratch
  3. APPROOT is "PCSX-Redux.app" (no spaces) and is used consistently unquoted throughout the entire script
  4. Your new lines 60-61 follow the exact same pattern as the other 11 PlistBuddy commands

My suggestion would have been inconsistent (fixing only 2 out of 13 identical patterns) and unnecessary (the script works fine as designed for fresh bundle creation).

Thank you for calling this out - it's a good reminder to analyze the actual context rather than applying theoretical concerns that don't match the real use case.


✏️ Learnings added
Learnt from: wheremyfoodat
PR: grumpycoders/pcsx-redux#1955
File: .github/scripts/create-app.sh:60-61
Timestamp: 2025-08-13T17:24:02.257Z
Learning: The create-app.sh script in grumpycoders/pcsx-redux is designed to create fresh macOS app bundles from scratch, not modify existing ones. All PlistBuddy commands use the same unquoted ${APPROOT} pattern with plain "add" commands, which is appropriate for this use case since the Info.plist is created fresh each time.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

@nicolasnoble nicolasnoble merged commit a285e14 into grumpycoders:main Aug 28, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants