Skip to content

Add controller button icons - #4

Merged
Producdevity merged 1 commit into
masterfrom
feat/controller-icons
Sep 1, 2026
Merged

Add controller button icons#4
Producdevity merged 1 commit into
masterfrom
feat/controller-icons

Conversation

@Producdevity

@Producdevity Producdevity commented Sep 1, 2026

Copy link
Copy Markdown
Owner

What does this change?

  • Replaces text-only control hints with pixel controller icons across the library, search, settings, sign-in, and loading screens.
  • Keeps face-button prompts in sync with the System and Swapped button-layout setting.
  • Updates the PortMaster screenshot.

How did you test it?

  • tools/zig.sh build test
  • tools/zig.sh build fmt-check
  • tools/zig.sh build smoke
  • tools/zig.sh build product-check
  • PORTMASTER_NEW=/path/to/PortMaster-New tools/zig.sh build package
  • RG35XX-H on muOS 2508.4: frontend launch, library/search/settings rendering, System and Swapped button labels and actions, clean exit, and frontend restoration.

Summary by cubic

Replaces text-only controller hints with pixel controller icons across the UI, and makes face-button prompts respect the System/Swapped button layout setting.

  • Adds control_icons.zig to render face buttons, dpad, sticks, bumpers, triggers, start, select, and guide icons.
  • Changes loading screen action prompts from string labels to a GoHandheldUiAction enum, centralizing allowed actions.
  • Updates library view, keyboard, settings, sign-in, device code, and loading screens to use the icon-based prompts.
  • A/B/X/Y icons swap when the Swapped button layout is active, matching the physical button labels.
  • Updates the PortMaster screenshot to show the new icons.

Written for commit 6d359dc. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features

    • Added controller icon prompts throughout loading screens, search, library, and settings views.
    • Added support for displaying face buttons, directional controls, sticks, bumpers, triggers, and system buttons.
    • Button prompts now respect swapped face-button settings.
    • Added clearer visual actions for back, cancel, retry, sign-in, and sign-out flows.
  • Tests

    • Added coverage for controller icon mappings and prompt layout fitting.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 10 files

Confidence score: 3/5

  • build.zig now adds control_icons.zig to the host test roots, causing zig build test to compile the transitive @cImport("SDL2/SDL.h") dependency through pixel_font.zig and view_style.zig; this can make the test executable fail to build where SDL2 headers are unavailable. Verify the test environment provides SDL2 or isolate the host test root from this dependency.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="build.zig">

<violation number="1" location="build.zig:468">
P1: Adding control_icons.zig to the host test roots makes `zig build test` compile `@cImport("SDL2/SDL.h")` (via control_icons.zig and transitively pixel_font.zig/view_style.zig), but the test executable built by b.addTest gets no libc or SDL2 and no include path was added. CI (ubuntu-latest) installs only the Zig toolchain in bootstrap.sh, so the CI `build test` step will fail to compile unless SDL2 dev headers happen to be present on the runner. The other tested src/ui files deliberately avoid SDL imports. Either install libsdl2-dev (and link SDL2) for the test root, or restructure control_icons so its tested code doesn't import SDL (e.g. pull the face/width logic into an SDL-free module).</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread build.zig
@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown

Review Change Stack

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: 5e7d6a9f-5ac2-481f-839b-895d718c373e

📥 Commits

Reviewing files that changed from the base of the PR and between 1a29e0b and 6d359dc.

⛔ Files ignored due to path filters (1)
  • packaging/portmaster/greenovercast/screenshot.png is excluded by !**/*.png
📒 Files selected for processing (9)
  • build.zig
  • src/app/release.zig
  • src/auth/xbox_auth.zig
  • src/catalog/service.zig
  • src/ui/control_icons.zig
  • src/ui/handheld_ui.h
  • src/ui/handheld_ui.zig
  • src/ui/library_view.zig
  • src/ui/settings_view.zig

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

The PR adds controller icon rendering, maps semantic buttons to physical layouts, replaces UI hint text with icon prompts, and changes loading-screen actions from nullable strings to GoHandheldUiAction values.

Changes

Controller Prompt UI

Layer / File(s) Summary
Controller icon rendering
src/ui/control_icons.zig, build.zig
Adds controller icon types, prompt layout and drawing helpers, face-button mapping, swap-pair rendering, and host tests.
Typed loading actions
src/ui/handheld_ui.h, src/ui/handheld_ui.zig, src/app/release.zig, src/auth/xbox_auth.zig, src/catalog/service.zig
Adds GoHandheldUiAction and updates loading-screen callers to pass typed actions.
Prompt integration in views
src/ui/handheld_ui.zig, src/ui/library_view.zig, src/ui/settings_view.zig
Replaces search, device-code, library, and settings text hints with mapped controller icon prompts.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: ⚪ Minimal · up to 6d359

This change updates controller prompts to use icons and respects the selected button layout; no actionable merge-blocking risk remains after normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant View
  participant HandheldUi
  participant ControlIcons
  participant SDLRenderer
  View->>HandheldUi: render prompt or loading action
  HandheldUi->>ControlIcons: build and draw icon prompts
  ControlIcons->>SDLRenderer: render controller shapes and labels
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the primary change: adding controller button icons across the UI.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files. (8 skipped: 8 unsupported.)

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/controller-icons

Warning

Git: CodeRabbit could not clone the repository, so clone-backed analysis was skipped and this review may be incomplete. Verify repository clone access, such as SSH credentials, before requesting another full review. If clone access is intentionally unavailable, use path_filters to narrow the review scope.


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

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

@Producdevity
Producdevity merged commit 2e97ea6 into master Sep 1, 2026
5 checks passed
@Producdevity
Producdevity deleted the feat/controller-icons branch September 1, 2026 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant