Repository navigation
Description
Problem Statement
On the Changes screen, file navigation is currently presented as a full-width row of Previous file and Next file text buttons. The controls consume vertical space, feel visually disconnected from the diff being reviewed, and do not keep the selected file’s line totals close to the navigation action. A reviewer needs a compact, persistent way to move through the active Change Set while retaining the existing file picker, filtering behavior, hunk navigation, context controls, and stable-snapshot model.
Solution
Replace the existing previous/next file text-button row with a reusable, bottom-centered floating File Navigation Pill on iOS and Android.
The pill presents a left chevron, the selected File Diff’s addition and deletion totals, and a right chevron. Both totals are always visible, including zero values. The center summary is informational and does not open the changed-file picker. Both chevrons remain visible at all times, disable independently at navigation boundaries, and disable together while pull-to-refresh is running.
Navigation continues to respect the active path filter. Selecting another file resets the diff viewport to the top or first hunk. The pill remains above the safe area, and the diff reserves enough bottom space that its final rows are never obscured.
User Stories
- As a reviewer, I want compact floating file navigation, so that I can move through a Change Set without losing unnecessary vertical space.
- As a reviewer, I want the navigation control to remain visible while I scroll a diff, so that moving to another file is always convenient.
- As a reviewer, I want the control centered near the bottom of the screen, so that it is reachable and visually associated with the diff.
- As a reviewer, I want the selected file’s additions shown in the pill, so that I can understand the size of the current file change.
- As a reviewer, I want the selected file’s deletions shown in the pill, so that I can understand the complete size of the current file change.
- As a reviewer, I want both addition and deletion totals shown when either value is zero, so that the pill has a stable layout and communicates the complete current-file summary.
- As a reviewer, I want the totals to update when file selection changes, so that they always describe the visible File Diff.
- As a reviewer, I want a left chevron for the previous file, so that file stepping is not confused with leaving the Changes screen.
- As a reviewer, I want a right chevron for the next file, so that forward file navigation is compact and recognizable.
- As a reviewer, I want both chevrons to remain visible at Change Set boundaries, so that the control does not shift as I navigate.
- As a reviewer, I want the previous chevron disabled on the first navigable file, so that I understand there is no earlier file.
- As a reviewer, I want the next chevron disabled on the last navigable file, so that I understand there is no later file.
- As a reviewer, I want both chevrons disabled during pull-to-refresh, so that navigation cannot be immediately overwritten by the arriving snapshot.
- As a reviewer, I want the current snapshot and its counts to remain visible during refresh, so that the interface does not flash or lose context.
- As a reviewer, I want file navigation to respect my active path filter, so that the pill does not select files I intentionally excluded.
- As a reviewer, I want a newly selected file to open at the top of its diff or first hunk, so that I do not inherit a stale scroll position from the previous file.
- As a reviewer, I want the final diff rows to remain readable above the floating pill, so that the overlay never hides content.
- As a reviewer, I want the changed-file row to remain available, so that I can still open the filterable file picker directly.
- As a reviewer, I want the center count summary to remain informational, so that it does not imply an undocumented action.
- As a reviewer, I want existing Expand context and Collapse context controls to remain unchanged, so that this improvement does not remove context review behavior.
- As a reviewer, I want existing previous/next hunk controls to remain unchanged, so that hunk navigation remains available while its future design is deferred.
- As a VoiceOver or TalkBack user, I want the left and right controls announced as Previous file and Next file, so that their behavior is unambiguous.
- As a VoiceOver or TalkBack user, I want the selected file totals announced as additions and deletions, so that the visual summary is available nonvisually.
- As a user of a custom light or dark theme, I want the pill to use semantic surfaces, borders, icons, and diff colors, so that it remains legible and consistent.
- As a product reviewer, I want equivalent interactive gallery states on both platforms, so that enabled, disabled, boundary, zero-count, and refresh behavior can be reviewed before feature integration.
- As a developer, I want one shared component intent with native implementations, so that iOS and Android stay behaviorally aligned without introducing a cross-platform UI framework.
Implementation Decisions
- Add a reusable File Navigation Pill to the shared Component Collection with separate native SwiftUI and Jetpack Compose implementations.
- Use one semantic component role rather than a feature-local visual. Its public contract accepts current-file addition and deletion totals, previous and next availability, an overall enabled state, and previous/next actions.
- Counts are scoped to the selected File Diff, not aggregate Change Set totals.
- Counts render as
+N −N; both values remain visible for zero. - Use left and right chevrons. Do not use platform back arrows because those imply screen navigation.
- The center summary is static content and has no tap action.
- Previous and next controls remain present in every content state. Availability changes their enabled state rather than their visibility.
- The feature disables both directions while pull-to-refresh is active while continuing to display the current snapshot and counts.
- The pill replaces the existing Previous file and Next file text-button row.
- The changed-file picker row remains unchanged and remains the entry point for direct selection and filtering.
- Existing context expansion/collapse and hunk-navigation controls remain in their current form.
- Previous/next navigation continues to operate over the filtered file collection when a filter is active.
- A file navigation action selects the target file and resets the diff viewport to its top or first hunk, including when adjacent files have equivalent hunk identifiers.
- Present the pill as a bottom-centered overlay above the native safe area.
- Add sufficient bottom content inset to prevent the pill from covering the final diff rows.
- Reuse the established compact raised-pill visual language, semantic surface and border roles, strong icon treatment, addition/deletion semantic colors, and button typography. Component-specific geometry is documented through design-system tokens rather than exposed as arbitrary customization.
- Disabled and pressed behavior use native interaction semantics with equivalent observable meaning.
- Accessibility exposes two independent buttons named Previous file and Next file plus a noninteractive current-file summary that speaks additions and deletions.
- Loading, error, empty, and selected component states are not separate component variants. The Changes screen controls visibility and supplies enabled state; the pill is only shown when a File Diff is loaded.
- Register interactive Component Gallery entries and native light/dark previews on both platforms.
- No server API, persistence, domain schema, or generated-client changes are required.
- Preserve the read-only V1 boundary.
Testing Decisions
- Primary acceptance seam: the existing Changes-screen UI tests on iOS Simulator and Android emulator.
- Tests assert external behavior rather than internal view hierarchy, modifier choice, or state-storage implementation.
- At the screen seam, verify that the old Previous file and Next file text-button row is absent and the floating pill is present for loaded content.
- Verify the visible current-file
+N −Nsummary, including mixed totals and zero-valued additions or deletions. - Verify both chevrons remain present, with previous disabled at the first filtered file and next disabled at the last filtered file.
- Verify tapping an enabled direction changes the selected file and updates the visible counts.
- Verify navigation respects an active path filter.
- Verify file navigation resets the new diff to its top or first hunk rather than retaining the previous file’s scroll position.
- Verify both directions disable while a controlled refresh is in progress and re-enable according to the refreshed snapshot.
- Verify bottom content remains reachable and unobscured by the floating overlay.
- Add focused component-level tests only for behavior the screen seam cannot isolate cleanly: independent action dispatch, enabled/disabled blocking, stable zero-count formatting, and accessibility labels.
- Use the existing Review Changes Pill component tests, gallery previews, and Changes-screen navigation tests as prior art.
- Component Gallery and native previews provide visual review for light/dark appearance, first/middle/last boundaries, refresh-disabled state, mixed totals, and zero totals.
- Focused platform builds and the existing Changes view-model tests remain regression checks for snapshot, filtering, and selection behavior.
Out of Scope
- Redesigning, floating, combining, or removing previous/next hunk navigation.
- Redesigning, floating, combining, or removing Expand context and Collapse context.
- Making the count summary tappable or using it to open the changed-file picker.
- Adding a file position indicator such as “2 of 5” to the pill.
- Wrapping navigation from the last file to the first or from the first file to the last.
- Changing the file picker, filter UI, reviewed markers, Change Source menu, or pull-to-refresh behavior.
- Live diff updates, polling, or event-driven snapshot mutation.
- Editing, applying, reverting, or otherwise mutating files.
- Persisting viewer-local state.
- Introducing new server endpoints, transport models, or persistence schemas.
Further Notes
- Parent follow-up: OPE-43 Session Diff Viewer fixes and improvements.
- Feature docs:
docs/features/review-changes/. - The design was grilled before specification. The agreed future hunk/context floating control is explicitly deferred rather than partially designed here.
- iOS and Android should have no intentional product or accessibility divergence.
Imported from Linear OPE-44. Linear status: Done. Priority: Medium. Created 2026-07-14. Completed 2026-07-14.
Parent: OPE-43.
Activity