Skip to content

Move action controls to control panel - #177

Merged
candour merged 1 commit into
mainfrom
move-action-controls-to-panel-16881919976136900652
Jun 2, 2026
Merged

Move action controls to control panel#177
candour merged 1 commit into
mainfrom
move-action-controls-to-panel-16881919976136900652

Conversation

@candour

@candour candour commented Jun 2, 2026

Copy link
Copy Markdown
Owner

This change moves the user interface for 'Remove Pillar' and 'Wet Outdoors' (outdoor puddles) actions from an overlay on the game board to a dedicated state in the right-hand control panel. When these modes are active, the control panel content is replaced with instructions and a 'Cancel' button, providing a cleaner play board and a more integrated control experience.


PR created automatically by Jules for task 16881919976136900652 started by @candour

Summary by CodeRabbit

  • UI Refactoring
    • Reorganized special mode controls for "remove pillar" and "outdoor puddle" modes into a dedicated action control interface.
    • Enhanced user guidance with clearer mode-specific prompts and improved cancel button behavior.
    • Integrated haptic feedback for mode exit actions.

- Created a new `ActionControlPanel` component in `GameControlPanel.kt` to display instructions and cancel buttons for special modes.
- Removed the board-level overlays for "Remove Pillar" and "Wet Outdoors" in `MainActivity.kt`.
- Updated `GameControlPanel` to conditionally render the action panel, replacing the standard stall selector when a special mode is active.
- Ensured UI elements in the action panel scale correctly with the screen size.

Co-authored-by: candour <4670475+candour@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

MainActivity removes inline "remove pillar" and "outdoor puddle" mode UI overlays and delegates rendering to GameControlPanel through new mode activation flags and exit callbacks. GameControlPanel gains a new ActionControlPanel composable that conditionally renders mode-specific instructions and a cancel button.

Changes

Mode-specific UI Refactoring

Layer / File(s) Summary
GameControlPanel contract and ActionControlPanel implementation
app/src/main/java/com/messark/hawker/ui/components/GameControlPanel.kt
GameControlPanel adds four new parameters: isRemovePillarModeActive, isOutdoorPuddleModeActive, onExitRemovePillarMode, and onExitOutdoorPuddleMode (all with defaults). A new ActionControlPanel composable renders background and mode-specific text ("select a pillar to remove" or "select starting outdoor tile"), with a red cancel button that triggers haptics and calls the appropriate exit callback. Imports updated to material3 and include Icons/Close. Conditional branch in GameControlPanel switches to ActionControlPanel when either mode is active.
MainActivity integration and cleanup
app/src/main/java/com/messark/hawker/MainActivity.kt
Removed GameScreen's inline conditional UI blocks that displayed mode instructions and cancel buttons. Updated GameControlPanel invocation to pass new mode activation flags and exit callbacks wired to viewModel methods.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • candour/towerpower#137: Implements and controls the "remove pillar" mode UI/exit flow, with this PR refactoring that wiring from MainActivity overlays into GameControlPanel.
  • candour/towerpower#172: Modifies GameControlPanel text scaling by changing how textScaleFactor is computed, complementary to this PR's introduction of ActionControlPanel with scaling parameters.
  • candour/towerpower#74: Restructures GameControlPanel rendering based on selectedBoardStall, while this PR extends the same component to switch to ActionControlPanel and add mode parameters.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately summarizes the main change: moving action control UI from the game board overlays into the GameControlPanel component.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 move-action-controls-to-panel-16881919976136900652

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 and usage tips.

@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown

Build Successful! 🚀

Download APK

Note: This link will be removed when the PR is closed.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1b601a61-50c1-41cf-b9fb-3192aa0ea5ff

📥 Commits

Reviewing files that changed from the base of the PR and between 178051b and 0ec8ace.

📒 Files selected for processing (2)
  • app/src/main/java/com/messark/hawker/MainActivity.kt
  • app/src/main/java/com/messark/hawker/ui/components/GameControlPanel.kt

@candour
candour merged commit 9d1bdbd into main Jun 2, 2026
3 checks passed
@candour
candour deleted the move-action-controls-to-panel-16881919976136900652 branch June 2, 2026 12:24
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