Skip to content

ADFA-6312: Quick Build toolbar shows a visible stop icon while a build runs - #2106

Open
fryanpan wants to merge 2 commits into
stagefrom
fix/ADFA-6312-qb-building-icon
Open

fryanpan wants to merge 2 commits into
stagefrom
fix/ADFA-6312-qb-building-icon

Conversation

@fryanpan

@fryanpan fryanpan commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

ADFA-6312

Quick Build's toolbar button now shows a visible stop icon the whole time a build runs, in light and dark themes. On the Samsung A56 the button drew blank for the whole build — functional but invisible — so nothing signalled a build was running or how to stop it.

The BUILDING state now draws ic_stop_daemons (the Run button's static stop icon) instead of the animated ic_quick_build_building, so a stop icon is visible in both light and dark.

What to review

  • QuickBuildAction.kt — the BUILDING tone drops the animated spinner and reuses the Run button's static stop icon.
  • ToolbarIcon.kt — small helper that calls mutate() before tinting, so a layer-list icon keeps its colour.
  • EditorHandlerActivity.kt — routes toolbar icon tinting through that helper.
  • Three deleted drawables — the old animated building icons; no other users.

Screenshots

Before (origin/stage) the BUILDING-state button was blank; after the fix it draws the stop icon in light and dark, and it holds at 2x font scale. Before/after device screenshots (A56: light and dark, font scale 1.0 and 2.0, first-full-build and live-reload) were captured during the device pass and can be added to this PR on request.

Tested at 4fa62a2405

  • Unit suites — ToolbarIconTest (new, 3 cases) and QuickBuildActionPresentationTest (10 cases), both green.
  • Regression test — ToolbarIconTest pins the mutate-then-tint order; watched failing (icon drew raw white) with the order reverted, green with the fix.
  • Coverage — ToolbarIcon.kt: ToolbarIconTest covers 100% line (4/4), 100% instruction, and 83.3% branch (5/6) — null icon, enabled, disabled, and the mutate-then-tint path on a layered icon. The one uncovered branch is the null-return path of icon.mutate()?, unreachable because Drawable.mutate() contractually returns this and the ?. is Kotlin's safe-call on a platform return type.
  • Device — A56 (RZGYC24640P): the stop icon renders for the whole build in light and dark, at font scale 1.0 and 2.0; verified across a first full build and a live-reload build.

🤖 Generated with Claude Code

https://claude.ai/code/session_018DEPcb7gdHpRHRHXVqNnbf

fryanpan and others added 2 commits October 2, 2026 10:58
The BUILDING tone drew ic_quick_build_building, a layer-list of an
animated-rotate ring and a stop square. On the Samsung A56 the toolbar
slot rendered blank for the whole build: the button was there, enabled
and announced "Cancel build", but drew no pixels.

Bryan's call: drop the spinner and reuse the static ring-and-square the
Run button already shows (ic_stop_daemons), so both buttons present a
running build the same way. The three building drawables have no other
users and are deleted.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N1o4KqT54Vp2zpakJ54sbU
…eir colour

The editor toolbar set the colour filter on the action's icon and only then
called mutate(). LayerDrawable.mutate() rebuilds its layers from their constant
state, which drops a filter set beforehand, so a layer-list icon drew its raw
paint (white on the light toolbar). Tinting before mutate() also wrote onto
drawable state shared with other users of the same resource.

Mutate first, then tint and dim once, in a small toolbarIcon() helper so the
order is pinned by a Robolectric test.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N1o4KqT54Vp2zpakJ54sbU

@claude claude 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.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@coderabbitai

coderabbitai Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 15e8918e-43f7-4f9a-9183-52753f318ab6
📥 Commits

Reviewing files that changed from the base of the PR and between 1c33961 and 4fa62a2.

📒 Files selected for processing (9)
  • app/src/main/java/com/itsaky/androidide/actions/build/QuickBuildAction.kt
  • app/src/main/java/com/itsaky/androidide/activities/editor/EditorHandlerActivity.kt
  • app/src/main/java/com/itsaky/androidide/activities/editor/ToolbarIcon.kt
  • app/src/test/java/com/itsaky/androidide/actions/build/QuickBuildActionPresentationTest.kt
  • app/src/test/java/com/itsaky/androidide/activities/editor/ToolbarIconTest.kt
  • quickbuild/docs/manual-qa.md
  • resources/src/main/res/drawable/ic_quick_build_building.xml
  • resources/src/main/res/drawable/ic_quick_build_building_arc.xml
  • resources/src/main/res/drawable/ic_quick_build_building_stop.xml
💤 Files with no reviewable changes (3)
  • resources/src/main/res/drawable/ic_quick_build_building_stop.xml
  • resources/src/main/res/drawable/ic_quick_build_building_arc.xml
  • resources/src/main/res/drawable/ic_quick_build_building.xml

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.


📝 Summary
  • The Quick Build toolbar now shows the static ic_stop_daemons icon while a build runs. This matches the Run button’s stop icon.
  • Toolbar icons now use toolbarIcon, which mutates the drawable before applying its color filter and sets alpha based on the action’s enabled state.
  • Added tests for layered-icon tinting, enabled and disabled alpha, and missing icons. Updated the Quick Build presentation test and manual QA documentation.
  • Removed the three Quick Build building drawables.
  • Risk: Drawable tinting depends on mutate() returning a drawable. The supplied summary reports one uncovered null-return branch and describes it as unreachable under the Drawable.mutate() contract.

Walkthrough

The Quick Build BUILDING tone now uses the stop-daemons icon, and the former animated icon resources are removed. Editor toolbar action icons now use a helper that applies color filters and enabled-state alpha.

Changes

Quick Build building icon

Layer / File(s) Summary
Use the stop-daemons icon
app/src/main/java/com/itsaky/androidide/actions/build/QuickBuildAction.kt, resources/src/main/res/drawable/ic_quick_build_building*.xml, app/src/test/java/com/itsaky/androidide/actions/build/QuickBuildActionPresentationTest.kt, quickbuild/docs/manual-qa.md
The BUILDING tone now selects ic_stop_daemons. The former animated icon resources are removed. The presentation test and manual QA description reflect the stop icon.

Editor toolbar icon handling

Layer / File(s) Summary
Apply toolbar icon styling
app/src/main/java/com/itsaky/androidide/activities/editor/ToolbarIcon.kt, app/src/main/java/com/itsaky/androidide/activities/editor/EditorHandlerActivity.kt, app/src/test/java/com/itsaky/androidide/activities/editor/ToolbarIconTest.kt
toolbarIcon applies the supplied color filter and sets alpha to 255 when enabled or 76 when disabled. prepareOptionsMenu uses the helper. Tests cover layered icons, alpha values, and null icons.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 4fa62

This change makes the Quick Build button show a visible stop icon while a build runs and keeps toolbar icon tinting consistent. No actionable merge-blocking risk was identified.

🚥 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%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 5 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: Quick Build shows a stop icon while a build runs.
Description check ✅ Passed The description explains the icon change, the toolbar tinting helper, and the reported testing. It is directly related to the changeset.
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

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 5 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit taps the stop icon bright,
Then checks each layer for filters right.
When actions pause, their icons dim,
When enabled, full light returns to them.
The rabbit hops along, pleased with the sight.

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

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