Skip to content

Replace route-row overflow with centered long-press menus#1891

Merged
bmander merged 4 commits into
mainfrom
agent/route-row-long-press
Jul 16, 2026
Merged

Replace route-row overflow with centered long-press menus#1891
bmander merged 4 commits into
mainfrom
agent/route-row-long-press

Conversation

@bmander

@bmander bmander commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • remove the three-dot overflow button from arrivals route rows and open the route schedule action by long-pressing the row
  • present row and ETA-pill long-press menus consistently in the center of the screen
  • give the shared menu a theme-aware rounded surface, contrasting outline, elevation, and bounded width
  • add the supplied outlined Material Symbols for schedule, trip status, reminders, and problem reports without pulling in the full extended-icons dependency
  • keep toolbar overflow menus, form dropdowns, and direct long-press actions in their existing presentation

Why

The route-level overflow contained only one secondary action, but its dedicated corner button added visual noise and reduced room for direction text. Once that action moved to long press, the existing anchor-based popup behavior also made otherwise equivalent context menus appear in different places depending on the row or horizontally scrolled ETA pill that launched them.

A single centered presentation makes these secondary actions predictable and keeps positioning, shape, border, width, and elevation isolated from screen-specific action logic.

User impact

Tapping route rows and ETA pills retains its existing behavior. Long-pressing a schedule-capable route row or another menu-bearing row now opens a consistent centered menu. The arrivals actions have recognizable leading icons, and rows without an available secondary action do not expose an empty menu.

Validation

  • ./gradlew test :onebusaway-android:compileObaGoogleDebugKotlin :onebusaway-android:compileObaMaplibreDebugKotlin :onebusaway-android:compileObaGoogleDebugAndroidTestKotlin -PwarningsAsErrors=true
  • ./gradlew connectedObaGoogleDebugAndroidTest --no-build-cache -Pandroid.testInstrumentationRunnerArguments.class=org.onebusaway.android.ui.arrivals.RouteArrivalRowLongPressTest
  • focused interaction test passed on the USB-connected Pixel 7 Pro before the behavior-neutral simplification pass
  • post-rebase range-diff confirms both commits are patch-identical to their pre-rebase versions

Based directly on main after #1865 landed.

Summary by CodeRabbit

  • New Features
    • Long-press an arrival row to access the route schedule, replacing the previous overflow button.
    • Added centered long-press action menus across arrivals, trips, saved lists, route details, and search.
    • Added schedule/trip status/reminder/report icons for improved menu recognition.
  • Accessibility
    • Added a descriptive long-press label when a route schedule is available.
  • Tests
    • Added an instrumented UI test verifying the long-press schedule flow opens the expected schedule URL.
  • Bug Fixes
    • Improved consistency and usability of contextual menus throughout the app.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4108d189-aaaa-48ac-8f04-5b8c1a836dd2

📥 Commits

Reviewing files that changed from the base of the PR and between e2295d1 and 4310e63.

📒 Files selected for processing (1)
  • onebusaway-android/src/androidTest/java/org/onebusaway/android/ui/arrivals/RouteArrivalRowLongPressTest.kt
🚧 Files skipped from review as they are similar to previous changes (1)
  • onebusaway-android/src/androidTest/java/org/onebusaway/android/ui/arrivals/RouteArrivalRowLongPressTest.kt

📝 Walkthrough

Walkthrough

This change replaces overflow-based route schedule actions with long-press menus, adds centered Compose menu infrastructure and icons, migrates existing long-press menus, and adds an instrumented test for opening a route schedule.

Changes

Long-press menu interactions

