Skip to content

ADFA-2328 Expand the ribbon slider to a new position and make it as wide as the app#755

Merged
hal-eisen-adfa merged 12 commits intostagefrom
ADFA-2328-Replace-scrolling-buttons-with-ordinary-list
Jan 6, 2026
Merged

ADFA-2328 Expand the ribbon slider to a new position and make it as wide as the app#755
hal-eisen-adfa merged 12 commits intostagefrom
ADFA-2328-Replace-scrolling-buttons-with-ordinary-list

Conversation

@hal-eisen-adfa
Copy link
Collaborator

@hal-eisen-adfa hal-eisen-adfa commented Dec 20, 2025

I had to change a lot more than I wanted to because it was hard to find what was injecting all the extra vertical whitespace. I'm open to suggestions on scaling back what I did.

I tested the long-press to tooltips on the ribbon slider toolbar - they still work.

Fixes #719

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 20, 2025

📝 Walkthrough

Release Notes: Ribbon Slider Position and Width Expansion

Features & Changes

  • Toolbar Architecture Refactored

    • Replaced CustomToolbar with MaterialToolbar (now title_toolbar) as the primary toolbar
    • Introduced new ProjectActionsToolbar class (renamed from CustomToolbar) to handle action menu items
    • Separated title display into dedicated TextView (title_text) within the title toolbar
  • Scrollable Menu Container

    • Converted toolbar menu from constrained layout to horizontally scrollable container using HorizontalScrollView
    • Added menu items with tighter spacing (8dp padding adjustments)
    • Enables horizontal scrolling for toolbar actions via android:scrollbars="horizontal"
  • Navigation & Drawer Toggle

    • Moved drawer toggle initialization from custom toolbar to title toolbar
    • Updated navigation icon handling with improved touch interception logic to prevent parent drawer layout interference
    • Refactored tooltip anchoring to use projectActionsToolbar instead of customToolbar
  • Layout Updates

    • Updated all layout references across activity_editor.xml, content_editor.xml, and created new project_actions_toolbar.xml
    • Adjusted TabLayout horizontal padding to 8dp
    • Modified SwipeRevealLayout drag handle to reference project_actions_toolbar
  • Activity Handler Updates

    • Updated EditorHandlerActivity and ProjectHandlerActivity to reference new toolbar components
    • Adjusted menu clearing and tooltip anchoring logic

Risks & Best Practices Concerns

  • ⚠️ Breaking API Change: CustomToolbar class renamed to ProjectActionsToolbar - any external code referencing the old class name will break
  • ⚠️ Deprecation Without Clear Migration Path: setTitleText() method deprecated without explicit guidance on backward compatibility or deprecation timeline
  • ⚠️ Large Refactoring Scope: Extensive toolbar architecture changes across multiple files increase risk of missing references or inconsistent behavior
  • ⚠️ Touch Interception Logic: New touch listener for menu items prevents parent drawer interception - potential edge cases with drawer gestures may not be fully tested
  • ⚠️ Binding Type Change: Private binding reference updated from CustomToolbarBinding to ProjectActionsToolbarBinding - ensure all binding references are updated consistently
  • ⚠️ Incomplete Testing Scope: Author notes "additional changes while locating extra vertical whitespace" - suggests scope creep; verify all changes are intentional and tested

Recommendations

  • Verify all toolbar references have been updated across the entire codebase
  • Test drawer toggle behavior thoroughly across different screen sizes and orientations
  • Test horizontal scrolling behavior with various menu item counts
  • Provide clear migration documentation for deprecated setTitleText() method
  • Consider adding version markers to the deprecation notice with target removal version

Walkthrough

The pull request refactors the editor toolbar architecture, separating the single CustomToolbar into two components: a MaterialToolbar for title and navigation, and a new ProjectActionsToolbar for action menu items. Corresponding layout and initialization changes are applied across activity classes.

Changes

