Skip to content

fix(clients): links to archived threads show as archived again - #41367

Closed
clintebbesen wants to merge 1 commit into
pingdotgg:mainfrom
clintebbesen:fix/archived-thread-links
Closed

clintebbesen wants to merge 1 commit into
pingdotgg:mainfrom
clintebbesen:fix/archived-thread-links

Conversation

@clintebbesen

Copy link
Copy Markdown

Problem

Since #32830, a link to an archived thread looks exactly like a link to a live one: same title, same project icon, same "Open thread" tooltip. Clicking it opens the new-thread screen, because an archived thread has no page. Before 0.1.11, archived links fell back to the plain icon, so a list of links (for example an agent's "these threads are ready to archive" list) showed which ones were already archived. Now there is no way to tell without clicking each one.

Repro: have a message link several threads, archive two of them, go back to the message. Details in #40685.

Change

  • getThreadLinkMetadata also returns archived (from archived_at). The key is optional in the contract, so servers that predate it keep today's behaviour.
  • Web: a link to an archived thread gets the archive icon and the unresolved accent, its hover card says it is archived, and clicking it opens Settings > Archive, where it can be unarchived, instead of the new-thread screen. Its label reads "Archived thread, {title}".
  • Mobile: a link to an archived thread shows the plain thread icon again instead of the project icon.
  • isArchivedThreadLinkTarget in @t3tools/shared/threadLinks reads the state from a loaded shell (archivedAt) or from link metadata, for both clients.
  • The two new strings are translated in every web locale.

The live-thread fixes from #32830 are unchanged: unloaded live threads still show their title and project icon.

Scope

Fixes #40685, a regression from #32830 (0.1.7 showed archived links apart, 0.1.11 does not).

Verification

  • ProjectionStore.test.ts "worktree path and title lookups..." now expects archived: false / true. It fails on main (the field is missing) and passes with the fix.
  • MarkdownThreadLink.browser.test.tsx "resolves an unloaded thread..." now also checks an archived target: it is labelled "Archived thread, Older essay", shows no project icon, and opens /settings/archived. It fails on main and passes with the fix, in all three cases.
  • threadLinks.test.ts covers the helper, including servers without the flag.
  • vp run check:changed passes (format, lint, knip, typecheck, tests, React Compiler). vp run i18n:check passes.
  • Manual check with vp run dev on an isolated home: five demo threads linked from one reply, two archived through the sidebar. Before and after, same data:
Before (main) After
before after
Clicking an archived link opens the new-thread screen:
before click
Hover says it is archived; clicking opens Settings > Archive:
after hover
after click

Not checked: the mobile change on a device or simulator. It only drops the project icon for archived targets, using the same helper as web.

Implemented with Claude Opus 5.5 through the Claude Code harness in T3 Code.

