Skip to content

fix(desktop): conversation summary re-renders while scrolling - #13699

Merged
Git-on-my-level merged 6 commits into
mainfrom
fix/desktop-conversation-summary-scroll-rerender
Sep 13, 2026
Merged

Git-on-my-level merged 6 commits into
mainfrom
fix/desktop-conversation-summary-scroll-rerender

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Sep 13, 2026 •

Copy link
Copy Markdown
Member

fix(desktop): conversation summary re-renders while scrolling

The Memory Hub conversation detail re-rendered its summary 2–3 times while the
reader scrolled a long conversation. Two independent causes, one failure class,
plus the operator-requested prevention guards.

SelectionOverlay on the tall summary (primary). The summary pane's markdown
had a SwiftUI .textSelection(.enabled) ancestor — the exact 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, plus AppProvider.fetchApps() and every
appState.$conversations publish.

  • Removed the SwiftUI selection ancestor from every OmiMarkdown in
    conversation detail (overview, both app-result branches, headed summary
    sections). It is not re-enabled "for copy": the markdown now hosts through
    OmiMarkdown(appKitProseSelection: true) — one NSTextView per prose block
    owning its own selection, the same contract as chat. OmiMarkdown's internal
    .textSelection(.disabled) is untouched.
  • The Equatable island in OmiMarkdown.body now covers the AppKit prose path
    when no citations are attached, so an app-catalog load (the Summary App chip)
    or hover chrome re-renders the chip without rebuilding the prose under it.
    Chat behavior is unchanged: citation rows still take the non-equatable branch.
  • Per the operator's follow-up, the two conversation-detail files take the
    transcript's blanket ban: their remaining short-Text rows (section
    headings, action items) drop SwiftUI selection too — copyable prose on this
    surface is AppKit-hosted, and a file-level ban the file itself violates is
    not a ban.

Volatile list refreshes remounting the detail (amplifier).
ConversationsPage.onReceive(appState.$conversations) replaced the selected row
struct on every publish, and ConversationDetailRequestToken keyed on
updatedAt — a Firestore document revision that bumps on any write, including
writes that change nothing the pane renders. A background refresh mid-read
restarted the detail task, dropped the loaded conversation, and re-laid-out the
seed row underneath the reader.

  • The token now carries a ConversationSummaryRevision (primary summary
    markdown, headed section bodies, live action items, secondary app results —
    exactly what the pane renders) instead of updatedAt.
  • Row replacement is gated through
    ConversationsPage.shouldReplaceSelectedConversation, making the token the
    single definition of "the detail must see this": rename, folder move,
    processing completion, and real reprocesses still replace/reload; an
    updatedAt-only bump does neither.