Cohort / File(s) Summary
Activity Initialization
app/src/main/java/com/itsaky/androidide/activities/editor/BaseEditorActivity.kt
Moves toolbar binding, drawer toggle setup, and tooltip anchoring from customToolbar to titleToolbar and projectActionsToolbar. Updates title display to use separate title_text TextView. Adjusts inset handling and post-initialization navigation icon tooltip wiring.
Menu/Action Preparation
app/src/main/java/com/itsaky/androidide/activities/editor/EditorHandlerActivity.kt, app/src/main/java/com/itsaky/androidide/activities/editor/ProjectHandlerActivity.kt
Updates toolbar references in prepareOptionsMenu and dialog anchoring from customToolbar to projectActionsToolbar for menu item management and tooltip positioning.
Layout Structure
app/src/main/res/layout/content_editor.xml, app/src/main/res/layout/activity_editor.xml
Replaces CustomToolbar with MaterialToolbar containing title_text TextView, adds new ProjectActionsToolbar component, and updates SwipeRevealLayout drag handle from custom_toolbar to project_actions_toolbar. Adjusts TabLayout padding.
Toolbar Definitions
common/src/main/res/layout/custom_toolbar.xml, common/src/main/res/layout/project_actions_toolbar.xml
Refactors custom_toolbar.xml to use horizontally scrollable LinearLayout instead of constrained multi-view layout. Adds new project_actions_toolbar.xml layout defining MaterialToolbar with scrollable menu container.
Toolbar Implementation
common/src/main/java/com/itsaky/androidide/ui/ProjectActionsToolbar.kt
Renames class from CustomToolbar to ProjectActionsToolbar, updates binding type, removes navigation icon handling (delegated to title toolbar), deprecates setTitleText, adjusts menu item margins, and adds touch listener to prevent parent drawer interception.
Build Configuration
.gitignore
Adds llama-api/bin/ ignore rule and corrects malformed "-assets/" entry to assets/.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • jomen-adfa
  • dara-abijo-adfa

Poem

🐰 A rabbit hops through toolbars wide,
Where titles rest and actions hide—
Two toolbars now where one did dwell,
A scrolling nest, a nav carousel!
Cleaner, brighter, side by side, 🛠️

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title refers to expanding a ribbon slider and making it wider, but the actual changes are a comprehensive toolbar refactoring involving replacing CustomToolbar with MaterialToolbar, adding a title toolbar, renaming components, and restructuring layout composition. Update the title to reflect the actual main change: something like 'Refactor toolbar components: replace CustomToolbar with MaterialToolbar and add separate title toolbar' would better represent the extensive architectural changes.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The description mentions expanding the ribbon slider and making extra changes to address vertical whitespace, which aligns with the toolbar restructuring in the changeset.
✨ Finishing touches
  • 📝 Generate docstrings

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
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: 4

Caution

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

⚠️ Outside diff range comments (1)
common/src/main/java/com/itsaky/androidide/ui/CustomToolbar.kt (1)

18-18: Remove unused navigation icon long-click APIs.

The constructor parameter onNavIconLongClick and the method setOnNavIconLongClickListener provide an API surface for navigation icon long-click handling, but the navigation icon is explicitly cleared at line 25. These listeners will never be invoked, making this dead API that misleads consumers.

🔎 Proposed fix

