Skip to content

fix: distinguish archived thread links - #40928

Open
shadowfeind wants to merge 2 commits into
pingdotgg:mainfrom
shadowfeind:fix/40685-archived-thread-links
Open

shadowfeind wants to merge 2 commits into
pingdotgg:mainfrom
shadowfeind:fix/40685-archived-thread-links

Conversation

@shadowfeind

@shadowfeind shadowfeind commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Problem

An archived thread still uses the active thread chip in conversations, so a list of links gives no indication which threads have already been archived. To reproduce, mention a thread in another conversation, archive the target, and look at the original link.

Change

Include archive status in the existing thread-link metadata. Web and desktop chips show an archive icon and an accessible “Archived thread” description, with the same status in the hover card. Mobile chips, for both Markdown links and thread mentions, show the archive icon and add “· Archived thread” after the title, since mobile has no hover card to carry the status. Unarchiving restores the project icon on every client.

Scope

Fixes #40685. This PR covers the chip’s appearance. Archived-thread navigation is tracked separately in #23278.

Verification

  • The full Chromium scenario failed on upstream 2c4310eb06 because the archive description was absent. It passed on 16e6a86ad7, where the indicator and hover card updated after archiving and cleared after unarchiving.
  • The projection test covers archived, active, deleted, and unknown targets. The browser test covers the unloaded Markdown link, and the client-runtime tests cover older-server fallback.
  • The mobile test in entities.test.ts failed before the fix for both Markdown links and thread mentions. It now passes, including the return to the project icon after unarchiving.
  • vp run check:changed upstream/main and the localization check passed for both commits. The integrated web check ran in Chromium.
  • The mobile change was captured in the iOS simulator (iPhone 17 Pro, iOS 26.5) against a local dev server. With the target thread archived, both the Markdown link and the thread mention showed the project icon on upstream 2c4310eb06, and showed the archive icon and “Archived thread” on 2bfbe0dac3. Electron was not run.
Before After
Web An archived thread link still shows its project icon The archived thread link shows an archive icon and an Archived thread tooltip
iOS On iOS, the Markdown link and thread mention to an archived thread still show the project icon On iOS, the Markdown link and thread mention to an archived thread show the archive icon and Archived thread

GPT-6.2 Sol in Codex; iOS captures by Claude Opus 5.5 in Claude Code

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Nov 22, 2026

@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: 16e6a86ad7

ℹ️ 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".

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-22T16:51:44.839449Z
We couldn’t complete this review. Comment @codex review to try again.
2bfbe0d Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Thread-link metadata now includes archive status. Web and mobile thread chips use that status to show archived threads with an archive icon and an “Archived thread” label. Tests cover metadata retrieval and archived-thread presentation.

Changes: Archived thread link status

Layer / File(s) Summary
Add archive status to thread-link metadata
packages/contracts/src/orchestrationV2.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 it for archived threads and continues to exclude deleted threads. The client fallback retains title-only metadata.
Pass metadata to web chips and display archive status
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, scripts/scenarios/archived-thread-link-shows-status.e2e.ts
Markdown thread links pass metadata to chips. Chips prefer shell archive and project state when available, otherwise use metadata. Archived chips show an archive icon and accessible label; hover cards show “Archived thread.” Browser and end-to-end tests cover archived status and unarchiving.
Resolve and render mobile chip presentations
apps/mobile/src/state/entities.ts, apps/mobile/src/native/useEnrichedLinkVariants.ts, apps/mobile/src/features/threads/ThreadFeed.tsx, apps/mobile/scripts/sync-context-chip-icons.mjs, apps/mobile/src/state/entities.test.ts, apps/mobile/src/lib/filePreview.test.ts
Mobile thread-chip state returns archived-title or project-URI presentations. Markdown link customization uses those presentations, and tests cover archived and project presentations.

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

Change: Bug fix · Severity of issue fixed: Medium

Possibly related issues

Suggested reviewers: juliusmarminge

Merge Risk: Minimal · up to 2bfbe

Archived thread links now show an archive icon and an "Archived thread" label on web and mobile. The change only affects chip appearance, adds an optional metadata field that older servers can omit, and has no remaining merge-blocking risk.

Pre-merge checks: Passed 4