Prevention (operator-requested guards, absorbed per issue follow-up)

  • Repo-wide chained-modifier rule: OmiMarkdown( followed by enabled
    native selection anywhere in its SwiftUI modifier chain fails CI for every
    desktop Swift source, not a fixed file list — 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. LiveTranscriptView is deliberately not
    protected here; its per-bubble SwiftUI selection is a sibling failure with
    its own issue.
  • Blanket protection for ConversationDetailView.swift and
    ConversationSummarySections.swift (no enabled native selection, no escape
    hatch), same as the transcript files; missing protected sources fail.
  • Checker triggers now include desktop/macos/Desktop/Sources/**/*.swift.
  • Unit tests on the production token/gate APIs: an updatedAt-only bump keeps
    the token and the gate stable; overview, section, and status changes still
    replace the row and restart the load.
  • Behavioral test mounts the production host and asserts a selectable,
    non-editable NSTextView actually renders the markdown (drag-select
    preserved).

Verification

  • xcrun swift test --package-path Desktop --filter ConversationDetailAutomationStateTests — 16/16 passed (four new token/gate tests + the NSTextView hosting test).
  • xcrun swift test --package-path Desktop --filter "ChatTimelineContinuityTests|OmiMarkdownLineSpacingTests|OmiMarkdownThematicBreakTests|OmiMarkdownCitationInteractionTests|ChatSelectableProseIncrementalEditTests|ChatProseRenderCacheTests|ChatRenderLRUTests|ChatRowErgonomicsTests" — 82/82 passed.
  • python3 .github/scripts/check_chat_selection_boundary.py — passed on this tree (repo-wide scan); fixtures prove it fails on every pre-fix shape.
  • python3 .github/scripts/test_check_chat_selection_boundary.py — 11/11 passed.
  • scripts/pr-preflight --pr-body-file .harness/pr-body.md — 25/25 checks passed at head 13583a887d.
  • Named-bundle dogfood on this host: two bundles built, installed, and launched from this branch (omi-summary-scroll on the dev backend; omi-summary-scroll-local on the offline emulator stack — all stack services healthy, app connected, automation bridge serving state/actions). Live scroll-through of a signed-in summary was not possible on this host: no Omi / Omi Dev / Omi Beta install exists to clone a session from (all omi-auth-dump sources yield no idToken), web OAuth cannot run headless, and the hermetic bundle gates at onboarding, which the bridge cannot complete (no live onboarding coordinator). No live proof is claimed beyond launch + bridge + the suites above.

Failure-Class

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

Product invariants affected

  • INV-NAV-1: ConversationsPage.swift is on the invariant's path globs. This
    change does not touch navigation, destinations, or routing — it only gates
    when an already-selected row struct is replaced on list publishes. Both shells
    still route to the same feature-complete Conversations page.

Closes abc0449d-cb7b-4d54-b1bc-e2ad21de32ea

Review in cubic

… 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
…sation 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
… 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

@cubic-dev-ai cubic-dev-ai 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.

8 issues found across 11 files

Confidence score: 2/5

  • ConversationDetailRequestIdentity.swift omits state that affects the rendered detail, including isLocked, deferred, appId, photos, and visible metadata; unchanged tokens can leave stale processing/header state, app chips, section visibility, or summary content on screen. Include all rendered fields in the identity and replacement checks.
  • ConversationsPage.swift suppresses row updates when section headings or action completion/linkage change without body changes, so an open detail can retain a stale summary UI. Update the guard to account for these fields.
  • .github/scripts/check_chat_selection_boundary.py can miss a native-selection modifier after a multiline OmiMarkdown call, allowing an invalid source pattern through. Track multiline calls through the closing parenthesis and add the regression fixture.
  • Coverage and test hygiene need follow-up: desktop/macos/e2e/flows/conversation-detail.yaml does not exercise request-identity reload behavior, while testSummaryMarkdownHostsSelectableAppKitProse uses unannotated wall-clock waits and test_check_chat_selection_boundary.py violates the required top-level spacing. Add the identity flow, annotate or replace the waits, and fix the formatting.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="desktop/macos/Desktop/Sources/MainWindow/Pages/ConversationsPage.swift">

<violation number="1" location="desktop/macos/Desktop/Sources/MainWindow/Pages/ConversationsPage.swift:173">
P2: When a section heading or an action item's completion/linkage changes without changing its body or description, this guard suppresses the row update and leaves the open detail showing stale summary UI. Include every rendered field in the revision (at least section headings and action-item completion/linkage/source fields) before using it as the replacement gate.</violation>
</file>

<file name=".github/scripts/check_chat_selection_boundary.py">

<violation number="1" location=".github/scripts/check_chat_selection_boundary.py:104">
P2: When an `OmiMarkdown` call spans multiple lines, this guard misses a native-selection modifier placed after its closing `)`. Track the call start through multiline arguments and add a regression fixture for this valid chain shape.</violation>
</file>

<file name="desktop/macos/e2e/flows/conversation-detail.yaml">

<violation number="1" location="desktop/macos/e2e/flows/conversation-detail.yaml:10">
P2: This flow never exercises the behavior of ConversationDetailRequestIdentity.swift. The file exists to decide when an open detail re-loads (ConversationDetailView .task(id: detailRequestToken)) and when a refreshed list row replaces the selection (ConversationsPage.shouldReplaceSelectedConversation), but the flow only opens a conversation and snapshots it — it never updates an open conversation and never asserts that an unchanged token avoids a remount or that a changed token triggers a reload. Per the covers rule, either add steps that mutate the open conversation and assert the reload/replace outcome, or drop this covers entry. The token logic is already covered by ConversationDetailAutomationStateTests; the e2e manifest shouldn't claim what it doesn't verify.</violation>
</file>

<file name="desktop/macos/Desktop/Tests/ConversationDetailAutomationStateTests.swift">

<violation number="1" location="desktop/macos/Desktop/Tests/ConversationDetailAutomationStateTests.swift:186">
P2: The new testSummaryMarkdownHostsSelectableAppKitProse blocks on two fixed 0.2s wall-clock RunLoop waits without the required `// omi-test-quality: wall-clock-wait -- <why>` annotation. AGENTS.md bans wall-clock sleeps in unit tests and the codebase annotates every unavoidable AppKit-run-loop wait (e.g. ChatScrollLiveEdgeTests.swift:454), so this becomes timing-dependent and can flake when a loaded CI runner mounts the NSTextView slower than 0.2s. Annotate the waits, or drive a deterministic layout signal instead.</violation>
</file>

<file name="desktop/macos/Desktop/Sources/MainWindow/Pages/ConversationDetailRequestIdentity.swift">

<violation number="1" location="desktop/macos/Desktop/Sources/MainWindow/Pages/ConversationDetailRequestIdentity.swift:27">
P2: When the primary result keeps the same markdown but its `appId` changes, this token stays equal and the selected row is not replaced, leaving the old app chip and section visibility on screen. Include the primary result identity in the revision.</violation>

<violation number="2" location="desktop/macos/Desktop/Sources/MainWindow/Pages/ConversationDetailRequestIdentity.swift:59">
P2: When `isLocked` or `deferred` changes while ID, title, folder, status, and summary stay the same, the request token does not change and the selected detail keeps stale header or processing state. Include these visible state inputs in the request identity.</violation>

<violation number="3" location="desktop/macos/Desktop/Sources/MainWindow/Pages/ConversationDetailRequestIdentity.swift:60">
P2: When a refreshed row changes photos or visible metadata without changing the recorded text fields, the replacement gate suppresses the update and the summary remains stale. Add these rendered fields to the identity or update them through a separate non-remounting path.</violation>
</file>

<file name=".github/scripts/test_check_chat_selection_boundary.py">

<violation number="1" location=".github/scripts/test_check_chat_selection_boundary.py:38">
P3: Only one blank line separates `return sources` from `def conversation_detail_sources()`; PEP8/E302 and the repo's black pre-commit hook require two blank lines between top-level definitions, so the committed file does not match formatter output and a later black run would rewrite it.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

guard let selectedConversation,
let refreshed = conversations.first(where: { $0.id == selectedConversation.id })
else { return }
guard Self.shouldReplaceSelectedConversation(selectedConversation, with: refreshed) else { return }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: When a section heading or an action item's completion/linkage changes without changing its body or description, this guard suppresses the row update and leaves the open detail showing stale summary UI. Include every rendered field in the revision (at least section headings and action-item completion/linkage/source fields) before using it as the replacement gate.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/Desktop/Sources/MainWindow/Pages/ConversationsPage.swift, line 173:

<comment>When a section heading or an action item's completion/linkage changes without changing its body or description, this guard suppresses the row update and leaves the open detail showing stale summary UI. Include every rendered field in the revision (at least section headings and action-item completion/linkage/source fields) before using it as the replacement gate.</comment>

<file context>
@@ -152,6 +170,7 @@ struct ConversationsPage: View {
         guard let selectedConversation,
           let refreshed = conversations.first(where: { $0.id == selectedConversation.id })
         else { return }
+        guard Self.shouldReplaceSelectedConversation(selectedConversation, with: refreshed) else { return }
         self.selectedConversation = refreshed
       }
</file context>

anchor -= 1
# Same line (`OmiMarkdown(...).textSelection(.enabled)`) or the head of
# the modifier chain one line above it.
if "OmiMarkdown(" in lines[anchor] or (anchor > 0 and "OmiMarkdown(" in lines[anchor - 1]):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: When an OmiMarkdown call spans multiple lines, this guard misses a native-selection modifier placed after its closing ). Track the call start through multiline arguments and add a regression fixture for this valid chain shape.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/scripts/check_chat_selection_boundary.py, line 104:

