Skip to content

feat(macOS): enable drag selection for completed chat messages - #10834

Merged
Git-on-my-level merged 3 commits into
mainfrom
codex/make-chat-messages-selectable
Jul 29, 2026
Merged

Git-on-my-level merged 3 commits into
mainfrom
codex/make-chat-messages-selectable

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Jul 29, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Enable regular native mouse-drag selection for settled main-chat message bodies.
  • Keep streaming content and transcript chrome unselectable to avoid the historical selection-overlay layout loop.
  • Include the two existing formatter-only desktop Swift changes required by the repository-wide formatter gate.

Validation

  • desktop/macos/scripts/swift-format-wrapper.sh format -i desktop/macos/Desktop/Sources/MainWindow/Components/OmiMarkdown.swift desktop/macos/Desktop/Sources/MainWindow/Components/ChatBubble.swift desktop/macos/Desktop/Tests/ChatTimelineContinuityTests.swift desktop/macos/Desktop/Tests/AgentPillLifecycleTests.swift
  • xcrun swift test --package-path Desktop --filter ChatTimelineContinuityTests
  • xcrun swift test --package-path Desktop --filter AgentPillLifecycleTests
  • Built and launched the isolated omi-chat-select named bundle against the offline local harness; sent a synthetic settled chat message and captured the rendered chat surface.
  • OMI_PR_BODY_FILE=/tmp/omi-chat-selection-pr.md make preflight

Product invariants

  • INV-CHAT-1