Check name Status Explanation
Linked Issues check Passed Directly linked issue #40685 is open. Its core Expected behavior requires that links to archived threads look different from links to live threads. The change summary shows this for web. ProjectionSto…
Out of Scope Changes check Passed The web, contract, server projection, client-runtime, and e2e changes support the archived-thread chip objective. The mobile changes (ThreadFeed.tsx, useEnrichedLinkVariants.ts, state/entities.ts, and…
Title check Passed The title "fix: distinguish archived thread links" matches the main change. The changeset adds archive status to thread-link metadata and shows an archive icon and "Archived thread" description on web…
Description check Passed The description follows the repository template closely. It has Problem, Change, Scope, and Verification sections, and each is filled in with specific content. The Problem section states the bug and r…
Full details: Linked Issues check

Explanation

Directly linked issue #40685 is open. Its core Expected behavior requires that links to archived threads look different from links to live threads. The change summary shows this for web. ProjectionStore.getThreadLinkMetadata selects archived_at and returns archived: true for archived targets. OrchestrationV2ThreadLinkMetadata gains optional archived. ThreadContextChip omits the project icon for archived links, shows an archive icon, and exposes an accessible 'Archived thread' description. ThreadChipHoverCard shows the same status. Unarchiving clears the status. Coverage comes from ProjectionStore.test.ts (archived, active, deleted, unknown), MarkdownThreadLink.browser.test.tsx (unloaded archived links), client-runtime fallback tests, and the scenario test archived-thread-link-shows-status.e2e.ts. Deviation to note: the issue example names a plain thread icon and the tooltip text 'Thread no longer available'. The PR uses an archive icon and the text 'Archived thread'. The issue requirement is distinguishability, which the PR meets. The exact icon and wording differ from the example. The second request in #40685, opening archived links read-only with an Unarchive button, is not implemented. The issue presents it as a 'Better still' suggestion, and the PR defers it to #23278. No repository inspection was run in this assessment; the result relies on the change summary and the PR verification notes.

Full details: Out of Scope Changes check

Explanation

The web, contract, server projection, client-runtime, and e2e changes support the archived-thread chip objective. The mobile changes (ThreadFeed.tsx, useEnrichedLinkVariants.ts, state/entities.ts, and their tests, plus the sync-context-chip-icons script) apply the same archived-status indication to native mobile thread chips. They do not add unrelated behavior. The PR description does not mention mobile, and the mobile archive icon depends on the generated asset apps/mobile/src/lib/contextChipIcons.generated.ts, which is in ignored_files. That generated file was not inspected. Navigation behavior is unchanged, which matches the stated scope.

Full details: Title check

Explanation

The title "fix: distinguish archived thread links" matches the main change. The changeset adds archive status to thread-link metadata and shows an archive icon and "Archived thread" description on web, desktop, and mobile chips. The title is short, uses a conventional commit prefix, and avoids vague terms.

Full details: Description check

Explanation

The description follows the repository template closely. It has Problem, Change, Scope, and Verification sections, and each is filled in with specific content. The Problem section states the bug and reproduction steps. The Change section explains the web, desktop, and mobile behavior, and it notes that unarchiving restores the project icon. The Scope section links issue #40685 and separates navigation work into #23278. The Verification section lists concrete checks and observed results for the Chromium scenario, the projection, browser, client-runtime, and mobile tests, and the iOS simulator run. It includes before and after screenshots for web and iOS, and it names the models that did the work. Two minor gaps remain. The Verification section does not state the Electron check result, but the author says Electron was not run, so the gap is disclosed. The author also does not say explicitly whether the Scope section's bug-fix framing matches the template's rule against features, though the description calls this a fix for a bug and links an issue.

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 16e6a86 and 2bfbe0d.

Files ignored due to path filters: 2

  • apps/mobile/assets/context-chip-icons/archive.png is excluded by !**/*.png
  • apps/mobile/src/lib/contextChipIcons.generated.ts is excluded by !**/*.generated.*
Files selected for processing: 6

  • apps/mobile/scripts/sync-context-chip-icons.mjs
  • apps/mobile/src/features/threads/ThreadFeed.tsx
  • apps/mobile/src/lib/filePreview.test.ts
  • apps/mobile/src/native/useEnrichedLinkVariants.ts
  • apps/mobile/src/state/entities.test.ts
  • apps/mobile/src/state/entities.ts

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

@shadowfeind shadowfeind changed the title fix(web): distinguish archived thread links fix: distinguish archived thread links Nov 22, 2026
@shadowfeind

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

This branch has not been deployed

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

Labels

size:L 100-499 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)

1 participant