Skip to content

feat(desktop): distinguish processing/locked/recoverable from 'Untitled' - #7630

Merged
undivisible merged 2 commits into
mainfrom
caleb/desktop-conversation-status
Aug 20, 2026
Merged

undivisible merged 2 commits into
mainfrom
caleb/desktop-conversation-status

Conversation

@mdmohsin7

Copy link
Copy Markdown
Member

Summary

Desktop was collapsing four distinct "why does this conversation have no title?" cases into one flat "Untitled Conversation" label, with no inline path to recover. This PR splits them apart and adds a one-tap reprocess affordance for the recoverable cases.

Before

Every row with an empty structured.title looked the same — whether the conversation was still processing, locked behind a stale subscription, the LLM had silently failed, or it was just 2 seconds of ambient noise. Users couldn't tell which, and the only way to recover the silent-failure case was the "Reprocess with App" submenu deep in the detail view.

After

  • New ConversationDisplayState on ServerConversation reads status, isLocked, and structured.title together → one of titled / processing / locked / untitledRecoverable / untitledEmpty / failed.
  • New ConversationStatusBadge pill renders inline next to the title:
    • Processing (pulsing dot, info color)
    • Locked (lock icon, warning color)
    • Failed (warning icon, error color)
    • Needs reprocess (wand icon, info color) — only on the recoverable case
  • Placeholder titles render in textTertiary so they read as secondary text rather than impersonating a real title.
  • untitledRecoverable and failed rows expose a one-tap reprocess button on hover, plus a "Reprocess Title & Summary" entry in the context menu. Calls existing POST /v1/conversations/{id}/reprocess via a new no-app overload on APIClient.
  • untitledEmpty rows (no transcript or only a tiny first segment) stay quiet — surfacing reprocess there would just burn LLM tokens on ambient capture.
  • ConversationDetailView header swaps its bespoke status badge for the shared component so all four states render consistently.

Test plan

  • ConversationDisplayStateTests covers all six branches incl. locked-takes-precedence and the recoverable-vs-empty heuristic (≥5 words in at least one segment).
  • Manual: open a known untitled conversation → see "Needs reprocess" pill → tap the wand icon → confirm title regenerates and the badge disappears.
  • Manual: simulate a locked conversation → see "Locked" pill, no reprocess CTA.
  • Manual: in-progress conversation → see pulsing "Processing" pill.
  • Regression: a normally titled conversation looks identical to before.

Notes

  • Original displayConversation.title accessor preserved (exports / log lines / copy-to-clipboard still want a single plain string). UI surfaces should prefer displayTitle.
  • Heuristic for "recoverable" content is intentionally simple (≥5 words in any one segment) — easy to tune later if it misfires either way.

@greptile-apps

greptile-apps Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR replaces the single flat "Untitled Conversation" label with a six-state ConversationDisplayState computed property (titled, processing, locked, failed, untitledRecoverable, untitledEmpty) and introduces a shared ConversationStatusBadge pill plus a one-tap reprocess affordance for the recoverable and failed cases.

  • Adds ConversationDisplayState enum and displayState/displayTitle/canReprocess computed properties to ServerConversation, backed by a new no-app reprocessConversation API overload that correctly decodes the backend's Conversation response.
  • Replaces the bespoke status badge in ConversationDetailView with the new shared ConversationStatusBadge; adds an inline wand button and context-menu entry in ConversationRowView that call the reprocess API, then update local state via appState.updateConversationTitle.
  • After a successful reprocess of a failed conversation, appState.updateConversationTitle only writes structured.title but never updates status; since displayState branches on status before checking the title, the "Failed" badge and wand button remain visible indefinitely even when the reprocess fully succeeded."

Confidence Score: 3/5

Safe to merge for the processing/locked/untitledEmpty display improvements, but the reprocess-a-failed-conversation flow leaves the Failed badge permanently stuck after a successful reprocess.

The displayState switch evaluates status before examining structured.title, so a status==.failed conversation that gets a new title via reprocessing will never exit the .failed branch locally — the badge and wand button stay on-screen after a successful API call. The untitledRecoverable path works correctly because its status is already .completed. Everything else in the PR is solid.

desktop/Desktop/Sources/MainWindow/Components/ConversationRowView.swift — the post-reprocess state update needs to write the conversation status (or replace the full object) in addition to the title.

Important Files Changed

