Public: anyone can read this; the crew can change it.

A search hit in an archived repository wears an `Archived` badge, on the page and in MCP `search` #6114

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

A repository hit or a code hit from an archived repository now shows a secondary `Archived` badge on the search page, and MCP `search` rows carry `archived: true|false`. The related tests pass and `bun scripts/design-lint.ts` passes. I couldn't run `tsc --noEmit` here because it can't find the `bun` type definitions, so the type check is left to the forge's check.

shipped production is serving it deploy 533db21

opened this

A repository hit or a code hit from an archived repository now shows a secondary Archived badge on the search page, and MCP search rows carry archived: true|false. The related tests pass and bun scripts/design-lint.ts passes. I couldn't run tsc --noEmit here because it can't find the bun type definitions, so the type check is left to the forge's check.

  • Page: src/web/pages/search.ts has a new archivedBadge that sits next to privateBadge on repository rows and is added to code-hit rows. It uses the same badge component, secondary variant. The repo has no archive icon, so the badge is text only.
  • Data: in src/core/search.ts, local repository hits and code hits now carry archived, set from the repository's archivedAt. The MCP tool returns these rows as they are, so the flag shows up there with no change to the tool.
  • Test: test/mcp-search.test.ts has a new test that creates two repositories and archives one through setArchived. It searches for their shared name over MCP and on /search, and checks that the archived one has archived: true and the badge and the other has archived: false and no badge.
  • Changed tests: I updated the expectations in test/search.test.ts and test/search-cache.test.ts. The code-hit shape gained a field, and the cache test's repository fixtures needed archivedAt: null.
  • Left out: the badge does not appear on origin (mirrored) repository hits or on issue hits. Neither has an archived state in the data today. Code hits carry only the flag and badge, with no extra styling.

To try it, archive a repository as an admin and search for its name.

Closes #6084

commented

A repository hit or a code hit from an archived repository now shows a secondary Archived badge on the search page, and MCP search rows carry archived: true|false. The related tests pass and bun scripts/design-lint.ts passes. I couldn't run tsc --noEmit here because it can't find the bun type definitions, so the type check is left to the forge's check.

  • Page: src/web/pages/search.ts has a new archivedBadge that sits next to privateBadge on repository rows and is added to code-hit rows. It uses the same badge component, secondary variant. The repo has no archive icon, so the badge is text only.
  • Data: in src/core/search.ts, local repository hits and code hits now carry archived, set from the repository's archivedAt. The MCP tool returns these rows as they are, so the flag shows up there with no change to the tool.
  • Test: test/mcp-search.test.ts has a new test that creates two repositories and archives one through setArchived. It searches for their shared name over MCP and on /search, and checks that the archived one has archived: true and the badge and the other has archived: false and no badge.
  • Changed tests: I updated the expectations in test/search.test.ts and test/search-cache.test.ts. The code-hit shape gained a field, and the cache test's repository fixtures needed archivedAt: null.
  • Left out: the badge does not appear on origin (mirrored) repository hits or on issue hits. Neither has an archived state in the data today. Code hits carry only the flag and badge, with no extra styling.

To try it, archive a repository as an admin and search for its name.

commented

A search hit from an archived repository now shows a secondary Archived badge, and MCP search rows carry archived: true|false. The review left no comment text, so I checked the branch myself and fixed what I found. The search, search-cache and MCP-search tests pass, and bun x tsc --noEmit now runs clean. I didn't run bun scripts/design-lint.ts this round; I didn't change any src/web/ code.

  • Page: src/web/pages/search.ts adds an archivedBadge next to privateBadge on repository rows and on code-hit rows, using the existing badge component with no archive icon.
  • Data: in src/core/search.ts, local repository hits and code hits carry archived, set from the repository's archivedAt. The MCP tool returns these rows unchanged, so the flag shows up there with no tool change.
  • Test: test/mcp-search.test.ts archives one of two same-named repositories and checks both MCP and /search: archived: true and the badge on the archived one, archived: false and no badge on the other.
  • This round:

- The branch was behind main, so I merged main in. - tsc now runs here, and it flagged a type error: the Results type in test/search.test.ts didn't know a code hit has archived. I added it. That type was wrong, not the expectation.

  • Left out: origin (mirrored) repository hits and issue hits get no badge, since neither has an archived state in the data today.

To try it, archive a repository as an admin and search for its name.

Closes #6084

🤖 Generated with Claude Code

Changes requested — before the latest push

The repo-row badge and the MCP archived flag work and are tested. The code-hit half is not tested, and the list needs a test for every behaviour added.

Fix first: the new test is titled "for repos and code" but only searches kind=repos. Nothing fails if archived on CodeHit is always false, or if the badge in codeHitRow is removed. Add a code case. Push a file containing a needle to one repo, archive it, then search kind=code on /search and over MCP. Assert archived: true and the badge on that hit, and archived: false and no badge on a live repo's hit. In test/search.test.ts, the existing code-hit expectation only pins archived: false.

Smaller point: the badge on a code row is placed in a separate row-trail after row-main. Check at 360px that a long path plus the badge doesn't squeeze the title. row-trail is flex: none, so the path should truncate rather than the badge. Say in the pull that you looked.

No tty search door exists in this tree, so there is no terminal parity to add. Page markup, badge use and JS-off behaviour are fine.

commented

The code-hit half of the Archived mark now has a test that fails without it. I haven't looked at the row at 360px; I only read the CSS.

  • Test: the test in test/mcp-search.test.ts now pushes a file containing quixotic to an archived repo (shelved) and a live one (shelvedlive). It then searches kind=code over MCP and on /search. The archived hit has archived: true and the badge; the live hit has archived: false and no badge.
  • Checked by breaking it: with the badge removed from codeHitRow, the test fails. With the archived flag forced to false in CodeHit, it also fails. Both were reverted.
  • 360px: I couldn't screenshot here, so this comes from reading the CSS. .row-trail is flex: none, .row-main has min-width: 0, and .row-title has overflow: hidden; text-overflow: ellipsis; white-space: nowrap. A long path should therefore truncate with an ellipsis while the badge keeps its width. Please confirm it on the preview at 360px.
  • Disagreement: I didn't add an archived: true case to test/search.test.ts. The new MCP test covers the same core code hit, and that file still pins archived: false.
  • Type check: bun x tsc --noEmit is clean.

Closes #6084

🤖 Generated with Claude Code

Approved

Archived flag comes from archivedAt on local repo hits and code hits; the page uses the existing secondary badge (text only, a link, works with JS off), MCP rows carry archived. The test archives one of two repos and fails if either the data flag or the code-row badge is removed. No terminal search exists, so there is no tty parity gap. Next: (1) look at a long-path code hit at 360px, since the badge is in row-trail (flex:none) and the title should truncate, but that was read from CSS, not seen; (2) give origin (mirrored) and issue hits an archived state if the data ever gets one, so the badge is consistent across kinds.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs