feat: ricerca globale documento + sistema evidenziazioni unificato (#140)#196
Merged
Conversation
) - Nuovo tab Cerca in InsightsDrawer: ricerca full-text su source, traduzione e audit di tutti i chunk con debounce 250ms, snippet con match evidenziato, badge per tipo di match (source/translation/audit), virtualizer per risultati - Highlights unificati: useGlossaryHighlight accetta searchQuery opzionale, tutti i tipi di span (glossario + search) passano per un unico buildHtml pass - Master toggle Highlighter nella barra navigazione chunk (DocumentView) - Colori highlight configurabili per tipo in Impostazioni → Evidenziazioni con color picker che preserva il canale alpha - CSS custom properties per tutti i colori highlight, aggiornate reattivamente da HighlightColorSync in App.tsx - Rimosso glossaryHighlightEnabled (sostituito da highlightsEnabled globale) - Aggiornati ARCHITECTURE.md, help utente (it+en), i18n completo
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a global, full-text “Search” experience for documents inside the Insights drawer and unifies all in-text highlighting (glossary + search) behind a single global toggle and a single HTML-building pass. It also introduces configurable highlight colors (synced via CSS custom properties) and updates docs/i18n accordingly.
Changes:
- Added a new Search tab in
InsightsDrawerwith debounced full-text search across chunk source/translation/audit and virtualized results. - Reworked highlighting into a single global highlighter system (
highlightsEnabled, unifiedbuildHtmlpass) with runtime-configurable colors stored in UI prefs and synced to CSS variables. - Moved the master highlight toggle into
DocumentViewchunk navigation and updated help/docs/i18n.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/stores/uiStore.ts | Introduces global highlights state, highlight colors, and search query; persists highlight prefs. |
| src/index.css | Adds CSS custom properties for highlight tokens and a new hl-search style. |
| src/i18n/it.json | Adds/updates strings for search + highlight settings and revises settings title/help text. |
| src/i18n/en.json | Adds/updates strings for search + highlight settings and revises settings title/help text. |
| src/hooks/useGlossaryHighlight.ts | Unifies glossary + search spans into one HTML build pass. |
| src/components/settings/SettingsModal.tsx | Adds highlight color pickers and splits modal into Provider/Settings tabs. |
| src/components/pipeline/ProductionStream.tsx | Switches to the new global highlightsEnabled toggle. |
| src/components/help/HelpGuide.tsx | Documents the new document search feature in the help guide. |
| src/components/document/SearchTab.tsx | New virtualized document search UI and result rendering. |
| src/components/document/InsightsDrawer.tsx | Adds the Search tab and removes glossary-tab-local highlight toggle. |
| src/components/document/DocumentView.tsx | Adds master highlighter toggle; wires searchQuery into highlighting. |
| src/components/audit/AuditPanel.test.tsx | Updates test store state to use highlightsEnabled. |
| src/App.tsx | Injects highlight color CSS variables reactively via HighlightColorSync. |
| docs/ARCHITECTURE.md | Updates architecture notes for new UI store fields and persistence behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…rabile
- Aggiunge hl-audit (sfondo arancio) nel pannello traduzione quando si preme il mirino su un issue audit
- Il pulsante mirino in InsightsDrawer diventa rosso quando attivo e si togola al secondo click
- Colore hl-audit configurabile da Impostazioni → Evidenziazioni ("Frase audit")
- Algoritmo interval-breakpoint: hl-audit coesiste con hl-source-term (sottolineatura) e altri highlight
- Rimuove la selezione nativa azzurra del browser (setSelectionRange) — lo scroll è mantenuto
- Aggiunge hl-audit alla priorità 3 nel sistema BG_CLASSES
- Migration Zustand v2 per aggiungere auditPhrase a highlightColors in stato persistito
- Icona rossa sezione "prompt" in StageCard (coerente con design system pipeline)
- Test copertura: overlay coesistenza underline+background, priorità bg class
- Aggiunge common.clear (Cancella/Clear) nei file i18n - Localizza etichetta tab "Provider" via settings.providerTab - Aggiunge aria-pressed ai tab buttons e a NavSelector (+ role="group") - NavSelector riceve ariaLabel prop per semantica gruppo - uiStore migrate: gestisce fromVersion < 1 copiando glossaryHighlightEnabled → highlightsEnabled - buildHtml omette title quando tooltip è vuoto (già gestito dal ternario)
- uiStore: migrate v2 fa merge completo di tutti i default highlightColors - buildHtml: pre-separa bg/deco span fuori dal loop (evita re-sort per segmento) - SearchTab: aggiunge title al clear button; snippet text-[11px] → text-xs - SettingsModal: model description text-[11px] → text-xs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
useGlossaryHighlightaccettasearchQueryopzionale; tutti i tipi di span (glossario + ricerca) passano per un unicobuildHtmlpass senza conflitti HTML.HighlightColorSyncin App.tsx.glossaryHighlightEnabled→ sostituito dahighlightsEnabledglobale.Test plan
npm run lintenpm testgreen (346 test pass, 0 errori TS)Closes #140