Skip to content

ADFA-3634 Swap logo on tablet/dex left rail on project screen#1205

Merged
hal-eisen-adfa merged 1 commit intostagefrom
ADFA-3634-Update-icon-in-upper-left-of-landscape-tablet-Dex
Apr 18, 2026
Merged

ADFA-3634 Swap logo on tablet/dex left rail on project screen#1205
hal-eisen-adfa merged 1 commit intostagefrom
ADFA-3634-Update-icon-in-upper-left-of-landscape-tablet-Dex

Conversation

@hal-eisen-adfa
Copy link
Copy Markdown
Collaborator

This one was slightly more tricky. Updated enableMenuScrolling() to find the menu by type, then the headerLayout approach works safely.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 17, 2026

📝 Walkthrough

Release Notes

Features & Changes:

  • Swapped logo on tablet/Dex left rail on project screen (changed from app_dev_for_all_logo to cogo_brand_mark drawable)
  • Added new landscape layout variant (layout-land/fragment_editor_sidebar.xml) with navigation rail anchored to the left edge
  • Added new tablet/large screen layout variant (layout-sw600dp/fragment_editor_sidebar.xml) with optimized sidebar UI layout
  • Updated enableMenuScrolling() in IdeNavigationRailView.kt to dynamically locate the navigation menu view by scanning for NavigationBarMenuView type instead of assuming fixed child position

Risks & Best Practices Concerns:

  • Breaking assumption change: Modified enableMenuScrolling() to scan all children for NavigationBarMenuView instead of using fixed index (position 0). This could cause unexpected behavior if multiple NavigationBarMenuView children exist in the layout hierarchy
  • Parent-level guard condition change: Switched from checking if menuView itself is a NestedScrollView to checking if its parent is a NestedScrollView. This behavioral change may affect scenarios where the menu view is directly nested in a scroll view
  • Visual regression risk: Logo swap across multiple layout variants (default, landscape, tablet) should be verified on actual devices to ensure consistent appearance and sizing across all screen densities and orientations

Walkthrough

This PR refines the navigation rail menu scrolling logic to robustly locate menu views by scanning child elements, updates the sidebar header branding drawable, and introduces new landscape and tablet layout variants for the editor sidebar UI.

Changes

Cohort / File(s) Summary
Navigation Rail Scrolling Logic
app/src/main/java/com/itsaky/androidide/ui/IdeNavigationRailView.kt
Modified enableMenuScrolling() to scan all children and locate the first NavigationBarMenuView instance instead of assuming it is at index 0. Added guard condition to check if the found menu view's parent is a NestedScrollView before wrapping.
Editor Sidebar Layouts
app/src/main/res/layout-land/fragment_editor_sidebar.xml, app/src/main/res/layout-sw600dp/fragment_editor_sidebar.xml
Added landscape and tablet layout variants for editor sidebar UI with navigation rail anchored left, title at top, and fragment container filling remaining space for main content.
Sidebar Header Branding
app/src/main/res/layout/layout_editor_sidebar_header.xml
Updated logo drawable from @drawable/app_dev_for_all_logo to @drawable/cogo_brand_mark in the sidebar header.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested reviewers

  • itsaky-adfa
  • jomen-adfa
  • Daniel-ADFA

Poem

🐰 A navigation rail now sees,
With eyes that scan with gentle ease,
New layouts bloom for landscape views,
While branding marks wear fresher hues!

🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: swapping the logo on the tablet/Dex left rail, which is reflected in the layout and drawable resource modifications.
Description check ✅ Passed The description is related to the changeset, explaining the technical approach of updating enableMenuScrolling() to find the menu by type to support the headerLayout-based approach.

✏️ 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-3634-Update-icon-in-upper-left-of-landscape-tablet-Dex

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.

Actionable comments posted: 1

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/res/layout/layout_editor_sidebar_header.xml (1)

24-34: ⚠️ Potential issue | 🟡 Minor

Mark the header logo as decorative for accessibility.

If this logo is not actionable and does not convey unique screen content, keep it out of TalkBack traversal.

♿ Proposed fix
   <com.google.android.material.imageview.ShapeableImageView
     android:layout_width="@dimen/sidebar_header_logo_size"
     android:layout_height="@dimen/sidebar_header_logo_size"
     android:layout_gravity="center_horizontal"
+    android:importantForAccessibility="no"
     android:layout_marginStart="@dimen/sidebar_header_logo_padding"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/src/main/res/layout/layout_editor_sidebar_header.xml` around lines 24 -
34, The header logo ShapeableImageView is decorative and should be excluded from
accessibility traversal; update the ShapeableImageView element (the one using
app:srcCompat="@drawable/cogo_brand_mark") to mark it decorative by adding
android:contentDescription="@null" and android:importantForAccessibility="no" so
TalkBack ignores it.
🧹 Nitpick comments (1)
app/src/main/java/com/itsaky/androidide/ui/IdeNavigationRailView.kt (1)

6-6: Use Material's public menu accessor instead of scanning child internals.

NavigationBarView exposes getMenuViewGroup() in the public API, which avoids coupling this subclass to the direct child order and the concrete NavigationBarMenuView implementation. The Material version used (1.12.0) fully supports this API.

♻️ Proposed refactor
-import com.google.android.material.navigation.NavigationBarMenuView
 import com.google.android.material.navigationrail.NavigationRailView
@@
-            val menuView = (0 until childCount)
-                .map { getChildAt(it) }
-                .firstOrNull { it is NavigationBarMenuView }
-                ?: return@post
+            val menuView = menuViewGroup
 
             if (menuView.parent is NestedScrollView) return@post
🤖 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/ui/IdeNavigationRailView.kt` at line
6, The subclass IdeNavigationRailView currently imports and relies on the
concrete NavigationBarMenuView and child ordering; replace that internal
scanning with the public API NavigationBarView.getMenuViewGroup(): call
getMenuViewGroup() where you currently locate the menu view (e.g., in the
constructor or initialization code of IdeNavigationRailView), treat the result
as a ViewGroup instead of NavigationBarMenuView, remove the direct import of
com.google.android.material.navigation.NavigationBarMenuView, and update any
casts/usages to use the returned ViewGroup or safe APIs on it; this avoids
coupling to internal child ordering and the concrete implementation.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@app/src/main/res/layout-land/fragment_editor_sidebar.xml`:
- Around line 18-23: Change the resource directory qualifier for the
fragment_editor_sidebar layout so it only applies to tablets in landscape:
rename/move the current layout file that lives under the "layout-land" qualifier
to the "layout-sw600dp-land" qualifier so the ConstraintLayout (the root element
in fragment_editor_sidebar.xml) and its header reference
(`@layout/layout_editor_sidebar_header`) are only used on devices with sw>=600dp
in landscape; ensure the filename stays fragment_editor_sidebar.xml and update
any references if your build system requires it.

---

Outside diff comments:
In `@app/src/main/res/layout/layout_editor_sidebar_header.xml`:
- Around line 24-34: The header logo ShapeableImageView is decorative and should
be excluded from accessibility traversal; update the ShapeableImageView element
(the one using app:srcCompat="@drawable/cogo_brand_mark") to mark it decorative
by adding android:contentDescription="@null" and
android:importantForAccessibility="no" so TalkBack ignores it.

---

Nitpick comments:
In `@app/src/main/java/com/itsaky/androidide/ui/IdeNavigationRailView.kt`:
- Line 6: The subclass IdeNavigationRailView currently imports and relies on the
concrete NavigationBarMenuView and child ordering; replace that internal
scanning with the public API NavigationBarView.getMenuViewGroup(): call
getMenuViewGroup() where you currently locate the menu view (e.g., in the
constructor or initialization code of IdeNavigationRailView), treat the result
as a ViewGroup instead of NavigationBarMenuView, remove the direct import of
com.google.android.material.navigation.NavigationBarMenuView, and update any
casts/usages to use the returned ViewGroup or safe APIs on it; this avoids
coupling to internal child ordering and the concrete implementation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1b3f5b61-6e16-4c3a-9940-106795013fc7

📥 Commits

Reviewing files that changed from the base of the PR and between 6346415 and d76a403.

📒 Files selected for processing (4)
  • app/src/main/java/com/itsaky/androidide/ui/IdeNavigationRailView.kt
  • app/src/main/res/layout-land/fragment_editor_sidebar.xml
  • app/src/main/res/layout-sw600dp/fragment_editor_sidebar.xml
  • app/src/main/res/layout/layout_editor_sidebar_header.xml

Comment thread app/src/main/res/layout-land/fragment_editor_sidebar.xml
@hal-eisen-adfa hal-eisen-adfa merged commit 4ff3344 into stage Apr 18, 2026
2 checks passed
@hal-eisen-adfa hal-eisen-adfa deleted the ADFA-3634-Update-icon-in-upper-left-of-landscape-tablet-Dex branch April 18, 2026 00:53
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