<comment>When an `OmiMarkdown` call spans multiple lines, this guard misses a native-selection modifier placed after its closing `)`. Track the call start through multiline arguments and add a regression fixture for this valid chain shape.</comment>

<file context>
@@ -36,17 +53,59 @@
+            anchor -= 1
+        # Same line (`OmiMarkdown(...).textSelection(.enabled)`) or the head of
+        # the modifier chain one line above it.
+        if "OmiMarkdown(" in lines[anchor] or (anchor > 0 and "OmiMarkdown(" in lines[anchor - 1]):
+            hits.append(index + 1)
+    return hits
</file context>

- desktop/macos/Desktop/Sources/MainWindow/Components/ConversationStatusBadge.swift
- desktop/macos/Desktop/Sources/MainWindow/Components/ConversationProcessingBanner.swift
- desktop/macos/Desktop/Sources/MainWindow/Pages/ConversationDetailView.swift
- desktop/macos/Desktop/Sources/MainWindow/Pages/ConversationDetailRequestIdentity.swift

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: This flow never exercises the behavior of ConversationDetailRequestIdentity.swift. The file exists to decide when an open detail re-loads (ConversationDetailView .task(id: detailRequestToken)) and when a refreshed list row replaces the selection (ConversationsPage.shouldReplaceSelectedConversation), but the flow only opens a conversation and snapshots it — it never updates an open conversation and never asserts that an unchanged token avoids a remount or that a changed token triggers a reload. Per the covers rule, either add steps that mutate the open conversation and assert the reload/replace outcome, or drop this covers entry. The token logic is already covered by ConversationDetailAutomationStateTests; the e2e manifest shouldn't claim what it doesn't verify.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/e2e/flows/conversation-detail.yaml, line 10:

