Skip to content

ADFA-3717: Render inactive toolbar actions as disabled instead of hidden#1181

Merged
Daniel-ADFA merged 4 commits intostagefrom
ADFA-3717
Apr 20, 2026
Merged

ADFA-3717: Render inactive toolbar actions as disabled instead of hidden#1181
Daniel-ADFA merged 4 commits intostagefrom
ADFA-3717

Conversation

@Daniel-ADFA
Copy link
Copy Markdown
Contributor

@Daniel-ADFA Daniel-ADFA commented Apr 14, 2026

Screen_recording_20260414_230923.webm

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 14, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: feef6307-1007-4fd8-bcf6-10731611f529

📥 Commits

Reviewing files that changed from the base of the PR and between 22b9e63 and 1951a33.

📒 Files selected for processing (1)
  • app/src/main/java/com/itsaky/androidide/activities/editor/EditorHandlerActivity.kt
✅ Files skipped from review due to trivial changes (1)
  • app/src/main/java/com/itsaky/androidide/activities/editor/EditorHandlerActivity.kt

📝 Walkthrough

Release Notes - ADFA-3717

  • Changed toolbar action rendering behavior: Inactive toolbar actions are now displayed as disabled (visually grayed out with 76% opacity) rather than being completely hidden from the toolbar

  • Improved discoverability: Users can now see all available toolbar actions, including those that are temporarily disabled, making the UI more transparent about available functionality

  • Visual feedback enhancement: Disabled actions are clearly indicated through reduced opacity, while fully enabled actions maintain full brightness (255% alpha)

  • Behavioral change: The action.visible flag is no longer checked during toolbar rendering; only actions explicitly listed in hiddenIds are excluded from the toolbar

Potential Risks & Best Practices Violations

  • Toolbar space/layout impact: Adding previously hidden actions to the toolbar may increase the horizontal space required. This could cause layout issues on small screens or with many active actions enabled. Consider testing with various screen sizes and action configurations

  • User expectation shift: Existing users may be confused by the sudden appearance of previously hidden actions. Consider providing in-app guidance or documentation about this UI change

  • Inconsistent visibility logic: The change creates a divergence between action.visible (which is now ignored for rendering) and actual display state. This could lead to confusion during future development. Consider documenting the intended behavior of the visible flag and whether it should be deprecated

Walkthrough

The toolbar menu construction in EditorHandlerActivity.prepareOptionsMenu() now skips actions only when their action.id is in hiddenIds; the previous check that excluded actions with visible == false was removed, so non-hidden actions are processed regardless of their visible flag.

Changes

Cohort / File(s) Summary
Menu Action Filtering Logic
app/src/main/java/com/itsaky/androidide/activities/editor/EditorHandlerActivity.kt
Changed the action filtering condition to exclude solely by hiddenIds membership, removing the action.visible == false exclusion so non-hidden but non-visible actions are still configured and added to the toolbar.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped through code with eager paws,
I nudged a check without a pause,
Hidden IDs now hold the door,
Invisible sprites dance once more,
Toolbar lights up — a joyful cause! ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

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.
Description check ❓ Inconclusive The description contains only a screen recording link without any meaningful text explaining the changes or objectives. Add a text description explaining what the change does, why it's being made, and what the expected behavior should be.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: modifying toolbar action rendering behavior to show inactive actions as disabled instead of hidden.

✏️ 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 ADFA-3717

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.

Copy link
Copy Markdown
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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/src/main/java/com/itsaky/androidide/activities/editor/EditorHandlerActivity.kt (1)

434-444: ⚠️ Potential issue | 🟠 Major

Do not allow visible=false actions to remain executable from the toolbar.

After removing the visibility gate, any action with visible=false but enabled=true can now render and execute via toolbar click. That breaks the UI/behavior contract. If the goal is “show inactive actions as disabled,” compute a UI-enabled state from both flags and gate alpha/click with it.

Suggested patch
 			action.prepare(data)

 			if (action.id in hiddenIds) return@onEachIndexed
+			val isUiEnabled = action.visible && action.enabled

 			action.icon?.apply {
 				colorFilter = action.createColorFilter(data)
-				alpha = if (action.enabled) 255 else 76
+				alpha = if (isUiEnabled) 255 else 76
 			}

 			content.projectActionsToolbar.addMenuItem(
 				icon = action.icon,
 				hint = getToolbarContentDescription(action, data),
-				onClick = { if (action.enabled) registry.executeAction(action, data) },
+				onClick = { if (isUiEnabled) registry.executeAction(action, data) },

Based on learnings: in app/src/main/java/com/itsaky/androidide/shortcuts/IdeShortcutActions.kt, visible is intentionally UI-only while enabled governs execution, so execution should not bypass UI visibility semantics.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@app/src/main/java/com/itsaky/androidide/activities/editor/EditorHandlerActivity.kt`
around lines 434 - 444, The toolbar currently lets actions with visible=false
but enabled=true be clicked; change the UI logic to compute a UI-enabled flag
(e.g., val uiEnabled = action.visible && action.enabled) and use that for
rendering and click gating: apply the alpha based on uiEnabled (255 vs 76) and
change the onClick to guard with uiEnabled before calling
registry.executeAction(action, data). Keep the existing hiddenIds check
(action.id in hiddenIds) as-is to still omit fully hidden items; update
references in the projectActionsToolbar.addMenuItem call and any uses of
action.enabled in this block to use uiEnabled instead.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In
`@app/src/main/java/com/itsaky/androidide/activities/editor/EditorHandlerActivity.kt`:
- Around line 434-444: The toolbar currently lets actions with visible=false but
enabled=true be clicked; change the UI logic to compute a UI-enabled flag (e.g.,
val uiEnabled = action.visible && action.enabled) and use that for rendering and
click gating: apply the alpha based on uiEnabled (255 vs 76) and change the
onClick to guard with uiEnabled before calling registry.executeAction(action,
data). Keep the existing hiddenIds check (action.id in hiddenIds) as-is to still
omit fully hidden items; update references in the
projectActionsToolbar.addMenuItem call and any uses of action.enabled in this
block to use uiEnabled instead.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e67292d9-4db5-4d8a-804f-6ff85cbc6229

📥 Commits

Reviewing files that changed from the base of the PR and between 8787677 and 22b9e63.

📒 Files selected for processing (1)
  • app/src/main/java/com/itsaky/androidide/activities/editor/EditorHandlerActivity.kt

@Daniel-ADFA Daniel-ADFA merged commit 173d7f2 into stage Apr 20, 2026
2 checks passed
@Daniel-ADFA Daniel-ADFA deleted the ADFA-3717 branch April 20, 2026 06:41
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.

2 participants