Skip to content

feat(app): combine Ask Anything, chat history and themed sheets - #19857

Closed
Itaxh1 wants to merge 4 commits into
BasedHardware:mainfrom
Itaxh1:feat/mobile-chat-settings-home
Closed

Itaxh1 wants to merge 4 commits into
BasedHardware:mainfrom
Itaxh1:feat/mobile-chat-settings-home

Conversation

@Itaxh1

@Itaxh1 Itaxh1 commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

What changed and why

Combines the Home Ask Anything button, saved mobile chat history and presentation, and the fix for sheets retaining their old background after a Light/Dark switch. Built from current upstream main (2fd2969ee1e7) with the three individual PRs preserved as separate commits for review.

Closes #19840, #19843 and #19854. The individual PRs remain open; this PR brings their changes together.

Individual PR Included change Original commit(s)
#19838 Mobile chat history, new chats, greeting/count animation, latest-answer follow-up and controlled header pull-to-close 25c033039427
#19844 Settings and shared sheets follow Light/Dark changes while open 05fa5fcfa55f
#19855 Centered text-only Ask Anything button on Home, with no icon or Home microphone shortcut 4382e907f0c2, 2c2d9bf21a2c

Home and chat

Home's bottom chat entry becomes one text-only button, keeping its pill dimensions, palette, border and position beside the recording control. HomeAskOmiButton is shared with the visual-audit scenario. Voice remains available in the chat composer.

The chat history page offers New Chat, app choices, saved sessions, refresh/retry and pagination. The Chat Apps management shortcut is removed while existing app choices remain available. Session creation happens once on the first question, and failed creation never sends into the server-current thread. History reads replace the transcript only after success; revision checks reject stale results. Deletion requires confirmation and server success; Clear Chat on a saved session is scoped to that session. Drafts survive history loading and ordinary rebuilds. Pendant voice replies cannot append to an explicitly selected past thread.

Empty chat shows the time-of-day greeting, first name, today's non-discarded conversation count and “What do you want to know?” on one 1.1-second entrance timeline. The count uses conversations already loaded in the provider. Only the latest completed answer can supply a follow-up above the composer; longer questions wrap within the available width. Header pulls settle or dismiss according to distance/velocity, and transcript scrolling cannot dismiss the sheet. Reduce Motion renders the final entrance state and stops repeating typing dots.

Settings and shared sheets

The original route captured the background color when it opened, while its content picked up the new palette. OmiSheetRoute resolves its surface again on theme rebuilds. Settings uses surface0; existing showOmiSheet callers use surface1, retaining their current API and shell. Transparent sheets that paint their own surface remain unchanged.

Integration and documentation

  • The Home conflict is resolved by preserving startFresh: true from feat(app): chat history, new chats and greeting for Ask Omi on mobile #19838 when the new button opens chat.
  • Localization conflicts are resolved through app/scripts/l10n.py: all existing main strings plus the 17 chat strings and one button label survive in all 49 locales; generated files are current.
  • An audit compares all 40 non-localization source-owned files to the individual PR tips. They match exactly, except for the intentional fresh-chat argument in Home. All 49 ARB dictionaries match main plus the source PR additions. Of 139 changed files, 99 are localization; the remaining 40 hold implementation, tests, documentation, fixtures and changelogs.
  • Chat architecture, thread/draft rules, motion, accessibility and test map are included. Sheet ownership and its theme behavior are documented beside the shared helper.
  • Existing chat-session endpoints are reused. No backend deployment or data migration is required. Rename/search/pinning and chat sharing are outside this change.

Screenshots

These are the seven original screenshots from the individual PR builds, collected here for review and hosted at an immutable asset commit. They are not presented as fresh screenshots of the combined build. Settings email addresses are blurred.

Home — #19855

Light Dark
Home in Light with text-only Ask Anything Home in Dark with text-only Ask Anything

Chat greeting and count — #19838

Chat greeting, conversation count, composer suggestions and history

Settings before and after — #19844

State Light Dark
Before Before: old dark Settings surface after switching to Light Before: old light Settings surface after switching to Dark
After After: Settings surface and header follow Light After: Settings surface and header follow Dark

Product invariants affected

none