Layer / File(s) Summary
Shared centered menu foundation
onebusaway-android/src/main/java/org/onebusaway/android/ui/compose/components/*
Adds CenteredLongPressMenu and reusable schedule, trip-status, reminder, and report icons.
Arrivals schedule interaction
onebusaway-android/src/main/java/org/onebusaway/android/ui/arrivals/components/*, onebusaway-android/src/androidTest/.../RouteArrivalRowLongPressTest.kt
Route rows retain tap behavior for vehicle maps, use long-press for schedule actions, remove the overflow button, and validate schedule URL selection.
Existing menu migration
onebusaway-android/src/main/java/org/onebusaway/android/ui/{mylists,routeinfo,search,arrivals/components}/*
Existing trip, list, route-info, route-search, and stop-search menus use the centered menu container with existing action callbacks.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Rider
  participant RouteArrivalRow
  participant RouteActionsMenu
  participant ArrivalRowCallbacks
  Rider->>RouteArrivalRow: Long-press arrival row
  RouteArrivalRow->>RouteActionsMenu: Display schedule action
  Rider->>RouteActionsMenu: Select show route schedule
  RouteActionsMenu->>ArrivalRowCallbacks: Open schedule URL
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.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 title clearly captures the main change: replacing route-row overflow actions with centered long-press menus.
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.
✨ 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 agent/route-row-long-press

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.

Base automatically changed from feature/adjacency-focus-route-badges-1827 to main July 16, 2026 07:01
@bmander
bmander marked this pull request as ready for review July 16, 2026 07:02
@bmander
bmander force-pushed the agent/route-row-long-press branch from 5158f8e to e2295d1 Compare July 16, 2026 07:07
@bmander bmander changed the title Replace route-row overflow with long press Replace route-row overflow with centered long-press menus Jul 16, 2026

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@onebusaway-android/src/androidTest/java/org/onebusaway/android/ui/arrivals/RouteArrivalRowLongPressTest.kt`:
- Around line 37-39: Update the `@Suppress`("DEPRECATION") annotation on
composeRule in RouteArrivalRowLongPressTest to include the required one-line
rationale and tracking issue link, matching the format used by nearby Compose
tests; retain the suppression only if the deprecated API remains necessary.
🪄 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 Plus

Run ID: 6ef87a30-ee5c-465f-a1ea-6ff91d855fc8

📥 Commits

Reviewing files that changed from the base of the PR and between ac63ec6 and e2295d1.

📒 Files selected for processing (9)
  • onebusaway-android/src/androidTest/java/org/onebusaway/android/ui/arrivals/RouteArrivalRowLongPressTest.kt
  • onebusaway-android/src/main/java/org/onebusaway/android/ui/arrivals/components/ArrivalRows.kt
  • onebusaway-android/src/main/java/org/onebusaway/android/ui/arrivals/components/EtaStrip.kt
  • onebusaway-android/src/main/java/org/onebusaway/android/ui/compose/components/CenteredLongPressMenu.kt
  • onebusaway-android/src/main/java/org/onebusaway/android/ui/compose/components/MaterialSymbols.kt
  • onebusaway-android/src/main/java/org/onebusaway/android/ui/mylists/MyListScreen.kt
  • onebusaway-android/src/main/java/org/onebusaway/android/ui/routeinfo/RouteInfoScreen.kt
  • onebusaway-android/src/main/java/org/onebusaway/android/ui/search/RouteSearchContent.kt
  • onebusaway-android/src/main/java/org/onebusaway/android/ui/search/StopSearchContent.kt

Comment on lines +37 to +39
@Suppress("DEPRECATION")
@get:Rule
val composeRule = createComposeRule()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
rg -n -C2 '`@Suppress`\("DEPRECATION"\)|createComposeRule\s*\(' \
  onebusaway-android

Repository: OneBusAway/onebusaway-android

Length of output: 15365


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== RouteArrivalRowLongPressTest.kt ==\n'
sed -n '1,120p' onebusaway-android/src/androidTest/java/org/onebusaway/android/ui/arrivals/RouteArrivalRowLongPressTest.kt

printf '\n== Nearby compose tests with similar suppression ==\n'
sed -n '1,120p' onebusaway-android/src/androidTest/java/org/onebusaway/android/ui/arrivals/ArrivalAlertIndicatorTest.kt
printf '\n---\n'
sed -n '1,120p' onebusaway-android/src/androidTest/java/org/onebusaway/android/ui/arrivals/ArrivalsPanelHeaderTest.kt
printf '\n---\n'
sed -n '1,120p' onebusaway-android/src/androidTest/java/org/onebusaway/android/ui/compose/components/SlideBoxTest.kt
printf '\n---\n'
sed -n '1,120p' onebusaway-android/src/androidTest/java/org/onebusaway/android/ui/arrivals/EtaStripJustifyTest.kt

Repository: OneBusAway/onebusaway-android

Length of output: 20852


Document this suppression or remove it. @Suppress("DEPRECATION") needs the required one-line rationale and tracking issue link here, matching the nearby Compose tests; otherwise it violates the Kotlin warning policy.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@onebusaway-android/src/androidTest/java/org/onebusaway/android/ui/arrivals/RouteArrivalRowLongPressTest.kt`
around lines 37 - 39, Update the `@Suppress`("DEPRECATION") annotation on
composeRule in RouteArrivalRowLongPressTest to include the required one-line
rationale and tracking issue link, matching the format used by nearby Compose
tests; retain the suppression only if the deprecated API remains necessary.

Source: Coding guidelines

The centered long-press menu renders in a Dialog (a separate window).
On slower devices such as the CI emulator, the main composition can
report idle a frame before the dialog window is laid out, so the
immediate assertIsDisplayed() ran against an unplaced node and failed
(it passed on a faster physical device). Wait for the schedule item to
appear before clicking it, and document the createComposeRule()
deprecation suppression to match the sibling Compose tests (#1792).
@bmander

bmander commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the CI failure and the review comment:

  • CI test failure (RouteArrivalRowLongPressTest.longPressOpensScheduleWithoutOverflowButton, API-33 emulator): the centered menu now renders in a Dialog (a separate window). On the slower CI emulator the main composition reported idle a frame before the dialog window was laid out, so the immediate assertIsDisplayed() ran against an unplaced node ("…is not displayed") — it passed on the faster physical device. The test now waits for the schedule item to appear before clicking it, keeping the behavioral assertion that the click routes the schedule URL. Verified passing on the Pixel 7 Pro.
  • CodeRabbit comment: added the one-line rationale + tracking-issue link (Migrate EtaStripJustifyTest off deprecated createComposeRule (v2 breaks onGloballyPositioned dispatch) #1792) above the @Suppress("DEPRECATION") on composeRule, matching the sibling Compose tests.

Compiled clean with -PwarningsAsErrors=true.

The connected test longPressOpensScheduleWithoutOverflowButton failed on the
API-33 CI emulator (the physical-device pass in the PR was against the earlier
DropdownMenu version, before the switch to the Dialog-based centered menu).

Two compounding fragilities: the injected longClick() relied on the long-press
timeout elapsing against the test's virtual frame clock, which was racy on the
emulator (the hold sometimes registered as a plain tap, so the menu never
opened); and the Dialog's separate-window content is timing-sensitive to
observe. Across the two failing runs this showed up as the schedule item being
either present-but-"not displayed" or absent within the 5s wait.

Invoke the row's OnLongClick semantics action directly instead. combinedClickable
registers the same lambda as both the gesture and the accessibility action, so
this exercises the real long-press-opens-schedule wiring deterministically,
without the timeout race. onLongClickLabel disambiguates the row's schedule
action from the ETA pill's own trip-actions long press. Then wait for the
Dialog's schedule item and click it as before.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bmander
bmander merged commit 79bdcd8 into main Jul 16, 2026
3 checks passed
@bmander
bmander deleted the agent/route-row-long-press branch July 16, 2026 17: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.

1 participant