Review in cubic

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9da095336f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1325 to +1328
XCTAssertTrue(
markdownSource.contains("if textSelectionEnabled {")
&& markdownSource.contains(".textSelection(.enabled)")
&& markdownSource.contains(".textSelection(.disabled)"),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Exercise the selectable renderer instead of scraping its source

This test never constructs the newly enabled branch; it only searches source strings, while the existing OmiMarkdown layout harnesses use the default textSelectionEnabled: false. It therefore stays green if settled messages cannot actually be selected or if enabling selection reintroduces the prior SelectionOverlay layout loop. Render the production view with selection enabled and assert the selectable/stable outcome instead; repository guidance requires source-inspection tripwires to supplement rather than replace behavioral coverage.

AGENTS.md reference: desktop/macos/AGENTS.md:L181-L184

Useful? React with 👍 / 👎.

Git-on-my-level and others added 3 commits July 29, 2026 17:18
Address Codex P1 review feedback: the source-inspection tripwire only
searched strings, never exercising the production selection branch.

Add two behavioral tests:
- testSettledMessageBodyEnablesSelectionWhileStreamingBodyDoesNot:
  constructs OmiMarkdown via the isStreaming initializer used by
  ChatBubble and asserts textSelectionEnabled reflects streaming state.
- testSelectableMarkdownRendersWithStableLayout: renders a settled
  message body in NSHostingView and asserts finite/converging layout
  across passes — the regression proxy for the SelectionOverlay loop.
@Git-on-my-level
Git-on-my-level force-pushed the codex/make-chat-messages-selectable branch from 898484d to ea08727 Compare July 29, 2026 19:16
@Git-on-my-level
Git-on-my-level merged commit 6af3db1 into main Jul 29, 2026
24 of 26 checks passed
@Git-on-my-level
Git-on-my-level deleted the codex/make-chat-messages-selectable branch July 29, 2026 19:37
Git-on-my-level added a commit that referenced this pull request Jul 30, 2026
## Summary

- permanently exclude native SwiftUI text selection from the live chat
Markdown renderer
- remove the settled-message selection escape hatch that reopened the
layout-loop failure class
- add a narrow local/CI static boundary with adversarial fixtures
- replace the source-reading selection test with repeated real SwiftUI
transcript resizing

## Root cause

Omi Beta 0.12.146 reintroduced `.textSelection(.enabled)` for completed
messages in PR #10834. Completed messages are not actually
layout-static: loading history, scrolling, resizing the window, and
parent-state changes still relayout them.

On the affected running bundle, every sampled main-thread stack was
inside `SelectionOverlay.updateNSView`, `setFont`, intrinsic-size
invalidation, `AttributeGraph`, and `GraphHost.flushTransactions`. The
app reached roughly 8.8 GB resident memory, 8.6 GB swapped memory, and
90.6 million allocations while remaining unresponsive.

This is a recurrence of `FC-selection-overlay-layout-loop`, previously
addressed by PRs #9267 and #10471. An Equatable content boundary reduces
ordinary rebuilds, but cannot make an AppKit-backed selection overlay
safe inside a live scrolling transcript.

## Fix

`OmiMarkdown` now always applies `.textSelection(.disabled)` and no
longer accepts an initializer or property that can opt live chat back
into selection. Existing whole-message, code-block, and table copy
actions remain available. A future selectable reading experience must
use a separate non-live renderer.

The new `desktop-chat-selection-boundary` manifest check protects the
three authoritative live-transcript render files. This static tripwire
is necessary because SwiftUI provides no type-level exclusion for
`SelectionOverlay`; it is paired with a behavioral test that renders 16
completed messages and requires layout to converge when widths repeat
across a resize sequence.

## CI and review follow-up

- update the existing `AgentPillLifecycleTests` renderer assertion to
enforce the disabled-only selection contract
- restore the Windows portability workflow's manifest-owned `--check-id`
selection and missing Windows check registrations
- restore the already-tested Windows Job Object, safe-output, and
linked-worktree fallback behavior that the portability runner had
drifted behind

## Verification

- `python3 .github/scripts/check_chat_selection_boundary.py`
- `python3 .github/scripts/test_check_chat_selection_boundary.py`
- `python3 .github/scripts/test_preflight_runner.py` (23 tests)
- `python3 .github/scripts/test_pr_preflight.py` (36 tests)
- exact Windows workflow manifest command (3 selected checks)
- `python3 desktop/macos/scripts/check_desktop_test_quality.py`
- `python3 .github/scripts/test_run_checks.py`
- `xcrun swift test --package-path desktop/macos/Desktop --filter
AgentPillLifecycleTests.testOmiMarkdownParsesGFMTablesWithoutGeometryFeedback`
- `xcrun swift test --package-path desktop/macos/Desktop --filter
ChatTimelineContinuityTests` (37 tests)
- `desktop/macos/scripts/agent-logic-harness.sh --cross-surface-smoke`
- `desktop/macos/scripts/omi-macos-dev doctor`
- built and launched `omi-selection-loop-fix`
(`com.omi.omi-selection-loop-fix`) against the development backend
- drove the real main-chat path to 269 loaded messages with a completed
2,405-character Markdown reply, then repeatedly resized the actual main
window across 800–1200 px widths
- after the resize cycle: bridge healthy, transcript unchanged, no chat
error/stream, `snapshotStale=false`, 0.0% CPU, 138 MB RSS; in-process
main-window capture succeeded
- fast-relaunched the exact rebased branch and rechecked authenticated
main state, the same completed transcript, 0.0% CPU, and healthy
agent-runtime protocol 2
- `scripts/pr-preflight --pr-body-file /tmp/omi-selection-overlay-pr.md`
(90 selected checks against the rebased branch)
- the initial push hook also passed its selected checks; the final
rebased push skipped only the redundant hook after the exact outgoing
commit passed the full 90-check preflight

## Product invariants

- `INV-CHAT-1`

Failure-Class: FC-selection-overlay-layout-loop
Git-on-my-level added a commit that referenced this pull request Sep 2, 2026
…le transcript

The selection change this branch shipped is reverted. `OmiMarkdown` disables
native text selection again at both sites, explicitly, and the
`\.chatTextSelectable` environment key, `ChatTextSelectionPolicy` and
`OmiChatTextSelectability` are gone along with the host wiring in
`AIResponseView`, `FloatingControlBarView` and `OnboardingChatView` — those
hosts now carry no `textSelection` modifier around `OmiMarkdown` at all, since
the ones that were there before this branch were dead code under the inner
`.disabled`.

The settled-row gate was not enough. PR #10834 made the same argument and
reopened FC-selection-overlay-layout-loop in Omi Beta 0.12.146: every sampled
main-thread stack sat in `SelectionOverlay`, `setFont`, intrinsic-size
invalidation and AttributeGraph, and memory grew without bound. A settled row
is still rebuilt by transcript loading, scrolling, window resize and
parent-state updates, which is all that loop needs.
`.github/scripts/check_chat_selection_boundary.py` rejects the escape hatch and
names the remedy: the existing copy actions, or a separate non-live reading
surface.

So this adds the reading surface. "Select Text…" sits on the row's context
menu next to "Copy Message" and as an ibeam button in the hover strip, on
assistant and user rows alike. It opens `ChatSelectableTextPopover`: one
`NSTextView` over one message's copyable text — `isEditable` false,
`isSelectable` true, ⌘A and ⌘C native, Escape closes, sized to content with a
360 pt cap and internal scrolling. It is outside the transcript's layout and
does not mount until the reader asks for it, so it cannot take part in the
loading, scrolling and resize passes that made in-place selection unsafe. No
SwiftUI `textSelection` anywhere in it — AppKit selection is what an
`NSTextView` already is.

The strip now carries four controls plus the timestamp (thumbs, thumbs, copy,
select, info-when-present). At 24 pt each that still leaves the timestamp its
own room, so both affordances stay rather than context-menu only.

Everything else on this branch is unchanged: right-click Copy, focus-gated ⌘C,
the metadata-band policy, the transcript rhythm, the interrupted-turn marker,
adjacent duplicate collapse, and the accessibility fixes.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Git-on-my-level added a commit that referenced this pull request Sep 3, 2026
"Select Text…" opened a popover that re-printed the message in raw Markdown
next to the row the reader was already looking at, and only assistant rows had
it — a user turn has no hover strip, so their own words were never selectable
by any means.

SwiftUI's selection stays barred: PR #10834 put it back on settled rows and
reopened FC-selection-overlay-layout-loop in Omi Beta 0.12.146, every sampled
main-thread stack in `SelectionOverlay` and `setFont` while memory climbed.
But that bar is on `SelectionOverlay`, not on selecting. An `NSTextView` *is*
one selection: one view owns it, a rebuild replaces a string, and nothing
per-`Text` is mounted for a parent to thrash. `ChatSelectableTextPopover` said
so in its own header — it just kept that view outside the transcript.

So the words are the surface now. Chat prose renders through one text view per
block, parsed from exactly what the SwiftUI renderer parses, and the reader
drags across an answer in place with ⌘C copying what they highlighted.
Citation markers become link ranges rather than buttons, which is what made
the surrounding line selectable at all — a chip in a flow layout forced the
prose to be chopped into per-segment views — and they still open their source
and still preview it on hover.

Two things had to be got right. Height is measured beside the live view rather
than inside it, because a container left holding a measurement width wrapped
the answer to a width the transcript never granted; and the measurement is
synchronous, because publishing a height a frame late broke the transcript's
follow-scroll. The gesture harness reads pixels, and `cacheDisplay` stopped
seeing prose once it was drawn from a layer, so the probe composites the layer
tree and can measure the row again.

The boundary check now guards this file too: the AppKit path may never quietly
acquire the SwiftUI one.

Co-Authored-By: Claude Opus 5 <[email protected]>
Git-on-my-level added a commit that referenced this pull request Sep 5, 2026
…onomics (#12607)

* refactor(desktop): mount one chat shell for every account

DesktopHomeView held the app on a "Preparing Omi…" card until a network
call decided which of two shells to mount, then rendered either
ChatFirstShell or a legacy sidebar + DashboardPage tree. Both were the
same product with different chrome, and the legacy branch was the only
reason `useLegacyHomeDesign`, `useOldestHomeDesign`, DashboardPage's
inline chat, SidebarView, and the widget hub still existed.

The shell now mounts immediately for everyone. The server-owned
capability still resolves — same request, same analytics event, same
ChatProvider projection gate — but alongside the mounted shell rather
than in front of it, and it now only decides whether the capability-gated
kernel features engage. Capability-off renders the same shell.

`navigate help` named a "Help from Founder" page no shell had mounted for
a long time: the bridge resolved a title and then timed out. It now
resolves to Settings → About, where getting help from a person actually
lives.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* feat(desktop): render every content block as an interactable component

Six of the journal's block kinds — question card, task card, goal link,
capture link, conversation link, memory link — were dropped on the floor
by every Chat surface except one. `ContentBlockGroup.group` skipped them
unless `richBlockRenderingEnabled`, and `ChatBubble.blockView` returned
`EmptyView` for each of them again. A turn whose whole content was a task
card therefore read as an empty assistant reply in the task panel and in
the notch, and as a card you could tick off in the main window.

`ChatFirstRichBlockContext` is now non-optional on `QueryShellHome`,
`QueryAnswerThread`, `ChatMessagesView` and `ChatBubble`; the task panel
and the floating/notch renderers bind the shell's process-wide owners
through `.auxiliary`, so a card tapped in the notch summons the main
window and routes the one shell. `ChatFirstRichBlockGroupView` is the
single renderer all three hosts share.

Capability-off degrades rather than disappears: cards render, task
check-off works (it binds `TasksStore`, not the projection), links
navigate, and a question card shows its options dimmed and unpressable
with an explicit "Answering is unavailable right now" line, instead of a
question with no visible answers.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* fix(desktop): every proactive card says what it is

`showNotification` took an optional `kind:` and `FloatingBarNotification`
quietly filled it in from `assistantId`, whose default arm is `.general`.
Five producers never passed one — trial messaging, onboarding permission
help, both notch moments, and the whole generic proactive path — so their
cards journaled a bare `notification:<uuid>` continuity key and came back
in the transcript badged "Notification" with a bell, a row that says
nothing about what Omi actually noticed.

`kind:` is now required and never derived inside the value type. The
generic proactive path derives it once at the producer edge, from the
same `from(assistantId:)` call the category gate already makes three
lines earlier. `.trial` and `.onboarding` are new kinds and are excluded
from journaling alongside the integration nudge: billing copy and
permission help are not observations. `.functional` carries the system
notices that used to ride on `.general`.

`.general` survives as decode-only so historical bare keys keep reading
back, and its badge arm stays for exactly those rows.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* test(desktop): pin one shell and six live blocks, and retire the second-shell flows

The tests that protected the old shape are the reason it would come back:
`ChatFirstRichBlockTests` asserted that a caller without an explicit
context got *nothing*, and three flows waited on `shellVariant: legacy`.

- `OneChatShellRichBlockTests` builds one turn carrying prose plus all six
  interactable kinds and asserts the grouping keeps every one of them, in
  transcript order, on the same entry point the notch and task panel call.
  It then drives each link's typed navigation target through the real
  navigation owner, and pins capability-off to "options dimmed", never
  "options gone" — via a new `ChatFirstQuestionCardOptionsPolicy` that
  separates *answered* and *retired* (hide) from *capability-off* (disable).
- `ProactiveNotificationKindTests` walks every assistant id a producer
  ships and proves none of them derives `.general`, so no producer can mint
  a bare `notification:<uuid>` key; historical bare keys still decode.
- `check-single-chat-shell.py` (+ manifest entries, with a self-test) is
  the tripwire for the vocabulary that made a second shell expressible.
- `home-stage.yaml` and `dashboard.yaml` described `DashboardPage` and are
  deleted with it; `chat-first-capability-isolation.yaml` is repurposed to
  the assertion that now matters — capability-off mounts the same shell.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* fix(desktop): the notch and the main window share one navigation owner

`ChatFirstRichBlockContext.auxiliary` binds `ChatFirstShellNavigation.shared`
so a card tapped in the notch or the task panel routes the shell. The root
was still creating its own instance, so those taps would have moved a
navigation object nothing rendered — the card would appear to do nothing.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* refactor(desktop): delete the intelligence store nothing renders any more

`DashboardIntelligenceStore` fetched recommendations, projected them, and
kept a feedback outbox for a section that only `DashboardPage` mounted.
With the page gone its 750 lines had no renderer and no caller — the
grep is exact: the class was referenced only by its own file and its own
tests. Its 1,117-line test file went with it, because a test for a store
nothing mounts is coverage of nothing.

What stays is the part other surfaces still use: `TaskNavigationRequestStore`,
the exact-record handoff `QueryShellHome` and the chat-first task card give
the Tasks page instead of a tab index. The file is named for it now.

Three source-reading tests still pointed at `DashboardPage.swift` and
failed on the missing file rather than on anything real; they move onto
`QueryAnswerThread` / `QueryShellHome`, which is where Home's error card
and its colour tokens actually live.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* fix(desktop): an explicit settings section still wins over the help default

`navigate help` pre-selects About because that is where getting help from
a person lives. A caller that also names a section meant that section.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* fix(desktop): let a settled chat answer be selected, copied and seen as cut off

Three things a reader could not do with a reply on screen.

Select it. `OmiMarkdown` disabled native text selection outright, so a date
or a name in an answer could only be retyped. The reason was real — one
AppKit selection overlay per `Text`, on a row that rewrites its body every
streaming flush, is a non-converging layout loop (400 segments, 2 s hangs) —
but it is a reason about *streaming* rows. Selection is now opt-in through
`\.chatTextSelectable`, and `ChatTextSelectionPolicy` grants it to settled
rows only, on every surface that shows chat prose: the transcript, the notch,
the expanded floating bar, and onboarding. The three `.textSelection(.enabled)`
calls outside `OmiMarkdown` in the floating surfaces were dead — the inner
`.disabled` won — and are replaced rather than left as decoration.

Copy it without hunting. The copy button lived only in the hover-revealed
strip, and a user turn had no copy affordance at all. Every row now has a
"Copy Message" context menu over the same pasteboard write, and the copy
button takes ⌘C while its row's strip holds keyboard focus — not window-wide,
which would take the shortcut from selected prose and the composer.

See that it stopped mid-sentence. A voice barge-in persists the partial answer
with a terminal failed status, and the only failure affordance was a stamp for
a row with no text — so "…arrive on Saturday," rendered exactly like a
finished reply. `ChatTurnFailurePresentation` decides between that stamp and a
quiet trailing "Interrupted" mark, and the empty-row case is unchanged.

Also: the hover strip is now `accessibilityHidden` when it is invisible
(opacity and hit-testing hid it from the eye and the mouse but not VoiceOver),
each row carries a You/Omi label, and a row whose whole content is a rich
block reserves no metadata band — a memory card stamps its own time and has
nothing to copy or rate.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* fix(desktop): stop charging the transcript twice for the metadata band

Two consecutive one-line answers sat roughly 100 device pixels apart, and a
memory card floated in symmetric dead space. Measured on the real views:
44 pt between two settled replies, and a 48 pt card row inflated to 69 pt.

Two causes, both double-charges.

The hover strip is 28 pt of real reserved height under every settled reply.
The stack then added a full 16 pt inter-exchange gap on top of it, so the
separation the band already provides was paid for twice.
`ChatTranscriptLayout.spacing` now asks whether the row above reserves a band
and takes a hairline when it does; every other rung of the ladder is
unchanged, and a reply still binds to its question more tightly than to the
next exchange.

`ChatOmiMarkPlacement.rowHeight` reserved 32 pt on every assistant row for a
mark that only needs it when an empty streaming reply has no height of its
own. On a settled row the reservation did nothing but centre short content in
a box taller than itself — which is what put equal dead space above and below
the memory card. It now applies while streaming, top-aligned.

Measured after: 32 pt between two replies, 48 pt for the card row, and a
five-row transcript 296 pt tall instead of 341.

Also collapses adjacent repeats. Dedup only ran on messages over 200
characters, so three push-to-talk tries at the same ~90-character question
stuttered down the transcript untouched — each press mints a distinct
`voice:<uuid>` turn, so those are three legitimate journal rows and journal
identity is not the place to fix it. `adjacentDuplicateIDs` collapses a short
answer repeated in the row immediately below it within ten minutes, and folds
a failed barge-in fragment into the answer it is a strict prefix of. It stays
behind the existing expandable "Duplicate message" chip, so nothing is hidden
outright, and non-adjacent, distant, or cross-sender repeats are left alone.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* feat(app): decode chat content blocks into typed models

Mobile stored `content_blocks` as raw maps and, since #12015, hid any
message whose blocks were only desktop chat-first chrome (goal/task/
question) because there was no renderer for them. Both halves are now
wrong: the components are coming, so the schema needs a typed projection
and the hide filter has to go.

Add `ChatContentBlock`, a sealed model mirroring the canonical schema in
`desktop/macos/agent/src/runtime/types.ts` and the Swift codec's
required-field rules, decoding both the camelCase (desktop/agent) and
snake_case (chat-first spec) dialects. Malformed blocks are dropped;
unknown types become `UnknownContentBlock` so the message keeps its
synthesized fallback text instead of losing content. The raw list stays
authoritative on the wire — `toJson` is unchanged.

Delete `hideFromMobileChat` / `visibleOnMobile` and their four call sites
in MessageProvider, replacing the "is this body only the fallback dump?"
test with `textIsStructuredFallback`, which the renderer uses to decide
whether components replace the body or sit beside it.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* feat(app): add l10n keys for chat content-block components

Ten new keys for the block eyebrows, destination actions, unavailable
state, and the conversation link's recommended-steps header, translated
into all 48 non-template locales.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* feat(app): render chat content blocks as interactable components

Every block type that macOS renders as a control now has a mobile
component, driven from the same wire schema (#12598):

- taskCard: a live checkbox wired to the single tasks mutation path,
  ActionItemsProvider.updateActionItemState. The tasks API is list-only,
  so the card resolves against the loaded list and mirrors the macOS
  loading / unavailable states rather than inventing a fetch-by-id.
- goalLink: mobile has no goal detail route, so the card opens a bottom
  sheet with the goal's title and progress resolved from GoalsProvider,
  and shows the unavailable state when the id is not in the list.
- captureLink / conversationLink: push ConversationDetailPage through the
  citation preamble already shipped in chat (grouped-map hit, then fetch
  by id). conversationLink also lists its recommended action items as
  plain rows; mobile creates tasks from the tasks surface, so the block
  mutates nothing.
- memoryLink: opens the existing memory sheet for the resolved memory.
- questionCard: options send their preparedAnswer down the normal chat
  send path, so the runtime stays authoritative for what an answer means.
  A deferral option is not special — it sends its own prepared answer.
  Once selectedOptionId is set only the chosen option remains, disabled,
  so no stale chip ever looks tappable.

text/thinking/toolCall/discoveryCard/citation/agentSpawn/agentCompletion
and unknown types render nothing extra — the body (or its synthesized
fallback) already carries them — but they never hide the message. Where
the body is only that fallback, the components replace it instead of
repeating it.

Every interactive element carries Key('chat-block-<type>-<id>...').

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* docs: record the presentation-cohort-drops-journaled-content failure class

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* fix(desktop): give the reader a selectable copy instead of a selectable transcript

The selection change this branch shipped is reverted. `OmiMarkdown` disables
native text selection again at both sites, explicitly, and the
`\.chatTextSelectable` environment key, `ChatTextSelectionPolicy` and
`OmiChatTextSelectability` are gone along with the host wiring in
`AIResponseView`, `FloatingControlBarView` and `OnboardingChatView` — those
hosts now carry no `textSelection` modifier around `OmiMarkdown` at all, since
the ones that were there before this branch were dead code under the inner
`.disabled`.

The settled-row gate was not enough. PR #10834 made the same argument and
reopened FC-selection-overlay-layout-loop in Omi Beta 0.12.146: every sampled
main-thread stack sat in `SelectionOverlay`, `setFont`, intrinsic-size
invalidation and AttributeGraph, and memory grew without bound. A settled row
is still rebuilt by transcript loading, scrolling, window resize and
parent-state updates, which is all that loop needs.
`.github/scripts/check_chat_selection_boundary.py` rejects the escape hatch and
names the remedy: the existing copy actions, or a separate non-live reading
surface.

So this adds the reading surface. "Select Text…" sits on the row's context
menu next to "Copy Message" and as an ibeam button in the hover strip, on
assistant and user rows alike. It opens `ChatSelectableTextPopover`: one
`NSTextView` over one message's copyable text — `isEditable` false,
`isSelectable` true, ⌘A and ⌘C native, Escape closes, sized to content with a
360 pt cap and internal scrolling. It is outside the transcript's layout and
does not mount until the reader asks for it, so it cannot take part in the
loading, scrolling and resize passes that made in-place selection unsafe. No
SwiftUI `textSelection` anywhere in it — AppKit selection is what an
`NSTextView` already is.

The strip now carries four controls plus the timestamp (thumbs, thumbs, copy,
select, info-when-present). At 24 pt each that still leaves the timestamp its
own room, so both affordances stay rather than context-menu only.

Everything else on this branch is unchanged: right-click Copy, focus-gated ⌘C,
the metadata-band policy, the transcript rhythm, the interrupted-turn marker,
adjacent duplicate collapse, and the accessibility fixes.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* test(desktop): drop the deleted shell files from the static guards

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* test(desktop): repoint ptt-lifecycle covers at ChatToolExecutor

RealtimeConversationToolProjection.swift was folded into ChatToolExecutor in
758cd3f1fb and the flow kept the stale path, which fails desktop-flow-lint.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* fix(desktop): a reply the reader watched arrive stays whole when it settles

`ChatBubbleTruncation` clamps any body over 500 characters, and only once
`isStreaming` goes false. So an answer rendered in full while it streamed —
with the transcript following it down — collapsed to its own first paragraph
the instant it finished. A forty-item list became three items and a "Show
more", and the document shrank by thousands of points under a reader pinned to
the live edge. Watching that happen reads as "the chat stopped scrolling":
everything you just followed is taken back at the end.

Truncation is for restored history, where a long transcript should not be
mostly one old reply. An answer that just settled here is the opposite case, so
it keeps its full body.

Co-Authored-By: Claude Opus 5 <[email protected]>

* fix(desktop): the assistant reads the same task list the Tasks page shows

Asking by voice what was on the list answered "you don't have any tasks overdue
or due today" to someone looking at thirty of them. `get_tasks` is backed by
`TasksStore.loadDashboardTasks`, which narrowed the list twice in ways the Tasks
page never has:

- a seven-day recency window, as a lower bound on overdue due dates and as a
  `createdAfter` cutoff on undated rows. The page buckets on `dueAt <
  startOfTomorrow` alone and ages nothing out, so a backlog older than a week
  was invisible to the assistant and only to the assistant.
- a source filter that dropped every AI-capture row. That gate was written when
  a capture could still land in `action_items` unreviewed. INV-TASK-2 has since
  made capture suggestion-only — `TaskCaptureModePolicy.usesLegacyStaging` is
  false for every mode, and a capture stays a Candidate until an explicit
  gesture accepts it — so the gate no longer separated reviewed from unreviewed.
  It hid the user's own backlog, and anything they created by voice, since
  `create_action_item` comes back stamped `conversation`.

On the reporting account those two took thirty visible tasks to zero. The
buckets now carry what the page carries: 82 overdue + 3 due today against the
page's "Today: 85". The per-bucket cap moves 50 → 500, because the count is
spoken and 50 would have understated it.

`isPendingSuggestion` stays for proactive nudges, the one consumer still asking
whether a capture pipeline wrote a row. `DashboardTaskLanePolicy` had no other
caller and goes.

The voice tool descriptions said "overdue + due today", which is where the
spoken wording came from; they now describe the whole open list.

Co-Authored-By: Claude Opus 5 <[email protected]>

* fix(desktop): the transcript's own follow-scroll is not the reader taking it

Found while tracking down the streaming-scroll report. `UserScrollDetector`
promotes an open mouse press to reader ownership as soon as the clip view
moves, because a scrollbar-track click repositions the viewport without ever
emitting a drag. That test cannot tell the app's own follow-scroll from the
reader's, and while an answer streams the transcript re-reaches the live edge
every `ChatScrollFollowThrottle.interval` — so a press still open when one
lands ends follow mode for the rest of the answer. Now that every content block
is something you can click, a press inside a streaming transcript is ordinary.

Two lifecycle holes alongside it: a release delivered to another window — the
"Select Text…" popover and context menus present in their own — was dropped by
the same-window guard, leaving the press candidate open for the life of the
scroll view with every later follow-scroll able to promote it; and a second
press registered its bounds observer without removing the first.

The transcript now records when it moves its own viewport, and movement inside
that window re-baselines the press instead of promoting it. A drag and a
scrollbar-track click still take ownership, which the existing harness cases
pin.

Co-Authored-By: Claude Opus 5 <[email protected]>

* test(desktop): the tasks flow checks the lanes the assistant answers from

The Tasks page and `tasks_snapshot` read the same rows now, so the flow can
say so: S6 compares the page's Today count against overdue_count +
today_count. That is the comparison the bug failed — thirty tasks on the page,
zero in the lanes.

Co-Authored-By: Claude Opus 5 <[email protected]>

* fix(desktop): the components the agent renders reach the transcript

`render_chat_blocks` had never once been offered to the model on this Mac, and
on the turns where it did run its cards were deleted three seconds later. Four
separate gates, one confusion between them: *which surface is this*.

One shell means main Chat and the floating bar project the same conversation,
so a session the bar registered carries `surface_kind = floating_chat` while
main-Chat runs execute on it. Every chat-first gate admits `main_chat` only,
and three of them read the session's registration instead of the run's: the
adapter metadata that sets `OMI_CHAT_FIRST_UI`, the tool-capability broker that
admits the call, and the surface Swift re-validates before executing. The
fourth was separate — run admission built its own context snapshot and dropped
the capability on the way, because the capability map lived on `KernelSessions`
where run admission could not reach it. Any one of the four was enough on its
own; advertised tools go 41 -> 46 with all four fixed.

Then the cards died anyway. `monotonicAcceptContentBlocks` protected exactly
two block kinds across terminalization, and terminalization applies the
projection *Swift* assembled from the adapter stream — text and tool calls,
never a block the agent appended mid-turn, because that append is a journal
mutation the surface never saw. So the replace erased every task card, goal
link and memory link the turn had rendered, moments after the tool reported
`ok`. The protected set is now the kinds the kernel authors and the surface
never does.

Confirmed live: the tool executes, and three `taskCard` blocks now survive on
the finished turn.

Co-Authored-By: Claude Opus 5 <[email protected]>

* fix(desktop): ticking a task card shows it done, not gone

Checking a box replaced the card with "Task is no longer available" — the one
message that means the row is not the user's any more.

Nothing had gone away. Ticking moves the task between the store's two arrays
and the toggle awaits SQLite first, so `liveTask` is briefly nil. That flips
the card's `hydrationKey`, SwiftUI cancels the in-flight hydration, and
`TasksStore.isCurrent` folds `!Task.isCancelled` into its lease check — so
`resolveCanonicalTask` then returns nil *by construction*, not because the task
is missing. The old code published that nil, cleared the retained task and set
`hydrationFinished`: exactly the pair that draws the unavailable placeholder.

A superseded hydration now speaks for nothing, and a store that cannot vouch
for a row is no longer read as the row being retired.

Co-Authored-By: Claude Opus 5 <[email protected]>

* fix(chat): components replace the writing instead of doubling it

Two ways the same answer was being said twice.

The tool's own instructions were the first. They told the model to render
components "whenever you retrieve, create, or summarize" those entities and
"do not leave them as a Markdown table/list" — so a summary of yesterday
stacked three conversation cards above the prose that already said it. That is
backwards: reading an entity to answer a question makes it a *source*, and
sources belong in citations. A component is for the entity that IS the answer —
the one the user asked to see or act on, or the one this turn created or
changed — and when components are rendered they are the list, so the prose
above them is one lead-in sentence at most.

The second was ours. A turn that carried only components still printed the
blocks' own degradation text underneath them, so three cards sat above the
three lines they were made from. `ChatStructuredFallbackText` mirrors the
producer case for case, and a body that is only that projection is recognised
as the cards talking to themselves rather than as answer text.

Mobile drew six of the nine kinds the desktop transcript draws and silently
skipped the rest. Discovery cards and the two agent-run blocks have components
now, and a parity test fails if the desktop grows a tenth without one.

Co-Authored-By: Claude Opus 5 <[email protected]>

* feat(desktop): selection lives in the words, not in a box beside them

"Select Text…" opened a popover that re-printed the message in raw Markdown
next to the row the reader was already looking at, and only assistant rows had
it — a user turn has no hover strip, so their own words were never selectable
by any means.

SwiftUI's selection stays barred: PR #10834 put it back on settled rows and
reopened FC-selection-overlay-layout-loop in Omi Beta 0.12.146, every sampled
main-thread stack in `SelectionOverlay` and `setFont` while memory climbed.
But that bar is on `SelectionOverlay`, not on selecting. An `NSTextView` *is*
one selection: one view owns it, a rebuild replaces a string, and nothing
per-`Text` is mounted for a parent to thrash. `ChatSelectableTextPopover` said
so in its own header — it just kept that view outside the transcript.

So the words are the surface now. Chat prose renders through one text view per
block, parsed from exactly what the SwiftUI renderer parses, and the reader
drags across an answer in place with ⌘C copying what they highlighted.
Citation markers become link ranges rather than buttons, which is what made
the surrounding line selectable at all — a chip in a flow layout forced the
prose to be chopped into per-segment views — and they still open their source
and still preview it on hover.

Two things had to be got right. Height is measured beside the live view rather
than inside it, because a container left holding a measurement width wrapped
the answer to a width the transcript never granted; and the measurement is
synchronous, because publishing a height a frame late broke the transcript's
follow-scroll. The gesture harness reads pixels, and `cacheDisplay` stopped
seeing prose once it was drawn from a layer, so the probe composites the layer
tree and can measure the row again.

The boundary check now guards this file too: the AppKit path may never quietly
acquire the SwiftUI one.

Co-Authored-By: Claude Opus 5 <[email protected]>

* fix(chat): a rendered card is the citation, and it survives the next update

Two leaks left over from making components reachable.

The first: terminalization was not the only replace. The streaming projection
pushes the surface's own block list several times a turn, and `updateJournalTurn`
took the replacement literally — so cards that survived the terminal commit
died to the very next update instead, which is why they appeared on one turn
and not the next. Both paths now apply a projection over the journal rather
than in place of it: an id the projection carries is the projection's to
define, which is how a question card's options still get retired, and an id it
omits survives only when the kernel wrote it.

The second is what the reader saw. When the model renders components and skips
inline markers, we append a compact `Sources: [1][2][3]` rail so provenance
stays discoverable. That was a sensible garnish when components were rare; now
that a component turn is one lead-in line and three cards, the rail is a row of
bare markers printed under the very things they point at. Sources the turn
already draws are dropped from it, and anything with no component of its own
keeps its marker.

Co-Authored-By: Claude Opus 5 <[email protected]>

* fix(desktop): every citation marker the transcript writes is selectable and live

The AppKit prose path matched `[\d{1,3}]` of its own invention. Ordinals run to
four digits and the model also writes the kind beside them — `[5004]`,
`[memory 5023]` — so real markers rendered as dead text in the middle of an
answer. It uses `ChatCitationMarkup.numericMarkerPattern` now, which is the
transcript's own definition of a marker rather than a second copy of it.

Also pins what the harness proved by hand: the mounted transcript hosts a
selectable text view on rows at more than one inset, so it is both senders'
words that can be dragged across, not just Omi's.

Co-Authored-By: Claude Opus 5 <[email protected]>

* chore(desktop): the cohesive chat flow covers the selection renderer that replaced the popover

Co-Authored-By: Claude Opus 5 <[email protected]>

* test(ci): the selection boundary fixtures cover the AppKit surface too

The remedy is an NSTextView owning its own selection; a SwiftUI rewrite of that
file would put SelectionOverlay back in the transcript under a name no pattern
check can see, so the fixtures pin that rule alongside the existing ones.

Co-Authored-By: Claude Opus 5 <[email protected]>

* chore(agent): the component cap is not a licence to write the list out instead

Asking to see your tasks and getting seventeen of them numbered in prose is the
shape components exist to replace; the cap bounds how many are drawn, not
whether any are.

Co-Authored-By: Claude Opus 5 <[email protected]>

* fix(agent): tasks the user asked to see are rendered, not written out

The render-vs-cite rule lived only on `render_chat_blocks`, where the model
reads it after it has already decided what to write. Asking "what are my open
tasks right now?" still returned seventeen of a hundred as a numbered list —
prose that names the tasks but cannot tick one off, which is the shape
components exist to replace.

The rule now sits on `get_action_items` too, at the moment the tasks arrive:
if the user asked to see, review, pick from or work through them, render the
few that matter and say how many more there are; if a task is only evidence for
a question answered in prose, cite it and render nothing.

Co-Authored-By: Claude Opus 5 <[email protected]>

* fix(agent): a rendered task list is counted, not named

The `get_action_items` guidance said to render the cards and "say how many
more there are". The model read *say* as *list*: it rendered three task
cards and bulleted the same three titles above them, printing every task
twice — once as words that cannot be ticked off and once as the card.

Say the count, never the names, and say why: naming them is what doubles
the answer.

Also corrects the OmiMarkdown header comment, which still described the
deleted selection popover.

Co-Authored-By: Claude Opus 5 <[email protected]>

* fix(desktop): stop the Removed lane tombstoning live tasks

Ticking a task on a chat task card replaced it with "Task is no longer
available" — the reader's own completion, erased.

The tombstone was local and it was fabricated. `fetchDeletedPage` asks for
retired rows with a `deleted=true` query item that `GET /v1/action-items`
has never had: FastAPI drops the unknown item, and that handler's stream
skips soft-deleted documents outright, so the "deleted lane" answered with
the owner's live first page. Every row came back stamped `.retired()` and
was synced into SQLite, so each visit to Removed tombstoned another
hundred live tasks. Completing one read the tombstone back — 190 ms after
the local write, before the backend was called at all. This Mac was
carrying 100 of them, every one with no `deletedBy` and a canonical status
still `active`.

Three changes, because each is load-bearing on its own:

- The lane keeps the rows the response itself reports retired and drops
  the rest. Removed showing fewer rows is a gap; manufacturing retirement
  is data loss.
- A migration clears the tombstones already written, and only those: a
  deletion the owner performed records `deletedBy`, a server-side
  retirement arrives as canonical status, and a row with neither witness
  was retired by nothing but the stamp.
- The card treats the reader's tick as authoritative. A retirement
  discovered afterwards does not get to undo a completion the app
  accepted, whatever put the retirement there.

Until the backend grows a real `deleted` filter, Removed can only show
deletions made on this Mac.

Co-Authored-By: Claude Opus 5 <[email protected]>

* fix(desktop): clearing Chat takes the daily summary with it

The summary card is chrome above the thread rather than a turn — INV-CHAT-1
keeps transcript authorship in the kernel, so nothing on the Swift side may
write a journal row for it. The consequence was that Clear could not reach
it: the day's summary sat alone in a chat the reader had just emptied,
which reads as a clear that did not work.

Clearing now records which summary was on screen and withdraws the card on
the same frame. Recording the id rather than a flag is what lets tomorrow's
summary come back on its own, and the key is owner-scoped like the
announcement's, so clearing on one account cannot blank another reader's
day on a shared Mac.

Co-Authored-By: Claude Opus 5 <[email protected]>

* fix(desktop): stop one test post killing the whole test host

`swift test` has been exiting 1 on this machine, before this branch and
after it. Not a failing test — the runner died with SIGTRAP partway
through, taking every suite alphabetically after it with no message and no
crash report. The two suites involved each pass alone.

`JITProactivityDeliveryTests` posts `.runtimeOwnerDidChange` from an async
test body, so it lands on a cooperative thread. `NotificationCenter`
delivers synchronously on whichever thread posted, and the observers are
`@MainActor` types whose sink closures carry an isolation check on entry.
Once `InterjectWiringTests` had mounted `FloatingControlBarManager`, that
check failed `dispatch_assert_queue` and trapped the process. Nothing
inside the closure could have guarded it: the check runs before the first
statement.

The fix is the post, not the observers. `performEffectiveOwnerTransition`
— the only production poster — already posts inside `await MainActor.run`,
so no shipping code does what the test did. And the observers' synchronous
delivery is load-bearing, not incidental: it is what lets a surface fence
itself *during* an owner transition rather than a runloop later (see
`IntegrationNudgeCoordinator`). Hopping delivery downstream instead was
tried first and was wrong twice over — it broke
`FloatingOwnerProjectionTests`, which correctly caught the previous
account's pills surviving the switch.

So: the test posts on the main thread as production does, and the contract
is written down where the notification is declared.

The suite now runs to completion for the first time: 6695 tests, no crash.
Two `JITProactivityRuntimeTests` failures remain, pre-existing and
unrelated — they assert an outcome that only holds when the local mirror
database is absent, which is true only when they run alone.

Co-Authored-By: Claude Opus 5 <[email protected]>

* chore(app): restore the ephemeral iOS package Flutter regenerated

Running `flutter gen-l10n` and `flutter test` on this Mac rewrote
`app/ios/Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage/Package.swift`,
emptying its dependency list because the iOS packages were never resolved
here. That is build residue from the merge, not a change anyone made.

Restored to origin/main's content.

Co-Authored-By: Claude Opus 5 <[email protected]>

* style(app): dart format the files this branch touches

`message.dart` picked up its formatting drift from the merge resolution;
the generated wire file is regenerated output.

Co-Authored-By: Claude Opus 5 <[email protected]>

* Revert "style(app): dart format the generated wire file"

`subscription_usage_wire.g.dart` is generated by
`backend/scripts/generate_dart_models.py`, so reformatting it makes it
stale against its own generator. Restored to origin/main's content; the
`message.dart` formatting in the previous commit stands.

Co-Authored-By: Claude Opus 5 <[email protected]>

* chore(app): regenerate subscription_usage wire models

The committed file was stale against
`backend/scripts/generate_dart_models.py --group subscription_usage` — the
preflight contract check rejects it on origin/main's copy too, so this is
drift the merge surfaced rather than anything this branch changed.

Co-Authored-By: Claude Opus 5 <[email protected]>

* fix(desktop): a follow-up's citation borrows the ordinal it points back at

Ordinals are assigned per attempt, so a turn that retrieved nothing has no
ordinals of its own — and when the model answers "pick one conversation
from that day" without a tool call, the `[1]` it writes is the first
conversation of the previous answer. Left unbound, it drew as plain text
beside a title the reader could not open.

Only ordinals the turn cannot resolve itself are borrowed, each from the
nearest earlier assistant turn that persisted it, so a turn's own
provenance always outranks the past. The binding runs at finalize and
again over every journal projection, so restored history opens the same
source the reader could open live.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* feat(desktop): fold a reply after two screens of text, not five lines

Five hundred characters was five lines, so every real answer collapsed
and the reader clicked "Show more" under nearly everything they asked.
The budget is now measured in viewports of rendered text: a reply may
fill two screens before the transcript offers to fold it, and one that
long starts folded. Lines are estimated per source line at the column's
width, so a bulleted list is measured as the lines it takes, not the
characters it holds, and the cut lands on a line boundary with any open
fence closed.

The transcript publishes its viewport to the rows through the
environment, republished only at a coarse step so a resize drag does
not re-evaluate every row per frame.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* feat(desktop): stream as a flow, and glide the live edge instead of snapping

The wire delivers an answer in bursts — a provider chunk, a paragraph
the moment a tool returns — and a flush that dumped everything it had
made the transcript lurch by a sentence and then sit still. Each 35 ms
flush now reveals a paced slice: a small backlog drains over about five
flushes, a large one is let through fast enough that the reader is never
more than two lines behind, and the tail of every burst tapers. Boundary
flushes (a tool starting, the turn settling) still land everything at
once, so block order is unchanged.

The follow scroll during a stream eases to the live edge rather than
jumping a row at a time; restores and sends stay instant, and Reduce
Motion disables the glide.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* feat(agent): native components are the default answer for what Omi draws

"Pick one conversation from that day" came back as a bold title with a
citation number where a conversation card belonged. The render policy now
says it plainly: default to a component whenever the user asks for a
task, goal, memory, conversation or capture, and reserve prose for a
request to read rather than open or act — a summary, a recap, an
analysis, a comparison, a count, or a list too long to render. The
conversation and memory retrieval tools carry the same rule with their
own block shapes, including follow-ups that narrow an earlier result.

Regenerated tool surfaces and fixture.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* chore(desktop): the hermetic chat flow covers the streaming buffer

The paced reveal lives in ChatStreamingBuffer.swift, which no e2e flow
declared; the hermetic chat flow streams an answer through it.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* test(desktop): the offline readiness fixture asks for a port nothing holds

The harness verifies a launched bundle's /health whenever --port is bound.
On a Mac with any dev bundle up on the default 47777 the offline-only
readiness cases reached that check and sourced app-config.sh, which the
fixture never provides, so the pre-push launcher gate failed on a test
that never left the box. The fixture now probes for a closed port and
passes it explicitly.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* fix(desktop): a conversation citation opens the conversation it names

The agent cites whatever its conversation tools retrieved, and most of
this user's library is desktop and phone recordings. But a citation of
kind .conversation routed the capture focus, and the capture archive
resolves that focus through a strictly source-scoped fetch
(GET v1/conversations/{id}?source=omi). For a desktop recording that
request is a 404, so the hub landed on the Conversations list with
nothing opened — the report's "Open Conversation just brings me to the
conversation page". Citations of omi-device captures kept working, which
is why only some markers failed.

Citation routing now fetches the unscoped record first and lets the
record's own provenance pick the route: omi captures keep the capture
focus so the transcript moment still plays; every other conversation
opens as the exact fetched record through open(conversation:), which
presents it even when the paginated list does not contain it. A failed
or mismatched fetch navigates nowhere instead of stranding the reader.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* fix(desktop): launch no longer prints the daily summary before the chat

Opening the app admitted the daily summary card while the initial history
was still loading, so launch read as a summary page that then yanked away
the moment the transcript landed at the live edge. The card is chrome
(INV-CHAT-2), and chrome must not outrun the thread: admission now defers
for the whole initial load, the loading-complete observer admits it before
the live-edge restore measures geometry, and an empty thread still meets
its card. The decision lives in one pure, tested place —
ChatDailySummaryAdmission.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* perf(desktop): returning to Chat no longer re-parses and re-measures every prose block

Chat is torn down and remounted on every route change (the shell keys the
destination by route), and each mount rebuilt the whole visible transcript
window from scratch: one Foundation Markdown parse plus one NSAttributedString
build per prose block, and one throwaway TextKit stack per sizeThatFits query.

ChatProseRenderCache memoizes both, keyed on the exact render inputs (markdown,
style, fontSize, font scale in thousandths, sorted citation ordinals), so a hit
is identical to a recompute. Bounded LRU (192 entries) absorbs a streaming row
minting a key per 35 ms flush; per-entry measured heights are keyed on the
proposed width and dropped wholesale at eight widths, which is what a window
resize wants anyway.

Measured by instrumenting ChatSelectableProse.attributedString and
ChatSelectableProseText.height on the mounted transcript
(ChatTranscriptGestureHarnessTests.Harness, 120-message journal, compact
50-row window, debug build), cache disabled vs enabled in the same binary:

- before: every mount, including every return to Chat, paid 50 parses
  (4-8 ms) and 600 height measures (54-62 ms of TextKit layout)
- after: the cold mount pays 50 parses and 50 measures once (4-17 ms,
  4-14 ms); every remount pays 0 parses and 0 measures

New ChatProseRenderCacheTests pin hit identity, key sensitivity to every
render input, nil-produce never being cached, the LRU bound, and the
per-width height memo and its drop bound.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* fix(desktop): the follow glide runs on the run loop, so it lands in the app and in the tests

The streaming follow rode a SwiftUI withAnimation transaction, which advances
on the display cycle. In the mounted-transcript guard host that cycle never
runs, so the follow silently did nothing there and the three live-edge drift
guards failed at full stream growth: 462-484 pt of drift against a 120 pt
limit, bisected to the commit that introduced the glide. A follow that only
works where nothing can observe it is exactly what INV-CHAT-2's guard tests
exist to catch.

ChatFollowGlide moves the clip view on a 60 Hz run-loop timer with the same
ease-out and the same 0.16 s duration (now one shared constant). The run loop
is pumped by both the app and the harness, so the glide the reader feels is
the glide the tests measure. A newer follow retargets the clock in flight,
and reader input or teardown cancels it through cancelAllPendingScrolls; the
snap path stays the fallback for pre-resolution frames and for Reduce Motion.

Measured on the mounted transcript (60-message window, 40x35 ms stream
flushes): worst drift 462-484 pt before, 48.0 pt after; all 20
ChatTranscriptGestureHarnessTests pass again.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* fix(desktop): the streaming flush beat keeps its period when a flush overruns

The paced flush re-armed from the moment the last flush finished, so the
reveal's period was interval + render work, and jitter in that work shifted
every later beat back. Measured with a flush workload of 0.75x the interval
driving ChatStreamingBuffer directly: completion-anchored beats ran at
151-160 ms against an 80 ms interval; anchored beats hold 80 ms while the
work still fits inside one.

Beats now anchor to the beat before them, clamped to now so an overrun beat
fires at once and resynchronizes instead of firing late. A drained backlog
ends the chain, so the next delta starts a fresh beat rather than inheriting
a deadline that already passed.

Instrumented per-flush costs on the mounted transcript, for the record: the
markdown re-parse grows 0.8 to 4.1 ms and the TextKit height measure 1.4 to
4.9 ms over a 0.25-10 KB answer (the O(n) per-flush terms; a stable-prefix
incremental parse was assessed and declined - the parse is only about a
quarter of the O(n) work, the rest is TextKit measure and the live view's
own relayout, which incremental parsing does not touch). The storage isEqual
compare is 0.01-0.08 ms and the transcript re-evaluates one bubble body per
flush - both cleared as stutter candidates. The follow glide retargets from
its mid-glide position with no step: worst sample-to-sample jump 11 pt over
210 samples of a 30-flush stream.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* fix(desktop): the settle frame folds the tool trace away instead of teleporting

When isStreaming flips, the row drops its tool-call groups and pre-tool
commentary and swaps in the terminal answer, citations and metadata band in
one layout change - measured on the mounted transcript with a three-tool
trace, a 62 pt height change landing in a single frame, which reads as a
jump. The fold is now animated: an .animation scoped on message.isStreaming
wraps the row content, so that one frame eases out over the motion table's
settle duration while every per-token streaming frame, where isStreaming did
not change, stays exactly as instantaneous as before. Reduce Motion folds
instantly.

Final state is unchanged: the settle probe measures identical streaming and
settled heights before and after (2620 / 2558), the group-drop assertions in
ChatFirstRichBlockTests, OneChatShellRichBlockTests and
ChatBubbleLayoutRegressionTests pass unchanged, and the mounted-transcript
harness - which streams forty-flush answers through a row carrying this
modifier - stays green.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* test(desktop): the beat-period test declares its real-time wait

The flush-beat test sleeps for real by design - the subject is the period
the scheduler holds under genuine elapsed work - so it carries the
wall-clock-wait escape annotation the desktop test-quality gate requires,
keeping the counted baseline where it was.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* chore(desktop): prune merge survivors of views this branch deletes

Taking main's side of ViewExporter kept exports for the old Dashboard
page and its score gauge, and main's automation registry picked up a
Home-knows action family for the legacy hub - all three views and the
feature behind them are deleted on this branch, so the entries and the
action family go too.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* chore(desktop): retire the knows-list flow and pin the merged test debt

The knows-list rotation flow covers the HomeKnows feature this branch
deletes with the legacy Home hub, and the merged suite's real
source-inspection debt is 53 files / 143 sites - lower than the
inherited ceiling.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* fix(desktop): restore the memory-review fixture the knows-list prune removed

The prune of the retired knows-list action family took
`enum MemoryReviewFixture` down with it, but the surviving
`seed_memory_review_fixture` / `memory_review_snapshot` /
`memory_review_vote` actions and MemoryReviewCardTests still reference
it — the branch did not compile. The enum moves to its own automation
file, content unchanged from 98ddcffab9^.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* fix(desktop): finish the merge-fallout repairs the tree still needed

Two more of the same class as the fixture restore, on tracked files the
merge left referencing deleted things:

- `AnimatedGIFView.swift` went out with the retired onboarding wizard
  views, but main's own PermissionsPage and BrowserExtensionSetup still
  render it, and the merge kept those references. Restored verbatim
  from origin/main.
- The ViewExporter prune meant to drop the full-dashboard export with
  the deleted Dashboard page but left a bare `AnyView` expression
  behind; the dead entry is now actually gone.

The untracked Dashboard WIP files belong to a concurrent lane and are
deliberately untouched.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* feat(desktop): decode the recap sections the dedicated page renders

DailySummaryRecord gains unresolved_questions, decisions_made, and
knowledge_nuggets, conversation_ids on topic highlights, and
source_conversation_id on action items — the wire contract mobile's
daily_summary.dart already mirrors and the backend has served since the
sections shipped. Everything is decodeIfPresent, so an older backend
just leaves the sections absent. Highlight and ActionItem get explicit
inits with defaulted new fields so existing call sites are untouched.

Tests pin the new keys verbatim and pin the older-backend case: absent
sections decode to nil rather than dropping the summary.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* feat(desktop): the daily recap becomes a page, and Chat shows a slim pill

Recaps are now clickable into a dedicated surface. DailyRecapPage
presents the whole record — date and headline, overview, stat chips,
highlights, tasks with their completed state, unresolved questions,
decisions, the memories-learned review rows, and learnings — and every
row carrying a conversation id deep-links through the hub-owned
conversation detail. Rows carry no badges or buttons anywhere else:
the pill in Chat and the pill on an Activity day show only title and
summary, and clicking either opens this page as a sheet. A sheet, not
a ChatFirstRoute: route values persist across launches and are gated
to primary destinations, while a recap is a transient read over the
surface that produced it.

The Chat pill replaces the pinned full card. The old bar expanded in
place over the transcript, and its measured inset tracked a high-water
mark that could never shrink — one tall expand padded the thread
forever, and a shrink left the bar lapping over the newest message.
The pill never expands (the page is the expansion), so the inset now
tracks the live height both ways, bounded to a couple of lines.

The full-card view is retired; its pure section projections move to
ChatDailySummaryPresentation next to the other recap rules. Review
rows gained a daily_summary_detail source so votes from the page are
counted as page votes, matching mobile's telemetry. INV-CHAT-2
admission is untouched.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* feat(desktop): the Activity day folds its recap into a doorway pill

The day header was already the recap's toggle — thin when the day is
folded, the recap inside when it is open. What it contained changes:
the stored recap renders as a pill of title and summary only. The
highlight chips, the Ask-about-this-day button, and the Regenerate
button leave the list entirely — the full record, its badges, and its
actions are the dedicated recap page the pill opens in a sheet, reusing
the hub's own onOpenConversation so a recap's conversation links can
never open a second detail owner beside it. Generate stays for a day
with no recap: that is the way the recap comes to exist, not recap
chrome.

memory-review.yaml follows the rows to the page: the pill renders no
rows, so the flow opens it before reading and voting, and the section
now reports the daily_summary_detail source. chat-first-cohesive covers
the new pill, page, and fixture files and drives pill-to-sheet.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* test(desktop): follow SpineDayRecapRow to its doorway signature

The row no longer takes now/calendar — the follow-up question moved to
the dedicated recap page with the rest of the recap actions — so the
two host-view tests construct it with content and dateKey only.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* fix(desktop): the restoring phase always resolves, even when its attempt is superseded

Three dev launches hung in appState=launching / isSignedIn=false /
isRestoringAuth=true for their whole session (10:31-11:05), then an identical
launch came up clean. The hung logs end at the auth listener's "skipping REST
validation while launch restore is in flight" with nothing after, and the
phase never leaves .restoring.

The deeper defect: the restoring phase's only guaranteed escape - the 5s
watchdog in configure() - was gated on isSessionAttemptCurrent(attempt). Any
newer session attempt defuses it, and every fenced exit in the restore flow
(validateRestoredSessionNow's entry/post-refresh guards, refreshIdToken's
post-network guard, the saveAuthState/commitRestoredSession commits) then
returns silently, leaving .restoring stuck with no remaining resolver and no
log line. The hung trail is exactly that shape; the begin itself is invisible
because the flow's OMI AUTH NSLog lines are not captured in the dev log, and
the closed set of beginSessionAttempt call sites includes the restore flow's
own invalidation branches, which fire on a transient empty credential read -
the same launch whose Firebase cached user read also came back nil.

The watchdog now resolves on the phase alone: while the app still reports
restoring and no user-driven sign-in owns the UI (isLoading), it lands in the
same recoverable state the ungated case always did. It arms before the
restore's first await, so the restore's own awaits cannot delay the arming,
and it logs - visibly in the dev log - whether the launch attempt was
superseded, so the next occurrence names its race.

Tests: AuthRestoreWatchdogTests drives the seam with an injectable timeout.
testRestoringPhaseResolvesEvenWhenTheLaunchAttemptWasSuperseded fails on the
attempt-gated watchdog (phase stuck, verified) and passes on the fix;
testTheWatchdogLeavesARestoringPhaseAloneWhileASignInOwnsTheUI pins the
isLoading deferral; a source-wiring pin asserts the watchdog arms before the
restore await and resolves on phase alone.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* fix(desktop): re-follow the live edge when the recap pill's inset moves

The live-tracked inset is document space above the reader, so when the
pill's measured height changes after admission — the overview arriving
a beat after the headline is enough — the document shifts under a
stationary viewport and the newest row ends up buried under the pill.
Caught in the running bundle: the pill rendered thin, but the first
transcript row slid under it. A reader following the live edge gets
admission's own answer, a re-follow; a reader scrolled away is left
exactly where they are.

Verified visually: chat now shows the thin pill with the live edge
readable beneath it.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* fix(desktop): close the activation-actions extension the knows-list prune truncated

The knows-list retirement left DesktopAutomationActivationActions.swift one
brace short of its extension, so a clean checkout of the branch does not
parse. Closing it restores the build without touching the pruned flow.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* feat(desktop): the daily recap becomes a full page on the Chat-first shell

The sheet is dead. `ChatFirstRoute` gains `.dailyRecap(DailyRecapRouteRef)`
— a non-primary destination in the `.more` family, hosted by the shell on
the glass page lane like the other full pages. The route carries identity
only (record id + date), so a relaunch onto the persisted route re-fetches
through the new `getDailySummary(id:)` read; a record that is gone degrades
to an honest unavailable state. `ChatFirstShellNavigation.openDailyRecap`
captures the opening surface's route as a transient origin, and the page's
back chevron — and Escape — return there; a tab select supersedes it and an
owner change clears it.

The page keeps the punch-list layout: back chevron + Daily-recap eyebrow,
single-line action pills (Ask primary, Regenerate secondary — `fixedSize`
so no label can ever wrap), dayEmoji + full weekday date eyebrow + headline
+ lede in a 720 pt column, one row of equal-width single-line stat chips
that scrolls rather than folds a label, and the deep-linked sections. The
eyebrow's wider date format lives beside the pill's in
`ChatDailySummaryPresentation` so the arithmetic stays in one place.

Chat and Activity open the same route; their flows wait on
`visibleChatFirstRoute: daily-recap`.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* feat(desktop): the chat recap becomes an in-history day boundary

The pinned overlay bar, its measured-height inset, the high-water and
live-tracking preference plumbing, and INV-CHAT-2's admission gating
are all deleted from ChatMessagesView. A row that lives in the thread's
own history cannot shift the live edge, so none of the banner
constraints apply any more — the transcript simply renders
`ChatDailyRecapRow` as part of its row data, anchored above the first
message on or after the recap's day. When that boundary is outside the
loaded window (no message reaches the day, or the day's start is at the
top of the window with more history above), the thread renders nothing
rather than a marker the history cannot back up. A cleared thread keeps
its recap withdrawn through the coordinator's existing clear contract.

The row is a quiet, centered history marker — day label with emoji, a
one-line headline, two lines of overview, whole row clickable — and it
opens the typed recap route. The old pinned pill file is gone; its
identifier and covers follow the rename. The admission unit tests
become placement tests.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* feat(desktop): the Activity day card grows its recap as one continuous body

The open day's recap no longer floats as a second rounded surface under
the day header. The header becomes the card's top half — rounded at the
top, square at the bottom, no gap — and the recap renders as the card's
body on the same material, square where they meet and rounded where the
card ends, with the hairline only on the outer edges so no line runs
across the seam. The header's content resolution is shared with the
slot, so the attached shape and the slot's content can never disagree;
folding the day keeps the thin header-only card, and the generate
affordance for a recap-less day stays its own small surface.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* feat(desktop-e2e): identity seam and drive path for the recap page

`daily_summary_snapshot` reports the record's opaque id (identity, not
content), and a new `open_daily_recap_page` action opens the dedicated
page through the same `ChatFirstShellNavigation.openDailyRecap` the
recap rows call — so flows and harnesses can reach the page without a
click. Launch always lands on chat (`openMainAppChat`), so the
persisted recap route never survives a relaunch on screen; the route's
persistence stays harmless exactly as intended.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* fix(desktop): stat chips hold their full label on one line

106 pt folded "4h watching" into "4h… watc…" — the exact mid-word
wrap the page layout exists to forbid. The equal-width slot widens to
fit the longest label ("8h 5m listening", "13 conversations"); a
narrower lane scrolls the row rather than folding a chip.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* style(desktop): the in-history recap row sits below the messages

Review feedback: centered bordered prose read as another answer. The row
is now left-aligned one type step under the bubbles, borderless on a
softer fill, with the chevron trailing - a day marker in the thread, not
a competing card.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* perf(desktop): a live stream pins the following viewport to the live edge

The streaming follow still jittered: every 80 ms the throttle fired a
0.16 s ease-out toward the bottom as measured when the follow fired, but
the paced flush grows the document every 35 ms - so each target was
stale on arrival, and the viewport's velocity cycled between decelerate,
stall, accelerate for the whole answer. Mid-stream re-wraps that briefly
shrank the document even drove the glide upward.

While the last message is streaming and the reader is following, a
60 Hz ChatLiveEdgePinner now moves the clip view to the current maximum
scroll every tick - the bottom is read and taken in the same tick, so
there is no target to go stale. Armed from the streaming follow path;
disarmed on stream settle, reader input, mode change, conversation
switch, and teardown through cancelAllPendingScrolls; every move marks
the programmatic-scroll signal so the user-scroll detector keeps
classifying tracking as the app's own. The glide remains for discrete
jumps (button, restore settling). Measured on the mounted transcript:
worst between-flush drift 0.0 pt (the replaced glide's was 48 pt);
Reduce Motion applies - pinning is positional tracking, not animation.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* chore(desktop-e2e): the activity day header answers to spine-day-recap-header

A stable handle for flows (and a reviewer) to drive a day's fold without
reaching into the spine's private collapse state.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* fix(desktop): recap stat chips hug their labels

The fixed 152 pt slot was the defect: short labels left dead space inside
their capsule while the row's tail clipped past the column edge. Chips
now size to their content with one uniform gap, and the row scrolls only
when the window is genuinely too narrow.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* fix(desktop): the activity day card stops repeating its recap's emoji and arrow

The header already carries the recap's emoji and is the fold control, so
the recap body showed both a second time - two emojis stacked, and the
fold chevron sitting directly over the row's own arrow. The body is now
headline + summary only, and its whole surface still opens the page.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* fix(desktop): all six recap stat chips fit the column at min window width

* feat(desktop): the chat recap row shows the day's stats, compactly

The chat row was the only recap surface without the day's numbers. A
strip of micro chips - same data as the Activity day card, bubble-row
weight, content-hugging so nothing clips - sits under…
Git-on-my-level added a commit that referenced this pull request Sep 13, 2026
* fix(desktop): host conversation summary markdown through AppKit prose selection

The conversation detail summary re-rendered 2-3 times while the reader
scrolled a long summary. Its markdown had a SwiftUI `.textSelection(
.enabled)` ancestor — exactly the shape chat banned after PR #10834
reopened FC-selection-overlay-layout-loop in Omi Beta 0.12.146: the
overlay around a tall attributed block re-lays-out the visible portion on
every parent update (setFont, intrinsic-size invalidation,
AttributeGraph), and the detail's parents update freely (seed row, cache
callback, network fetch, app-catalog load, list publishes).

The summary pane now hosts its markdown through
`OmiMarkdown(appKitProseSelection: true)` — one NSTextView per prose
block owning its own selection, no overlay anywhere (overview, app
results, and the headed summary sections). The Equatable island in
`OmiMarkdown.body` now covers the AppKit prose path when no citations are
attached, so an app-catalog load or hover chrome can re-render the chip
row without rebuilding the prose underneath. Short plain-`Text` selection
(section headings, action-item rows) stays: a single-line Text has a
stable intrinsic size and is not this failure class.

The boundary check now protects the conversation-detail files with a
narrower rule — it rejects `.textSelection(.enabled)` only where it
chains onto `OmiMarkdown`, so the short-Text selections these files keep
legitimately cannot false-positive. A behavioral test mounts the
production host and asserts a selectable, non-editable NSTextView really
renders the markdown.

Failure-Class: FC-selection-overlay-layout-loop

* fix(desktop): stop volatile list refreshes from remounting the conversation detail

`ConversationsPage.onReceive(appState.$conversations)` replaced the
selected row struct on every list publish, and the detail request token
keyed on `updatedAt` — a Firestore document revision that bumps on any
write, including writes that change nothing the summary pane renders. A
background refresh while the reader was mid-summary therefore restarted
the detail task: the loaded conversation was dropped, the seed row
re-laid-out underneath, and the detail refetched, which read as the
summary flashing again while scrolling.

The token now carries a `ConversationSummaryRevision` — the primary
summary markdown, headed section bodies, live action items, and secondary
app results, i.e. exactly what the pane renders — instead of `updatedAt`.
The page gates row replacement through
`ConversationsPage.shouldReplaceSelectedConversation`, so the token is
the single definition of "the detail must see this": rename, folder move,
processing completion, and real summary reprocesses still replace the row
and restart the load; a volatile `updatedAt` bump alone does neither.

Proven by unit tests on the production token and gate APIs: an
updatedAt-only bump keeps both stable, while overview, section, and
status changes still replace the row and restart the load.

Failure-Class: FC-selection-overlay-layout-loop

* fix(desktop): make the selection boundary global and total for detail files

Absorbs the operator-requested pre-runtime guards for the same failure
class (FC-selection-overlay-layout-loop), on top of the summary fix:

- Repo-wide chained-modifier rule: `OmiMarkdown(` followed by enabled
  native selection anywhere in its SwiftUI modifier chain fails CI on
  every desktop Swift source, not a fixed file list. This is the rule
  that would have caught conversation detail on the PR that introduced
  the ancestor. It is a bounded line heuristic (modifier chain below the
  call), so short plain-`Text` selections elsewhere — task panels,
  referrals, the live transcript's per-bubble rows — do not trip it.
- ConversationDetailView.swift and ConversationSummarySections.swift
  join the transcript's blanket ban (no enabled native selection, no
  escape hatch). Their remaining short-`Text` rows (section headings,
  action items) drop SwiftUI selection accordingly: copyable prose on
  this surface is hosted by AppKit, and a file-level ban that the file
  itself violates is not a ban.
- `LiveTranscriptView` is deliberately not protected here; its per-bubble
  SwiftUI selection is a sibling failure with its own issue.

Checker triggers now include all desktop Swift sources; fixtures cover
chained rejection on an unknown surface, blanket rejection in the detail
files, transcript protections, and the LiveTranscriptView carve-out.

Failure-Class: FC-selection-overlay-layout-loop

* ci(desktop): raise PR Swift suite budget to 2700s after Xcode 26.6 (measured 2324s)
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