Filename Overview
desktop/Desktop/Sources/APIClient.swift Adds ConversationDisplayState enum, displayState/displayTitle/canReprocess computed properties on ServerConversation, and a no-app reprocessConversation overload that correctly returns ServerConversation (matching the backend Conversation response_model).
desktop/Desktop/Sources/MainWindow/Components/ConversationRowView.swift Adds isReprocessing state, reprocessConversation() async handler, inline wand button, and context-menu entry. Has a bug: after reprocessing a failed conversation, status is never updated so the Failed badge persists despite a successful reprocess.
desktop/Desktop/Sources/MainWindow/Components/ConversationStatusBadge.swift New shared badge component covering all six ConversationDisplayState cases with appropriate icons, colors, and pulsing animation for processing state.
desktop/Desktop/Sources/MainWindow/Pages/ConversationDetailView.swift Replaces the bespoke status badge with ConversationStatusBadge and adds detailTitleColor to dim placeholder titles; no functional regressions found.
desktop/Desktop/Tests/ConversationDisplayStateTests.swift Comprehensive unit tests covering all six displayState branches including the locked-takes-precedence invariant and the word-count heuristic boundary; no gaps observed.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[ServerConversation] --> B{isLocked?}
    B -- Yes --> L[.locked no reprocess CTA]
    B -- No --> C{status}
    C -- inProgress/processing/merging --> P[.processing no reprocess CTA]
    C -- failed --> F[.failed canReprocess=true]
    C -- completed --> D{structured.title non-empty?}
    D -- Yes --> T[.titled no badge]
    D -- No --> E{any segment with 5+ words?}
    E -- Yes --> R[.untitledRecoverable canReprocess=true]
    E -- No --> U[.untitledEmpty no badge no CTA]
    F --> W[Wand button reprocessConversation API]
    R --> W
    W --> X[refreshed ServerConversation]
    X --> Y[updateConversationTitle writes structured.title only]
    Y --> Z1{was untitledRecoverable?}
    Z1 -- Yes --> OK[displayState to .titled badge disappears]
    Z1 -- No --> BUG[displayState still .failed badge persists]
Loading

Reviews (1): Last reviewed commit: "feat(desktop): distinguish processing/lo..." | Re-trigger Greptile

mdmohsin7 added a commit that referenced this pull request Jun 3, 2026
…reprocess

Addresses two comments on #7630:

- P1: reprocessing a .failed conversation only updated structured.title.
  Since displayState checks status before title, the 'Failed' pill and
  reprocess CTA stayed stuck on the row indefinitely and the user could
  keep firing reprocess calls. Fix by replacing the whole conversation
  with the refreshed payload (new replaceConversation method on AppState
  — also picks up the updated overview, action items, status). The
  untitledRecoverable path already worked because its status was already
  .completed.
- P2: the new one-tap reprocess path had no analytics. Existing
  conversationReprocessed signature requires an appId, so added a
  separate conversationReprocessedDefault event to keep the two funnels
  distinguishable in product metrics.
@Git-on-my-level

Copy link
Copy Markdown
Member

Great work on this @mdmohsin7 — this is a clean, well-scoped improvement to a core UX surface.