The invariant-path selector reports no locked-invariant citations for this diff. Shared mobile brand and UX checks still run in preflight. The desktop transcript invariant does not govern this mobile session client.

How it was verified

  • TZ=UTC bash app/test.sh --concurrency 2 --reporter expanded: 3,613 ordinary tests passed, plus 138 opt-in contract tests, zero failures on the complete rerun.
  • TZ=UTC make mobile-verify ARGS="fast --all": all 6 journey files passed; 23 checks passed, zero failed/skipped. Coverage includes conversation detail, chat sending, memory editing, expired-session recovery, capture reconnection and persisted speaker names.
  • Focused chat/Home/Settings/voice/scroll integration suite: 62 passed.
  • (cd app && bash scripts/analyze_ratchet.sh): passed. (cd app && python3 scripts/l10n.py check): passed (49 locales, 3,492 keys). git diff --check: clean.
  • Repository preflight with the draft description: passed (23 selected checks). The history-based failure-class guard explicitly skipped its 90-day audit because this checkout is shallow; full-history hosted CI remains required for that check.
  • The combined profile build was installed on an iPhone 15 Pro Max, iOS 26.6.2, before opening this PR, then reinstalled on request with an explicit device-tool success receipt. After publication, a final profile build from the exact PR commit 390a380c76 was built and installed at 18:56 EDT on September 29. That commit SHA is embedded in its compiled binary and all 766 Dart source hashes match its build inputs. App/widget signing was verified; temporary signing/App Group overrides were restored and are absent from this diff.
  • Main advanced during validation only through desktop changelog commits 870a45e4f2 / 2fd2969ee1. The final rebase completed without conflicts. The entire tracked app/ Git tree, including tests/assets/native sources, is byte-identical between the tested snapshot 55a5c0ae3a and published head 390a380c76. Pre-push regenerated one ignored local environment output; the final phone build above was rebuilt afterward from the published commit. No reviewed source file changed.

The initial full run, alongside repository preflight, recorded 3,612 passes and one failure in the existing Limitless watchdog test's 70 ms wall-clock assertion. That test and its relevant device sources are identical to main. All four Limitless tests passed separately; the complete standalone rerun above passed without changing any test or device code.

Hermetic tests use loopback fixtures. Installation is confirmed; no automated interaction with the user's phone or new combined-build screenshot is claimed.

Initial hosted checks for this head have no failures (12 successful checks, 23 skipped jobs, one neutral review check). Heavy mobile jobs are among the skipped jobs.

Hosted full mobile CI requires a maintainer to add ci:full and then Re-run all jobs on the latest commit. The initial fork workflow defers heavy mobile checks; a passing aggregate from that run is not evidence that those checks executed.

Tests

Contract Regression coverage
Explicit session targeting; failed vs. empty history; malformed rows and pagination test/backend/chat_sessions_api_test.dart
Single-flight creation, fail-closed retry, stale reads, switching guards, deletion, disposal test/providers/chat_history_state_test.dart
Real chat/history navigation, retained drafts, latest follow-up, editable starters, header-only dismissal test/widgets/chat_history_navigation_test.dart
Stable focus/drafts, one entrance, Reduce Motion and small screens with large text test/widgets/chat_presentation_test.dart
Greeting timing, count easing, provider updates, discarded/local-day filtering test/widgets/chat_greeting_count_test.dart
History retry, selection, confirmed deletion and pagination test/widgets/past_chats_page_test.dart
Open Settings surface0 across Dark → Light → Dark; shared sheet surface1 across Light → Dark test/widgets/settings/settings_sheet_appearance_test.dart
Voice state, pendant history isolation, failure replies, citations and transcript scroll extents Existing provider/widget regressions in the full suite
Home chat entry and recording control Existing Home tests and visual-audit scenarios using the production HomeAskOmiButton

The three user-facing changes retain their individual changelog fragments. No check, baseline exception or unrelated cleanup is added.

Failure class (fixes)

Failure-Class: none

The Settings fix corrects a captured route surface through a shared primitive and a real-route regression test. The advisory platform-share class was inspected; its share-anchor/exception contract does not describe this theme-state defect.

