Skip to content

Conversation

@williscool
Copy link
Owner

@williscool williscool commented Jan 15, 2026

fast follow p4

  • main activity can use some code cleanup to cleanly separate new and old UI stuff need to research some declarative UI stuff for Android (cloud agent can actually do this)

Splits MainActivity into a router and dedicated MainActivityLegacy and MainActivityModern activities to separate dual UI implementations.

The original MainActivity contained intertwined logic for both a legacy RecyclerView UI and a newer fragment-based navigation UI, leading to significant code duplication and conditional branching. This refactoring isolates each UI into its own activity, improving maintainability, testability, and preparing the modern UI for future enhancements.


Open in Cursor Open in Web


Note

Separates dual UIs and centralizes shared behavior for clarity and testability.

  • Introduces MainActivityBase for shared lifecycle, permissions, and utilities (incl. storage providers and cleanupOrphanedEvents)
  • Rewrites MainActivity as a router that forwards to MainActivityLegacy or MainActivityModern based on Settings.useNewNavigationUI (preserves intent extras)
  • Adds MainActivityLegacy (original RecyclerView UI) and MainActivityModern (fragment + bottom nav) with dedicated menu/search handling
  • Keeps backward-compatibility aliases in MainActivity.companion delegating to MainActivityBase
  • Updates AndroidManifest.xml to declare MainActivityLegacy/MainActivityModern and keep MainActivity as launcher
  • Updates NavigationSettingsFragmentX to launch the specific activity after toggling the UI setting
  • Adjusts test fixtures to launch MainActivityLegacy/MainActivityModern directly; adds instrumentation test for Dismissed tab; minor test cleanup and dialog handling
  • Adds developer doc docs/dev_todo/main_activity_split.md outlining the refactor

Written by Cursor Bugbot for commit be4054a. This will update automatically on new commits. Configure here.

@cursor
Copy link

cursor bot commented Jan 15, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@williscool williscool marked this pull request as ready for review January 15, 2026 05:33
cursoragent and others added 2 commits January 15, 2026 05:55
…vities

- Create MainActivityBase with shared functionality (permissions, lifecycle, common menu items)
- Create MainActivityLegacy for the original monolithic UI with single RecyclerView
- Create MainActivityModern for fragment-based navigation with bottom tabs
- Simplify MainActivity to be a router that delegates to the appropriate activity
- Update AndroidManifest to declare new activities
- Update NavigationSettingsFragmentX to launch activities directly
- Update test fixtures to launch MainActivityLegacy directly for legacy UI tests
- Add launchMainActivityModern() to UITestFixture for modern UI tests

This refactoring separates the two distinct UI implementations that were
previously controlled by a runtime flag (useNewNavigationUI). Each activity
now has clear responsibility, making the code easier to maintain and test.

The backward compatibility aliases in MainActivity.companion ensure existing
code referencing storage providers continues to work.

Co-authored-by: wharris <wharris@upscalews.com>
Co-authored-by: wharris <wharris@upscalews.com>
@cursor cursor bot force-pushed the cursor/main-activity-ui-split-560a branch from be4054a to 04ff9ef Compare January 15, 2026 05:55
@github-actions
Copy link

Build artifacts for PR #178 (commit dfe3534) are available:

You can download these artifacts from the "Artifacts" section of the workflow run.

@williscool williscool changed the title Main activity UI split refactor: main activity UI split Jan 15, 2026
@github-actions
Copy link

github-actions bot commented Jan 15, 2026

Code Coverage Report

Overall Project 33.88% -2.3% 🍏
Files changed 42.02%

Module Coverage
app 43.58% -1.91%
x8664Debug 24.43% -2.67%
Files
Module File Coverage
app SearchableFragment.kt 76.47% -11.76% 🍏
MainActivityModern.kt 61.84% -36.58% 🍏
MainActivityBase.kt 52.46% -46.58%
ActiveEventsFragment.kt 50.37% -0.89% 🍏
MainActivityLegacy.kt 50.09% -48.03%
MainActivity.kt 7.07% -81.82%
NavigationSettingsFragmentX.kt 0% -11.76%
x8664Debug MainActivityBase.kt 47.22% -51.35%
MainActivityLegacy.kt 46.78% -50.97%
ActiveEventsFragment.kt 44.74% -2.96%
MainActivity.kt 8.08% -77.78%
NavigationSettingsFragmentX.kt 0% -11.76%
MainActivityModern.kt 0% -96.09%
SearchableFragment.kt 0% -58.82%

@github-actions
Copy link

📊 Code Coverage Summary

Coverage Type Coverage
Overall 33.93
Changed Files 40.95

View detailed coverage report

@github-actions
Copy link

Build artifacts for PR #178 (commit c681324) are available:

You can download these artifacts from the "Artifacts" section of the workflow run.

@github-actions
Copy link

📊 Code Coverage Summary

Coverage Type Coverage
Overall 33.89
Changed Files 40.95

View detailed coverage report

- Extend SearchableFragment interface with mute/dismiss all support methods
- Implement new methods in ActiveEventsFragment
- Show Mute All and Dismiss All menu items only on Active Events tab
- Handle menu item clicks with confirmation dialogs
- Notify fragment to reload data after bulk actions

Quiet hours is deprecated so remains hidden in modern UI.

Co-authored-by: wharris <wharris@upscalews.com>
@github-actions
Copy link

Build artifacts for PR #178 (commit 47c7e0b) are available:

You can download these artifacts from the "Artifacts" section of the workflow run.

@github-actions
Copy link

📊 Code Coverage Summary

Coverage Type Coverage
Overall 33.88
Changed Files 41.15

View detailed coverage report

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.

3 participants