<comment>This flow never exercises the behavior of ConversationDetailRequestIdentity.swift. The file exists to decide when an open detail re-loads (ConversationDetailView .task(id: detailRequestToken)) and when a refreshed list row replaces the selection (ConversationsPage.shouldReplaceSelectedConversation), but the flow only opens a conversation and snapshots it — it never updates an open conversation and never asserts that an unchanged token avoids a remount or that a changed token triggers a reload. Per the covers rule, either add steps that mutate the open conversation and assert the reload/replace outcome, or drop this covers entry. The token logic is already covered by ConversationDetailAutomationStateTests; the e2e manifest shouldn't claim what it doesn't verify.</comment>

<file context>
@@ -7,6 +7,7 @@ covers:
   - desktop/macos/Desktop/Sources/MainWindow/Components/ConversationStatusBadge.swift
   - desktop/macos/Desktop/Sources/MainWindow/Components/ConversationProcessingBanner.swift
   - desktop/macos/Desktop/Sources/MainWindow/Pages/ConversationDetailView.swift
+  - desktop/macos/Desktop/Sources/MainWindow/Pages/ConversationDetailRequestIdentity.swift
   - desktop/macos/Desktop/Sources/MainWindow/Pages/ConversationAppSelectorSheet.swift
   - desktop/macos/Desktop/Sources/MainWindow/Pages/ConversationSummarySelection.swift
</file context>
Suggested change
- desktop/macos/Desktop/Sources/MainWindow/Pages/ConversationDetailRequestIdentity.swift
- - desktop/macos/Desktop/Sources/MainWindow/Pages/ConversationDetailRequestIdentity.swift

styleMask: [.titled], backing: .buffered, defer: false)
window.contentView = hostingView
NonintrusiveTestWindow.orderIn(window)
RunLoop.current.run(until: Date().addingTimeInterval(0.2))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: The new testSummaryMarkdownHostsSelectableAppKitProse blocks on two fixed 0.2s wall-clock RunLoop waits without the required // omi-test-quality: wall-clock-wait -- <why> annotation. AGENTS.md bans wall-clock sleeps in unit tests and the codebase annotates every unavoidable AppKit-run-loop wait (e.g. ChatScrollLiveEdgeTests.swift:454), so this becomes timing-dependent and can flake when a loaded CI runner mounts the NSTextView slower than 0.2s. Annotate the waits, or drive a deterministic layout signal instead.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/Desktop/Tests/ConversationDetailAutomationStateTests.swift, line 186:

<comment>The new testSummaryMarkdownHostsSelectableAppKitProse blocks on two fixed 0.2s wall-clock RunLoop waits without the required `// omi-test-quality: wall-clock-wait -- <why>` annotation. AGENTS.md bans wall-clock sleeps in unit tests and the codebase annotates every unavoidable AppKit-run-loop wait (e.g. ChatScrollLiveEdgeTests.swift:454), so this becomes timing-dependent and can flake when a loaded CI runner mounts the NSTextView slower than 0.2s. Annotate the waits, or drive a deterministic layout signal instead.</comment>

<file context>
@@ -61,25 +62,155 @@ final class ConversationDetailAutomationStateTests: XCTestCase {
+      styleMask: [.titled], backing: .buffered, defer: false)
+    window.contentView = hostingView
+    NonintrusiveTestWindow.orderIn(window)
+    RunLoop.current.run(until: Date().addingTimeInterval(0.2))
+    hostingView.layoutSubtreeIfNeeded()
+    RunLoop.current.run(until: Date().addingTimeInterval(0.2))
</file context>