showModalBottomSheet fixes a sheet's background when the sheet opens. After
switching the appearance on a page opened from Settings and going back, the
Settings sheet kept the old surface under rows and a header drawn in the new
palette: black behind white rows in Light, light behind dark rows in Dark,
with the header text invisible in both.

OmiSheetRoute reads its surface each time the theme rebuilds the sheet.
showOmiSheet uses it on surface1, and Settings uses it on surface0 in place
of its raw showModalBottomSheet.

(cherry picked from commit 05fa5fc)
The Home row's Ask Omi control looked like a text field (a grey "Ask Omi"
placeholder) with a mic that opened chat listening. It is now a button:
the Ask Omi glyph and label in primary text, on the same pill, height and
border as the record button beside it. Voice stays in the chat composer.

HomeAskOmiButton is shared by Home and the visual-audit frame, which kept
its own copy of the old bar.

(cherry picked from commit 4382e90)
Center the localized Ask Anything label and remove the chat glyph from the Home button. Keep the existing chat opening behavior and use the same control in Home and its visual audit.

(cherry picked from commit 2c2d9bf)
@Git-on-my-level

Copy link
Copy Markdown
Member

Thanks @Itaxh1 — this is a well-built combined change, and the backend story checks out. I verified against current main that every endpoint this PR relies on already exists with matching shapes: POST/GET /v2/chat-sessions (list is plugin_id-filtered, newest-first), DELETE /v2/chat-sessions/{id}, GET /v2/messages?chat_session_id=…, DELETE /v2/messages with session scope, and POST /v2/chat/generate-title accepting exactly the {session_id, messages[{text, sender}]} body ChatSessionsApi.title() sends. The "no backend change needed" claim holds.

Per-file notes on the implementation (40 non-l10n files; the other 99 are l10n/generated for the 18 new strings):

  • backend/http/api/chat_sessions.dart — clean typed API layer. Rows decode independently with rejectedRows counted into the pagination offset so malformed rows can't silently skip pages; ChatSessionSummary.fromJson rejects missing ids/unparseable dates rather than presenting them as history; session ids are query-encoded on delete and message reads.
  • providers/chat_history_state.dart — the async-state discipline here is genuinely good: epoch checks discard superseded reads, prepareChatSession() is single-flight and fail-closed (a failed creation throws before any send, so nothing lands in the server-current thread), and the legacy SharedPreferences cache is kept strictly out of explicitly selected sessions. Title generation is retryable and non-blocking.
  • providers/message_provider.dart — pendant voice replies are routed into a detached list when a past session is selected, so transient voice answers can't append to an archived thread; the voice re-entry guard now also respects text-send state.
  • pages/chat/page.dart — send gated on chatMutationInProgress || isLoadingMessages; failed history loads surface a retry banner instead of an empty-state claim; drafts survive history reads; load-older restores the scroll anchor after prepend.
  • pages/chat/chat_route.dart + widgets/chat_chrome.dart — header-only pull-to-dismiss with balanced Navigator gesture bookkeeping; transcript scrolling can no longer close the sheet.
  • ui/components/omi_sheet.dart — OmiSheetRoute.backgroundColor re-invoking the surface closure on rebuild is a minimal, correct fix for the Light/Dark stale-surface bug, and showOmiSheet keeps its existing API for other callers. settings_drawer.dart migrating off the raw showModalBottomSheet also clears an omi-ux-allow exception — nice.
  • widgets/home_bottom_bar.dart / pages/home/page.dart — replacing the duplicated _buildChatBar with a shared HomeAskOmiButton, and having the visual-audit scenario (capture.dart) draw the production widget instead of a private copy, removes a real drift risk.
  • Test coverage is strong for a change this shape: chat_history_navigation_test.dart (440 lines, real ChatPage↔history navigation), chat_history_state_test.dart (single-flight creation, fail-closed retry, switching guards, disposal), past_chats_page_test.dart, chat_greeting_count_test.dart, chat_presentation_test.dart, settings_sheet_appearance_test.dart (Dark→Light→Dark on real routes), plus the fixture-backend session stubs.

