From 96e95ab9e44d2234ab036319836a5087eb4c2a2f Mon Sep 17 00:00:00 2001 From: Eugene Blikh Date: Mon, 4 May 2026 10:29:46 +0300 Subject: [PATCH] fix: add tool column to search table; remove conversation bleed from comments --- internal/server/web/dist/index.html | 4 ++-- web/src/features/search/SearchTable.tsx | 6 ++++-- web/src/features/search/highlightSnippet.ts | 5 +---- web/src/features/search/useSearch.ts | 2 -- web/src/styles/search.css | 4 ++-- 5 files changed, 9 insertions(+), 12 deletions(-) diff --git a/internal/server/web/dist/index.html b/internal/server/web/dist/index.html index 845a5c6c6a85828a601188371a9a83695d295492..3a0adf3c27f25360f3946c9da930a6eba7de0e3a 100644 --- a/internal/server/web/dist/index.html +++ b/internal/server/web/dist/index.html @@ -13,8 +13,8 @@ href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500;700&display=swap" rel="stylesheet" /> - - + +
diff --git a/web/src/features/search/SearchTable.tsx b/web/src/features/search/SearchTable.tsx index b9fcc6777fc811b6f40cf4542d8b7098b6bb9d99..d02d0d9d845cec39ee70ae7808bf201f4bb9a158 100644 --- a/web/src/features/search/SearchTable.tsx +++ b/web/src/features/search/SearchTable.tsx @@ -1,6 +1,6 @@ import React from 'react' import { useNavigate } from '@tanstack/react-router' -import { EmptyState } from '../../primitives' +import { EmptyState, ToolDot } from '../../primitives' import type { SearchRow } from '../../api/adapters' import { highlightSnippet } from './highlightSnippet' @@ -11,7 +11,7 @@ interface SearchTableProps { onLoadMore: () => void } -const COLS = '1fr 1fr 2fr 60px' +const COLS = '80px 1fr 1fr 2fr 60px' export function SearchTable({ rows, hasMore, loadingMore, onLoadMore }: SearchTableProps): React.JSX.Element { const navigate = useNavigate() @@ -27,6 +27,7 @@ export function SearchTable({ rows, hasMore, loadingMore, onLoadMore }: SearchTa return (
+ tool host cwd snippet @@ -45,6 +46,7 @@ export function SearchTable({ rows, hasMore, loadingMore, onLoadMore }: SearchTa }) }} > + {r.tool} {r.host} {r.cwd} {highlightSnippet(r.snippet)} diff --git a/web/src/features/search/highlightSnippet.ts b/web/src/features/search/highlightSnippet.ts index 95418f13938c35a592411cb2ff11e004fd9cdf34..a5555233d62e236705bc9e4c5574a34dd46399fc 100644 --- a/web/src/features/search/highlightSnippet.ts +++ b/web/src/features/search/highlightSnippet.ts @@ -4,10 +4,7 @@ const MARKER_RUNES = /\x02|\x03/g /** * Splits a snippet string on \x02/\x03 marker runes and interleaves plain text - * with `` elements for matched segments. - * - * Respects IV2 — no dangerouslySetInnerHTML, marker-rune split with React text - * nodes only, safe against XSS. + * with `` elements for matched segments — safe against XSS. */ export function highlightSnippet(snippet: string): (string | React.JSX.Element)[] { const parts = snippet.split(MARKER_RUNES) diff --git a/web/src/features/search/useSearch.ts b/web/src/features/search/useSearch.ts index e7df17c102efb395a5e223419807addf161e671a..defda90ba2c395023e9d09b3cd13c704c354d77a 100644 --- a/web/src/features/search/useSearch.ts +++ b/web/src/features/search/useSearch.ts @@ -36,8 +36,6 @@ interface UseSearchReturn { * - Query key includes filters so changing any filter triggers a fresh fetch. * - Empty `q` short-circuits to an empty result set without issuing a request. * - Cursor pagination appends results (never replaces) when fetchNextPage is called. - * - * Respects: IV3 (cursor pagination), AS1 (cursor pagination is stable). */ export function useSearch(filters: SearchFilters, enabled: boolean): UseSearchReturn { const query = useInfiniteQuery({ diff --git a/web/src/styles/search.css b/web/src/styles/search.css index 354f95fb4bf348ee077d9f0f1d122c8bd82b4005..ea75d32180964117453752cefd13f8b3a0e79e97 100644 --- a/web/src/styles/search.css +++ b/web/src/styles/search.css @@ -37,9 +37,9 @@ background: var(--paper-2); } -/* Column grid: HOST · CWD · SNIPPET · RANK */ +/* Column grid: TOOL · HOST · CWD · SNIPPET · RANK */ .search-cols { - grid-template-columns: 1fr 1fr 2fr 60px; + grid-template-columns: 80px 1fr 1fr 2fr 60px; } /* ─── Snippet with highlights ─── */