Skip to content

feat(mobile): open the sessions behind a dashboard row - #208

Open
nikbackdev wants to merge 1 commit into
mobile-android-dashboardfrom
dashboard-sessions-on-phone
Open

nikbackdev wants to merge 1 commit into
mobile-android-dashboardfrom
dashboard-sessions-on-phone

Conversation

@nikbackdev

Copy link
Copy Markdown
Collaborator

What changed

A row of a table on the phone's Dashboard page opens the sessions behind it, as the desktop Dashboard does: each session with its start and end, its own minutes, its tool, project and ticket. The minutes of the sessions of a row add up to the row. Sessions overlap in time are said to share their minutes, as on the computer. A row of a day or week for which the computer sent no sessions says so, with no empty list.

This is stacked on the Android Dashboard pull request (#206); the base of this pull request is its branch.

  • Agent. A new sync command, sync-dashboard-sessions, gives the sessions behind each group of the numbers the phone already copies. It reuses the computer's own dashboard-sessions counting, so the rows are the ones the numbers counted. A row has only start, end (UTC), minutes, tool, project, ticket and the first 8 characters of the session id: no text of a message.
  • Copy. The sessions are kept inside the numbers of their day or week, so they are replaced with them on each sync, and removed with them on "Delete everything" and on unpairing. No schema change.
  • Shared holder. DashboardHolder.sessionsOf(widget, row) gives a row its sessions with times in the computer's time zone, and whether they were sent and whether some share minutes.
  • Pages. iPhone pushes a list from the row; Android shows its Material counterpart in the page, with back handling.
  • Build numbers. Android version code 5 and iPhone build 261127.1, one above the build of feat(mobile): show the dashboard on Android #206.

Why a command of its own, and what it costs

The numbers items are capped at 14 KB and a page of a sync at 12 KB, and a heavy day has hundreds of sessions, so the sessions do not fit in the numbers items. They travel in sessions items (one group, several items for a long group) under a command of their own, paged by the same budget. Positions of this command are an entry and an item of it.

Compatibility: the message of sync-dashboard is unchanged and the protocol number stays 1. An older phone never asks for the new command and keeps working without the sessions. A newer phone that meets an older computer gets an error for the command, keeps the numbers and shows "has not sent the sessions".

Size: sessions are sent only for the entries that start within 62 days of the newest one, not for all history. On a fixture of 300 sessions of one project on one day, the day and its week hold 600 rows in 12 items and 94,392 bytes together, about 160 bytes a session for each entry that holds it (once for its day and once for its week). A heavy week of a few hundred sessions therefore adds about 50 KB for the week entry plus the same sessions again for their days. Entries are counted once and kept until their activity changes, so a check that finds nothing new sends and counts nothing.

Tests

  • the_sessions_of_each_group_come_in_pages_with_no_text_and_add_up_to_the_group (agent): on 300 sessions, every page is under the channel's line limit, every row has exactly the seven fields and no message text, and the rows of each group add up to the group's minutes in its numbers.
  • the_sessions_are_not_sent_for_days_long_before_the_newest_and_a_changed_part_is_said (agent): no sessions for a day or week older than the limit; the same token as the numbers; a stale token is answered changed.
  • SyncEngineTest: sessions arrive with the numbers of their day (a group in two items is put together) and a day with none keeps none; a computer that does not know the command still gives the numbers.
  • CopySyncTest: the sessions are kept with the numbers of their day, replaced by a sync that brings none, and gone after "Delete everything".
  • DashboardHolderTest: a row's sessions add up to the row with times in the computer's zone; overlapping sessions are flagged; a row of a day with no sessions is "not sent".
  • DashboardPageTest (Android) and DashboardTests (iPhone UI): a row opens its sessions, they add up, and a row of a day with none says the computer has not sent them (Android; the iPhone test checks the list against the row).

What ran

  • Agent: cargo fmt --check, cargo clippy --locked -p construct-agent --all-targets -- -D warnings clean; cargo test --locked -p construct-agent --test phone: 61 passed, 0 failed.
  • ./gradlew check --continue in mobile: ktlint, detekt, lint and all Android host tests pass (sync 39, database 64, dashboard 19, no failures). The only failing tasks are the iosSimulatorArm64Test ones: this Mac has Xcode and the iOS SDK but no Simulator runtime, and Gradle says so.
  • iosApp/check.sh: structure rules and swiftlint --strict clean (0 violations in 75 files).
  • xcodebuild build-for-testing for the iOS Simulator: succeeded, so the Swift pages and the UI test compile against the Kotlin framework.

What did not run

  • The iPhone Simulator run of DashboardTests and the Android emulator run of DashboardPageTest: no Simulator runtime and no Android system image on the machine this was written on. They compile but have not run.
  • Screenshots in the light and dark theme: not taken for the same reason, so none are attached. They are still to be added from a machine that can run them.

Signed-off-by: Nikita.Bazhenov <226111163+nikbackdev@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Nov 27, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7ea739b6-d455-45ba-9afd-e15e7f52aae4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

This branch has not been deployed

No deployments
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