Things that need a maintainer call rather than fixes from you:

  1. Supersession: this PR combines feat(app): chat history, new chats and greeting for Ask Omi on mobile #19838, fix(app): Settings and sheets follow a Light/Dark switch while open #19844 and feat(app): clean up the Home bottom bar with an Ask Anything button #19855, which are all still open. Whichever artifact is chosen to merge, the others should be closed with credit so the changes don't double-land.
  2. UX direction: two embedded product decisions — removing the Home mic shortcut (voice now lives in the chat composer) and dropping the Chat Apps management shortcut from Past chats. Both look defensible from the diff, but they're direction calls, not correctness ones.
  3. CI evidence: as your own description notes, the fork run defers the heavy mobile jobs; full hosted mobile CI needs ci:full and a re-run on this commit before merge.

No security, auth, workflow, or dependency surfaces are touched, and I found nothing suspicious in the diff. Leaving the product/supersession decisions to human maintainer review — the implementation itself is in good shape.


AI-generated maintainer feedback on behalf of the Omi maintainers.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added positive-signal Automation verified a genuine fix/quality contribution needs-maintainer-review Needs a human maintainer to sign off before merge flutter flutter work labels Sep 30, 2026

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Mobile feature combining 3 sibling PRs (chat history, theme-aware sheets, Ask Anything button). Feature, not a bug fix -> approve-only. mergeStateStatus is DIRTY, so holding at approve per policy override (no rebase).

@Git-on-my-level Git-on-my-level removed the needs-maintainer-review Needs a human maintainer to sign off before merge label Oct 1, 2026
@Git-on-my-level

Copy link
Copy Markdown
Member

Reviewed the combined change on 390a380 — nice work bringing the three threads together coherently. File-level notes from static review (plus the green CI runs):

  • app/lib/backend/http/api/chat_sessions.dart: clean typed ApiResult wrapper over the existing session endpoints. Per-row decoding with rejectedRows surfaced for pagination math is the right call, and ids are properly URL-encoded in both path and query.
  • app/lib/providers/chat_history_state.dart: the epoch guards, single-flight session creation (failed create ⇒ no send, never falls back to the server-current thread), delete-only-after-server-success, and keeping the legacy unscoped cache away from explicitly selected sessions all match the PR description. Good state discipline.
  • app/lib/backend/http/api/messages.dart: chatSessionId threading through clearChatServer/sendMessageStreamServer handles both URL shapes (? vs &) correctly.
  • app/lib/ui/components/omi_sheet.dart: OmiSheetRoute re-reading surface() per build is the correct root fix for sheets keeping the stale background across Light/Dark switches, and showOmiSheet gives the other sheets a clean migration path.
  • app/lib/pages/chat/past_chats_page.dart: request-token stale-load discard, offset counting server rows (including rejected ones), and confirmed destructive delete — solid.
  • app/lib/providers/message_provider.dart: one thing beyond the three source PRs to be aware of at merge: the agent-chat keepalive path (startVmKeepalive/preConnectAgent) is removed entirely. If that's intentional with this rework, fine — just flagging it since it's a real behavior removal.
  • l10n: ~19 new keys across all locales via the standard tooling; generated files look consistent. The new app/lib/pages/chat/README.md claims matched the code everywhere I spot-checked. Test additions (navigation, history state, past chats, sessions API, sheet appearance) are substantial.

Two merge-time notes: the three source PRs (#19838, #19844, #19855) will be superseded by this one — they should be closed when this lands so the same changes can't be merged twice.

Leaving formal sign-off with the maintainer approval already recorded on this head.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Itaxh1 Itaxh1 closed this Oct 2, 2026
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Hey @Itaxh1 👋

Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request.

After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:

  • Project standards — Ensuring consistency across the codebase
  • User needs — Making sure changes align with what our users need
  • Code best practices — Maintaining code quality and maintainability
  • Project direction — Keeping aligned with our product principles and locked invariants

Before your next PR, please skim:

  • PRODUCT.md — product north star
  • Product invariants — locked rules (shared chat, memory tiers, agent control plane, integrations, brand)

If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing.

Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out.

Thank you for being part of the Omi community!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flutter flutter work positive-signal Automation verified a genuine fix/quality contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Omi AI chat update on mobile: past chats, new chats, greeting and pull-to-close

3 participants