Remove the unused constructor parameter and method:

 class CustomToolbar @JvmOverloads constructor(
     context: Context,
-    attrs: AttributeSet? = null,
-    var onNavIconLongClick: (() -> Unit)? = null
+    attrs: AttributeSet? = null
 ) : MaterialToolbar(context, attrs) {
-    fun setOnNavIconLongClickListener(listener: (() -> Unit)?) {
-        this.onNavIconLongClick = listener
-    }

Also applies to: 89-91

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ebf3820 and 17599e0.

📒 Files selected for processing (5)
  • app/src/main/java/com/itsaky/androidide/activities/editor/BaseEditorActivity.kt (4 hunks)
  • app/src/main/java/com/itsaky/androidide/ui/CompactMaterialToolbar.kt (1 hunks)
  • app/src/main/res/layout/content_editor.xml (1 hunks)
  • common/src/main/java/com/itsaky/androidide/ui/CustomToolbar.kt (1 hunks)
  • common/src/main/res/layout/custom_toolbar.xml (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
app/src/main/java/com/itsaky/androidide/activities/editor/BaseEditorActivity.kt (5)
idetooltips/src/main/java/com/itsaky/androidide/idetooltips/ToolTipManager.kt (1)
  • showTooltip (159-188)
lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/FieldBasedAction.kt (1)
  • showTooltip (250-256)
plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeTooltipServiceImpl.kt (2)
  • showTooltip (42-56)
  • showTooltip (58-70)
lsp/java/src/main/java/com/itsaky/androidide/lsp/java/actions/generators/OverrideSuperclassMethodsAction.kt (1)
  • showTooltip (228-230)
plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeTooltipService.kt (3)
  • showTooltip (8-34)
  • showTooltip (17-17)
  • showTooltip (25-25)
🔇 Additional comments (10)
common/src/main/java/com/itsaky/androidide/ui/CustomToolbar.kt (2)

40-44: LGTM! Clear deprecation with migration guidance.

The deprecation annotation includes helpful guidance pointing developers to the new title_text approach in content_editor.xml.


46-74: LGTM! Dynamic menu item creation is well-implemented.

The method properly configures ImageButton properties including tooltips, ripple effects, layout parameters, spacing, and click handlers.

app/src/main/java/com/itsaky/androidide/activities/editor/BaseEditorActivity.kt (3)

480-482: LGTM! Toolbar padding and insets correctly reset.

Zeroing both content insets and padding aligns with the new compact toolbar design.


602-606: Verify that preserving horizontal padding is intentional.

The code zeros vertical padding but preserves paddingLeft and paddingRight. Ensure this aligns with the design requirements for the title text layout.


623-641: LGTM! Drawer toggle properly configured.

The toggle is correctly instantiated with the title toolbar and registered with the drawer layout.

app/src/main/res/layout/content_editor.xml (3)

34-57: LGTM! CompactMaterialToolbar structure is well-defined.

The new toolbar correctly uses zero padding/insets and Material3 styling for the title text. The layout integrates cleanly with the existing AppBarLayout.


44-55: Verify navigation icon positioning with title margins.

The title_text has layout_marginStart="16dp" and layout_marginEnd="16dp". Ensure that the navigation icon (hamburger menu) positions correctly and doesn't overlap with the title text given these margins.

You can visually test this by:

  1. Running the app with the changes
  2. Opening the editor activity
  3. Verifying the hamburger menu icon and title text are properly spaced and aligned

59-67: LGTM! CustomToolbar properties updated appropriately.

The zero padding and minHeight settings align with the compact toolbar design. The 4dp top margin provides visual separation from the title toolbar.

app/src/main/java/com/itsaky/androidide/ui/CompactMaterialToolbar.kt (1)

20-24: LGTM! Initialization correctly removes padding and insets.

The zero padding/insets approach aligns with the compact toolbar design goals.

common/src/main/res/layout/custom_toolbar.xml (1)

14-34: LGTM! Clean horizontal scrolling menu container.

The simplified layout with HorizontalScrollView containing a LinearLayout is well-structured and aligns perfectly with the dynamic menu item management in CustomToolbar.kt. The zero padding and proper scroll configuration support the compact toolbar design.

@hal-eisen-adfa
Copy link
Collaborator Author

@coderabbitai generate docstrings

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 20, 2025

✅ Actions performed

Initiated docstring generation; will generate only if new commits exist.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 20, 2025

Note

Docstrings generation - SUCCESS
Generated docstrings for this pull request at #756

coderabbitai bot added a commit that referenced this pull request Dec 20, 2025
…y-list`

Docstrings generation was requested by @hal-eisen-adfa.

* #755 (comment)

The following files were modified:

* `app/src/main/java/com/itsaky/androidide/activities/editor/BaseEditorActivity.kt`
* `app/src/main/java/com/itsaky/androidide/ui/CompactMaterialToolbar.kt`
* `common/src/main/java/com/itsaky/androidide/ui/CustomToolbar.kt`
@jatezzz jatezzz self-requested a review December 22, 2025 15:38
Copy link
Collaborator

@jatezzz jatezzz left a comment

Choose a reason for hiding this comment

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

Hi @hal-eisen-adfa, I made a patch with some proposed improvements to your code, mostly focused on cleanup and removing a few unnecessary blocks. Let me know if you have any questions.

Code suggestions

@hal-eisen-adfa
Copy link
Collaborator Author

Hi @hal-eisen-adfa, I made a patch with some proposed improvements to your code, mostly focused on cleanup and removing a few unnecessary blocks. Let me know if you have any questions.

Code suggestions

Thank you - I've included them

@hal-eisen-adfa hal-eisen-adfa requested a review from a team December 30, 2025 17:50
Copy link
Contributor

@dara-abijo-adfa dara-abijo-adfa left a comment

Choose a reason for hiding this comment

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

I believe we may be able to achieve the desired outcome with fewer changes than are currently included in this PR. In particular, making updates to a small number of existing files (around five) without introducing new files may be sufficient.

I also noticed that the .gitignore file was modified as part of this PR, though it doesn’t appear to be directly related to the scope of this task. It might be worth revisiting whether that change is necessary here.

Lastly, the resulting UI may benefit from a bit of refinement, as the icons currently feel quite closely spaced.

Please let me know your thoughts, and I’m happy to discuss or clarify further.

Copy link
Collaborator

@jatezzz jatezzz left a comment

Choose a reason for hiding this comment

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

Looks good but there are some forced constrains aroind paddings in Kt code that doen't have a real effect, could move all those into the xml

hal-eisen-adfa and others added 3 commits January 6, 2026 09:23
… of github.com:appdevforall/CodeOnTheGo into ADFA-2328-Replace-scrolling-buttons-with-ordinary-list
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: 2

🤖 Fix all issues with AI Agents
In
@app/src/main/java/com/itsaky/androidide/activities/editor/BaseEditorActivity.kt:
- Line 479: Remove the redundant programmatic call to
projectActionsToolbar.setContentInsetsRelative(0, 0) in BaseEditorActivity.kt;
the insets are already set in the layout (project_actions_toolbar.xml) via
contentInsetStart/contentInsetEnd, so delete the invocation referencing
projectActionsToolbar.setContentInsetsRelative to avoid duplication.
- Around line 628-645: The navigation button search should be made defensive:
before the for-loop check that navigationContentDescription is not null or blank
and bail out early if it is; when comparing, use the child's contentDescription
safely (child.contentDescription?.toString()?.trim()) and compare in a forgiving
way (e.g., equals after trim or case-insensitive/contains as appropriate for
your UX) so minor differences don't silently fail; if no navButton is found
after the loop, emit a warning log (e.g., Log.w with this activity’s TAG) noting
the missing button and the expected navigationContentDescription; keep the
existing apply block and showTooltip(tag = TooltipTag.EDITOR_TOOLBAR_NAV_ICON)
behavior unchanged when a button is found.
🧹 Nitpick comments (1)
common/src/main/java/com/itsaky/androidide/ui/ProjectActionsToolbar.kt (1)

31-32: LGTM!

The deprecation is clear and guides developers to the new approach. Consider removing this method entirely in a future cleanup if no callers remain.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 29b9aab and 6e817d4.

📒 Files selected for processing (3)
  • app/src/main/java/com/itsaky/androidide/activities/editor/BaseEditorActivity.kt
  • app/src/main/java/com/itsaky/androidide/ui/CompactMaterialToolbar.kt
  • common/src/main/java/com/itsaky/androidide/ui/ProjectActionsToolbar.kt
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/src/main/java/com/itsaky/androidide/ui/CompactMaterialToolbar.kt
🧰 Additional context used
🧬 Code graph analysis (1)
app/src/main/java/com/itsaky/androidide/activities/editor/BaseEditorActivity.kt (3)
idetooltips/src/main/java/com/itsaky/androidide/idetooltips/ToolTipManager.kt (1)
  • showTooltip (160-189)
plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeTooltipServiceImpl.kt (2)
  • showTooltip (42-56)
  • showTooltip (58-70)
plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeTooltipService.kt (3)
  • showTooltip (8-34)
  • showTooltip (17-17)
  • showTooltip (25-25)
🔇 Additional comments (7)
app/src/main/java/com/itsaky/androidide/activities/editor/BaseEditorActivity.kt (4)

598-601: LGTM!

The title binding logic correctly retrieves the project name from the ViewModel and updates the TextView, with appropriate null-safety.


604-626: LGTM!

The drawer toggle setup correctly targets the title toolbar and registers the toggle with the drawer layout. The callback appropriately dismisses the keyboard and editor windows when the drawer opens.


976-988: LGTM!

The separation of drawer toggle setup (moved to setupToolbar()) from drawer layout behavior configuration is clear and well-documented.


1283-1289: LGTM!

The tooltip anchor correctly updated to use projectActionsToolbar, consistent with the toolbar refactoring.

common/src/main/java/com/itsaky/androidide/ui/ProjectActionsToolbar.kt (3)

21-26: LGTM!

Explicitly removing the navigation icon with a clear explanation is good practice, making the architectural change obvious to future maintainers.


46-53: LGTM!

The reduced margin spacing is well-documented and aligns with the goal of creating a more compact toolbar layout.


59-73: LGTM!

The touch listener implementation correctly prevents the DrawerLayout from intercepting touch events on toolbar buttons while preserving normal click/long-click behavior. This is a standard pattern for handling nested interactive views.

@hal-eisen-adfa
Copy link
Collaborator Author

I strongly feel we can achieve the result with less changes than we have in this PR. Specifically, with changes in about 5 of the existing files and no new files introduced, we should be good.

Also, I see the .gitignore file was modified in this PR, but it does not look related to this task.

Finally, the resulting UI could use some polishing; the icons are tightly spaced.

I've simplified the PR and removed one of the new files.

Can you show a screenshot of the icons being tightly spaced? They look ok on my S22 and my Pixel 9 emulator.

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

🤖 Fix all issues with AI Agents
In
@app/src/main/java/com/itsaky/androidide/activities/editor/BaseEditorActivity.kt:
- Around line 625-642: The code searching for the navigation button lacks
defensive checks: first verify navigationContentDescription is not null/blank
before posting the search (if null/blank, log a warning and skip the search),
then when iterating use safe nullable checks (compare
child.contentDescription?.toString() to navigationContentDescription) and if
navButton remains null after the loop log a warning that the nav icon was not
found (so tooltip failure is visible); only call
setOnLongClickListener/showTooltip on the non-null navButton as currently done.
🧹 Nitpick comments (1)
app/src/main/java/com/itsaky/androidide/activities/editor/BaseEditorActivity.kt (1)

597-600: Prefer view binding over findViewById for consistency.

The title_text TextView should be accessible via view binding as content.titleText instead of using findViewById. This maintains consistency with the rest of the codebase and provides compile-time safety.

🔎 Proposed refactor
-        // Set the project name in the title TextView
-        content.root.findViewById<android.widget.TextView>(R.id.title_text)?.apply {
-            text = editorViewModel.getProjectName()
-        }
+        // Set the project name in the title TextView
+        content.titleText.text = editorViewModel.getProjectName()
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6e817d4 and 9aa8c86.

📒 Files selected for processing (2)
  • app/src/main/java/com/itsaky/androidide/activities/editor/BaseEditorActivity.kt
  • app/src/main/res/layout/content_editor.xml
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-01-05T21:36:07.517Z
Learnt from: hal-eisen-adfa
Repo: appdevforall/CodeOnTheGo PR: 780
File: app/src/main/res/layout/activity_about.xml:123-124
Timestamp: 2026-01-05T21:36:07.517Z
Learning: In the CodeOnTheGo project, drawable resources should reside in the resources module at ./resources/src/main/res/drawable/, and the app module should depend on that module so drawables are accessible across the application. Do not duplicate drawables in app/src/main/res/drawable/. Ensure layout XMLs (e.g., activity_about.xml) reference drawables from the resources module via the module dependency (e.g., drawable/ name). This improves reuse, consistency, and reduces duplication across modules.

Applied to files:

  • app/src/main/res/layout/content_editor.xml
🔇 Additional comments (5)
app/src/main/res/layout/content_editor.xml (3)

34-57: LGTM!

The refactoring from CustomToolbar to MaterialToolbar with a nested TextView for title display is well-structured. The zero padding and content insets provide the custom layout control needed for the design.


59-67: LGTM!

The new ProjectActionsToolbar is properly configured with consistent styling matching the title toolbar above. The 4dp top margin provides appropriate visual separation.


80-80: LGTM!

The explicit horizontal padding declaration improves code clarity.

app/src/main/java/com/itsaky/androidide/activities/editor/BaseEditorActivity.kt (2)

973-974: LGTM!

The updated comment correctly documents that the drawer toggle setup has been moved to the setupToolbar() method.


1283-1283: LGTM!

The tooltip anchor has been correctly updated to reference projectActionsToolbar, aligning with the toolbar refactoring.

@hal-eisen-adfa hal-eisen-adfa merged commit b37d175 into stage Jan 6, 2026
2 checks passed
@hal-eisen-adfa hal-eisen-adfa deleted the ADFA-2328-Replace-scrolling-buttons-with-ordinary-list branch January 6, 2026 18:43
@dara-abijo-adfa
Copy link
Contributor

I strongly feel we can achieve the result with less changes than we have in this PR. Specifically, with changes in about 5 of the existing files and no new files introduced, we should be good.
Also, I see the .gitignore file was modified in this PR, but it does not look related to this task.
Finally, the resulting UI could use some polishing; the icons are tightly spaced.

I've simplified the PR and removed one of the new files.

Can you show a screenshot of the icons being tightly spaced? They look ok on my S22 and my Pixel 9 emulator.

Screenshot_20260106_202411

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.

Replace scrolling buttons with ordinary list

3 participants