Since thread links started reading title and project for threads that are
not loaded (pingdotgg#32830), a link to an archived thread looks exactly like a live
one and opens the new-thread screen. Before that, archived links fell back
to the plain icon, so a list of links showed which threads were archived.

Thread link metadata now says whether the thread is archived. Web shows an
archived link with the archive icon and the unresolved accent, its hover
card says it is archived, and clicking it opens Settings > Archive, where
it can be unarchived. Mobile shows the plain thread icon again. Servers
without the flag keep today's behaviour.

Fixes pingdotgg#40685
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Nov 23, 2026
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Thread-link metadata now identifies archived threads. Web and mobile chips use that status to distinguish archived links. Web chips link to the archive, and their hover cards explain that threads can be unarchived there.

Changes: Archived thread links

Layer / File(s) Summary
Archived metadata and detection
packages/contracts/src/orchestrationV2.ts, packages/shared/src/threadLinks.ts, packages/shared/src/threadLinks.test.ts, apps/server/src/orchestration-v2/ProjectionStore.ts, apps/server/src/orchestration-v2/ProjectionStore.test.ts, packages/client-runtime/src/state/orchestration.ts
The metadata contract adds an optional archived field. The server includes archived status in thread-link metadata. Shared code detects archived targets, with tests for both supported metadata shapes.
Archived chip presentation
apps/web/src/components/chat/MarkdownThreadLink.tsx, apps/web/src/components/ThreadContextChip.tsx, apps/web/src/components/ThreadChipHoverCard.tsx, apps/web/src/components/chat/MarkdownThreadLink.browser.test.tsx, apps/web/src/i18n/translations/*.json, apps/mobile/src/state/entities.ts
Web chips identify archived threads, link to /settings/archived, and show archive-specific hover text. The mobile project-chip icon is omitted for archived targets. Browser tests and translations cover the archived presentation.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant ProjectionStore
  participant MarkdownThreadLink
  participant ThreadContextChip
  participant ArchiveSettings
  ProjectionStore->>MarkdownThreadLink: Return thread metadata with archived status
  MarkdownThreadLink->>ThreadContextChip: Pass archived status
  ThreadContextChip->>ArchiveSettings: Navigate to /settings/archived when archived
Loading

Possibly related issues

  • Issue 16443 reports that opening an archived thread by link returns the user to home. This change directs archived links to the archive settings page, but does not open the archived conversation.

Suggested reviewers: stienswout, bil0000, flamboh

Merge Risk: Minimal · up to 6f7b4

Archived thread links now show as archived and open Settings > Archive. Servers that do not send the new flag behave as before, so this is low risk to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(clients): links to archived threads show as archived again" follows conventional commit form and names the main change: links to archived threads are shown as archived again. The change…
Description check Passed The description follows the template well. It has Problem, Change, Scope, and Verification sections. The Problem section explains the regression since #32830 and gives reproduction steps. The Change s…
Linked Issues check Passed Directly linked issue #40685 asks that links to archived threads look different from live links, and that clicking one give a way to see or unarchive it. The change set covers these points. [#40685] P…
Out of Scope Changes check Passed Every changed area supports the archived-link objective. Server: ProjectionStore.ts and its test add the archived field. Contract: orchestrationV2.ts adds the optional field. Shared: threadLinks.ts …
Full details: Title check

Explanation

The title "fix(clients): links to archived threads show as archived again" follows conventional commit form and names the main change: links to archived threads are shown as archived again. The changeset adds an archived flag to thread link metadata, archive styling and hover card in web, a plain icon for archived targets in mobile, and a shared helper. The title is specific and matches the primary change. The scope "clients" is broad but acceptable because the fix spans web and mobile clients.

Full details: Description check

Explanation

The description follows the template well. It has Problem, Change, Scope, and Verification sections. The Problem section explains the regression since #32830 and gives reproduction steps. The Change section lists the server, web, mobile, and shared-helper changes and states why the optional contract field keeps older servers working. The Scope section links #40685 and explains the regression. The Verification section names the focused tests, reports check results, includes before/after screenshots for the UI change, and states what was not checked on mobile. It also names the model and harness, as the template asks.

Full details: Linked Issues check

Explanation

Directly linked issue #40685 asks that links to archived threads look different from live links, and that clicking one give a way to see or unarchive it. The change set covers these points. [#40685] ProjectionStore.ts adds an archived flag from archived_at to getThreadLinkMetadata. The contract in orchestrationV2.ts marks it optional, so older servers keep current behavior. ThreadContextChip.tsx and ThreadChipHoverCard.tsx show an archive icon, the unresolved accent, an archived hover card, and the label "Archived thread, {title}". Clicking opens /settings/archived, where the thread can be unarchived. Mobile (entities.ts) drops the project icon for archived targets. The issue's "Better still" option was a read-only archived view with an Unarchive button. The PR instead opens Settings > Archive, which offers unarchive. This is a different route to the same user outcome, and the PR description states the choice. Tests cover the server metadata (ProjectionStore.test.ts), the web link behavior for an archived target (MarkdownThreadLink.browser.test.tsx), and the helper (threadLinks.test.ts). Live-thread behavior from #32830 is unchanged per the description. Mobile behavior was not verified on a device; this does not affect the code-level verdict.

Full details: Out of Scope Changes check

Explanation

Every changed area supports the archived-link objective. Server: ProjectionStore.ts and its test add the archived field. Contract: orchestrationV2.ts adds the optional field. Shared: threadLinks.ts adds isArchivedThreadLinkTarget, with tests. Web: ThreadContextChip, ThreadChipHoverCard, and MarkdownThreadLink handle the archived presentation and navigation, with a browser test. The two new strings appear in every web locale file, as required for the new UI text. Mobile: entities.ts uses the shared helper to drop the project icon for archived targets. client-runtime orchestration.ts only changes the type of the fallback metadata record to match the contract. This change is small and supports the new optional field. No unrelated functional change appears in the summary.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between d63b9c4 and 6f7b45c.

Files selected for processing: 21

  • apps/mobile/src/state/entities.ts
  • apps/server/src/orchestration-v2/ProjectionStore.test.ts
  • apps/server/src/orchestration-v2/ProjectionStore.ts
  • apps/web/src/components/ThreadChipHoverCard.tsx
  • apps/web/src/components/ThreadContextChip.tsx
  • apps/web/src/components/chat/MarkdownThreadLink.browser.test.tsx
  • apps/web/src/components/chat/MarkdownThreadLink.tsx
  • apps/web/src/i18n/translations/de.json
  • apps/web/src/i18n/translations/en.json
  • apps/web/src/i18n/translations/es.json
  • apps/web/src/i18n/translations/fr.json
  • apps/web/src/i18n/translations/ja.json
  • apps/web/src/i18n/translations/ko.json
  • apps/web/src/i18n/translations/pt-BR.json
  • apps/web/src/i18n/translations/ru.json
  • apps/web/src/i18n/translations/sv.json
  • apps/web/src/i18n/translations/zh.json
  • packages/client-runtime/src/state/orchestration.ts
  • packages/contracts/src/orchestrationV2.ts
  • packages/shared/src/threadLinks.test.ts
  • packages/shared/src/threadLinks.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@juliusmarminge

Copy link
Copy Markdown
Member

Thanks for this. #40928 makes the same change and is the one being kept.

#40928 addresses the same archived-link regression and makes the mobile state explicit with an archive icon and label, including thread mentions. This version only restores the plain mobile thread icon, which does not clearly identify why the project icon disappeared.

Your metadata approach addresses the same underlying problem. The other pull request also covers restoring the live presentation after unarchiving and leaves archived-thread navigation to its separate fix, so it is the more complete change to keep for this issue.

Closing as a duplicate.

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

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Links to archived threads look the same as live ones (regression since 0.1.7)

2 participants