let title: String
let folderID: String?
let status: String
let summaryRevision: ConversationSummaryRevision

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: When a refreshed row changes photos or visible metadata without changing the recorded text fields, the replacement gate suppresses the update and the summary remains stale. Add these rendered fields to the identity or update them through a separate non-remounting path.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/Desktop/Sources/MainWindow/Pages/ConversationDetailRequestIdentity.swift, line 60:

<comment>When a refreshed row changes photos or visible metadata without changing the recorded text fields, the replacement gate suppresses the update and the summary remains stale. Add these rendered fields to the identity or update them through a separate non-remounting path.</comment>

<file context>
@@ -0,0 +1,85 @@
+  let title: String
+  let folderID: String?
+  let status: String
+  let summaryRevision: ConversationSummaryRevision
+
+  init(conversation: ServerConversation) {
</file context>

let conversationID: String
let title: String
let folderID: String?
let status: String

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: When isLocked or deferred changes while ID, title, folder, status, and summary stay the same, the request token does not change and the selected detail keeps stale header or processing state. Include these visible state inputs in the request identity.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/Desktop/Sources/MainWindow/Pages/ConversationDetailRequestIdentity.swift, line 59:

<comment>When `isLocked` or `deferred` changes while ID, title, folder, status, and summary stay the same, the request token does not change and the selected detail keeps stale header or processing state. Include these visible state inputs in the request identity.</comment>

<file context>
@@ -0,0 +1,85 @@
+  let conversationID: String
+  let title: String
+  let folderID: String?
+  let status: String
+  let summaryRevision: ConversationSummaryRevision
+
</file context>

let secondaryResultContents: [String]

init(conversation: ServerConversation) {
primaryContent = ConversationSummarySelection.primarySummary(for: conversation).content

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: When the primary result keeps the same markdown but its appId changes, this token stays equal and the selected row is not replaced, leaving the old app chip and section visibility on screen. Include the primary result identity in the revision.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/Desktop/Sources/MainWindow/Pages/ConversationDetailRequestIdentity.swift, line 27:

<comment>When the primary result keeps the same markdown but its `appId` changes, this token stays equal and the selected row is not replaced, leaving the old app chip and section visibility on screen. Include the primary result identity in the revision.</comment>

<file context>
@@ -0,0 +1,85 @@
+  let secondaryResultContents: [String]
+
+  init(conversation: ServerConversation) {
+    primaryContent = ConversationSummarySelection.primarySummary(for: conversation).content
+    sectionBodies = conversation.structured.sections.map(\.bodyMarkdown)
+    actionItemDescriptions = conversation.structured.actionItems
</file context>
Suggested change
primaryContent = ConversationSummarySelection.primarySummary(for: conversation).content
+ primaryContent = { let selection = ConversationSummarySelection.primarySummary(for: conversation); return "\(String(describing: selection.appId))\u{0}\(selection.content)" }()

),
}
sources.update(conversation_detail_sources())
return sources

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: Only one blank line separates return sources from def conversation_detail_sources(); PEP8/E302 and the repo's black pre-commit hook require two blank lines between top-level definitions, so the committed file does not match formatter output and a later black run would rewrite it.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/scripts/test_check_chat_selection_boundary.py, line 38:

<comment>Only one blank line separates `return sources` from `def conversation_detail_sources()`; PEP8/E302 and the repo's black pre-commit hook require two blank lines between top-level definitions, so the committed file does not match formatter output and a later black run would rewrite it.</comment>

<file context>
@@ -34,6 +34,38 @@ def clean_sources() -> dict[str, str]:
         ),
     }
+    sources.update(conversation_detail_sources())
+    return sources
+
+def conversation_detail_sources() -> dict[str, str]:
</file context>

@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.

Desktop conversation-detail re-render fix: reviewed the full diff (including the .github/scripts CI-boundary changes described in the PR body) — scoped to the claimed fix, no workflow or credential changes. Not merging: Desktop Swift Build & Tests and Desktop Swift Static & Test Contracts are both failing (required-contracts step) at head 13583a8. Approving only; needs green CI before merge.

@Git-on-my-level
Git-on-my-level merged commit 0e4d8e2 into main Sep 13, 2026
44 checks passed
@Git-on-my-level
Git-on-my-level deleted the fix/desktop-conversation-summary-scroll-rerender branch September 13, 2026 18:54
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.

2 participants