What I like:

  • The ConversationDisplayState model is the right abstraction. Collapsing four distinct "no title" causes into one "Untitled" string was genuinely misleading, and the precedence ordering (locked → status → title → recoverable heuristic) reads correctly.
  • The ≥5-word recoverable heuristic is pragmatic and well-tested at the boundary. Keeping untitledEmpty quiet instead of pushing reprocess on ambient noise is a good call (saves LLM tokens and avoids dead-end CTAs).
  • Test coverage is solid — all six branches, locked-takes-precedence invariant, and the multi-segment promotion edge case.
  • The Greptile review caught a real bug (reprocessing a .failed conversation wouldn't clear the Failed badge because updateConversationTitle only wrote the title). The fix in fb35b88a — replacing the whole ServerConversation via replaceConversation so status flips to .completed — is correct and well-documented.

One thing before merge:
GitHub reports this branch as having merge conflicts with main. Could you rebase/resolve when you get a chance? The code itself looks good to go once conflicts are cleared.

Minor (non-blocking): the catch in reprocessConversation() only logs — if reprocess fails the user gets no visible feedback. That's consistent with how updateTitle() handles errors in the same file, so not a regression, but worth a follow-up if you want to add a toast/alert later.

@Git-on-my-level Git-on-my-level added the needs-maintainer-review Needs a human maintainer to sign off before merge label Jun 26, 2026

@Git-on-my-level Git-on-my-level left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approving — this is a clean, well-scoped improvement to a core UX surface.

The ConversationDisplayState model is the right abstraction. Collapsing four distinct "no title" causes (processing, locked, recoverable silent-failure, genuinely-empty) into one flat "Untitled Conversation" was genuinely misleading, and the precedence ordering (locked → status → title → recoverable heuristic) reads correctly.

A few things worth calling out:

  • The Greptile review caught a real bug — reprocessing a .failed conversation wouldn't clear the Failed badge because only the title was written. The fix in fb35b88a (replacing the whole ServerConversation via replaceConversation so status flips to .completed) is correct and well-documented. Good catch on the follow-through.
  • The ≥5-word recoverable heuristic is pragmatic and well-tested at the boundary. Keeping untitledEmpty quiet instead of pushing reprocess on ambient noise is the right call.
  • Test coverage is solid — all six branches, the locked-takes-precedence invariant, and the multi-segment promotion edge case.

One thing before merge: GitHub reports this branch as having merge conflicts with main. Could you rebase/resolve when you get a chance? The code itself looks good to go once conflicts are cleared.

Minor (non-blocking): the catch in reprocessConversation() only logs — if reprocess fails the user gets no visible feedback. That's consistent with how updateTitle() handles errors in the same file, so not a regression, but worth a follow-up if you want to add a toast/alert later.

@Git-on-my-level
Git-on-my-level dismissed their stale review June 27, 2026 00:02

Automated approval dismissed: this PR falls into a category that should receive human maintainer/product/security judgment rather than formal auto-approval. No changes are being requested by this dismissal; prior automated feedback should be treated as an implementation review/positive signal only.

@undivisible undivisible added human Human-authored pull request desktop privacy-review Touches user-data persistence, permissions, or privacy-sensitive surfaces labels Aug 10, 2026
Conversations with no title were all rendered as the same 'Untitled
Conversation' string regardless of why — still processing, locked
behind a stale subscription, LLM silently failed, or just ambient
capture. Users had no way to tell which, and no inline path to
recover the recoverable cases.

- New ConversationDisplayState on ServerConversation collapses
  status/isLocked/structured.title into one of: titled, processing,
  locked, untitledRecoverable, untitledEmpty, failed.
- New ConversationStatusBadge pill renders the right cue inline next
  to the row/header title (Processing/Locked/Failed/Needs reprocess).
- Placeholder titles render in textTertiary so they read as secondary
  text instead of pretending to be a real title.
- Untitled-but-recoverable rows expose a one-tap reprocess affordance
  (inline hover button + context-menu entry) that calls the existing
  POST /v1/conversations/{id}/reprocess. Empty rows don't, to avoid
  burning LLM tokens on ambient/accidental capture.
- ConversationDetailView header swaps its bespoke status badge for the
  shared component so all four cases render consistently.

Tests cover the displayState heuristic across the six branches incl.
the locked-takes-precedence and recoverable-vs-empty edge cases.
…reprocess

Addresses two comments on #7630:

- P1: reprocessing a .failed conversation only updated structured.title.
  Since displayState checks status before title, the 'Failed' pill and
  reprocess CTA stayed stuck on the row indefinitely and the user could
  keep firing reprocess calls. Fix by replacing the whole conversation
  with the refreshed payload (new replaceConversation method on AppState
  — also picks up the updated overview, action items, status). The
  untitledRecoverable path already worked because its status was already
  .completed.
- P2: the new one-tap reprocess path had no analytics. Existing
  conversationReprocessed signature requires an appId, so added a
  separate conversationReprocessedDefault event to keep the two funnels
  distinguishable in product metrics.
@cursor
cursor Bot force-pushed the caleb/desktop-conversation-status branch from fb35b88 to 3ea42a6 Compare August 20, 2026 11:33

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

Rebased onto main after the desktop/macos move. Same ConversationDisplayState + badge + reprocess CTA. Local UI only.

@undivisible
undivisible merged commit 2981844 into main Aug 20, 2026
10 checks passed
@undivisible
undivisible deleted the caleb/desktop-conversation-status branch August 20, 2026 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

desktop human Human-authored pull request needs-maintainer-review Needs a human maintainer to sign off before merge privacy-review Touches user-data persistence, permissions, or privacy-sensitive surfaces

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants