Pulizia pre-2.0: debito legacy scoperto durante l'audit#318
Conversation
highlightSuperscriptMarkersHtml was marked @deprecated but is still actively used for non-markdown imports with superscript footnote markers — the label was wrong, not the function. extractTermFromPhrase suggested the term by naively slicing the first three words. Replaced with the full selected phrase (user trims to the exact term), avoiding a hidden extra LLM call per glossary quick-add.
Both live call sites always passed playFirst=true, making the collapsed-non-playFirst and default (non-collapsed-non-playFirst) branches unreachable — leftovers from the old dashboard sidebar, already deleted as dead code on 2026-07-03 (#294). Collapsed the component to its two actually-reachable render paths and dropped the now-vestigial playFirst/showAuditOnly/onRunAuditOnly props. Updated ARCHITECTURE.md, which still described the dashboard as using the pre-#291 PipelineSidebar/useEdgeResize system.
Every column previously added via ensureColumn() after table creation is now part of the initial CREATE TABLE statement. Most of those ensureColumn calls were already no-ops (the column was already in the CREATE TABLE from a prior consolidation), and the rest — the true incremental migrations — are folded in directly since this is a private, pre-release project with no installed base to preserve compatibility with. The automatic beta-schema-reset-and-backup mechanism already in place handles the one-time migration safely. Bumped CURRENT_SCHEMA_VERSION to trigger that reset once. Emptied the now-unused ALLOWED_MIGRATIONS whitelist (kept the ensureColumn/ validateColumnDefinition machinery for future schema changes).
Test mode's copy promised a discardable preview ("produces a preview,
configuration stays editable") with its own badge, clear/reset
actions, and toasts. In practice nothing wired the Play button to the
dry-run function anymore — a July 3rd fix routed it through the same
real/committing execution path used by Production mode (just limited
to N chunks), leaving the whole preview machinery orphaned: unreachable
function, dead props threaded through three components, unused i18n
strings, a chunk status with no writer.
Decided with the user to keep today's actual behavior (Test mode runs
for real, just fewer chunks — redundant with per-chunk re-run anyway)
and remove the leftover preview concept entirely rather than resurrect
it. A genuine "compare different configs side by side" feature is a
separate, already-tracked backlog idea (#6), not this.
Removed: runDryRun, the 'preview' ChunkStatus/FinalChunkStatus states,
resetPreviewChunks, the preview badge/minimap dot/stats row, and the
dryRun*/clearPreview/resetPreview/chunkPreviewBadge i18n strings (IT+EN).
Updated modeTestHint to describe what Test mode actually does now.
There was a problem hiding this comment.
Pull request overview
Questo PR completa una “pulizia pre-2.0” eliminando residui legacy emersi durante l’audit: rimuove la vecchia semantica di “preview/dry-run” della modalità Test (lasciando l’esecuzione reale su un numero limitato di chunk), consolida lo schema SQLite direttamente nelle CREATE TABLE, e aggiorna UI/test/docs conseguenti.
Changes:
- Rimossa la gestione di chunk
status: 'preview'e tutta la workflow dry-run associata (hook pipeline, store, UI, i18n, test). - Consolidato lo schema DB: colonne precedentemente aggiunte via
ensureColumn()ora sono incluse nelle definizioni iniziali + bumpCURRENT_SCHEMA_VERSION. - Ritocchi di pulizia/documentazione: footnote superscript helper non più marcato deprecated, suggerimento termine glossario restituisce la frase intera, aggiornato
ARCHITECTURE.md.
Reviewed changes
Copilot reviewed 20 out of 21 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils/footnoteExtractor.ts | Aggiorna il commento/contratto della funzione per marker superscript non-markdown. |
| src/types.ts | Rimuove preview da ChunkStatus. |
| src/stores/chunksStore.ts | Elimina resetPreviewChunks e rimuove handling speciale per status === 'preview'. |
| src/stores/chunksStore.test.ts | Aggiorna i test dopo la rimozione del workflow preview. |
| src/services/llmService.ts | extractTermFromPhrase ora propone l’intera frase selezionata (senza AI). |
| src/services/dbService.ts | Consolidamento schema nelle CREATE TABLE, schema version bump, ALLOWED_MIGRATIONS svuotato. |
| src/services/dbService.test.ts | Aggiorna le aspettative dei test su reset/versione e su colonne “baked in”. |
| src/i18n/it.json | Rimuove stringhe UI per preview/dry-run e aggiorna hint modalità Test. |
| src/i18n/en.json | Rimuove stringhe UI per preview/dry-run e aggiorna hint modalità Test. |
| src/hooks/usePipeline.ts | Rimuove runDryRun e la nozione di FinalChunkStatus per run singolo. |
| src/hooks/usePipeline.test.ts | Elimina test per dry-run/finalStatus preview; aggiorna suite. |
| src/hooks/pipeline/blobContext.ts | Rimuove FinalChunkStatus. |
| src/components/layout/shell-next/ProjectRailNext.tsx | Rimuove props/rami legati a dry-run/audit-only legacy. |
| src/components/layout/PipelineSidebarSections/PipelineSidebarRunSection.tsx | Semplifica UI run section, rimuove controlli preview/test-run legacy. |
| src/components/document/tabs/StatsTab.tsx | Rimuove conteggio “preview” dagli stats e aggiorna UI. |
| src/components/document/tabs/IndexTab.tsx | Rimuove icona/stato “preview” nell’indice chunk. |
| src/components/document/ExtractTermDialog.tsx | Rimuove fallback a 3 parole, usa direttamente extractTermFromPhrase. |
| src/components/document/DocumentView.tsx | Rimuove styling/badge “preview” nella vista documento. |
| src/App.tsx | Rimuove wiring onDryRun e logica “preview in test mode” per retraduzione singolo chunk. |
| src-tauri/Cargo.lock | Bump versione pacchetto glossa nel lockfile. |
| docs-dev/ARCHITECTURE.md | Aggiorna descrizione architettura post-migrazione dashboard/shell. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| </IconButton> | ||
| ) : ( | ||
| <IconButton size="md" tone="charcoal" onClick={pipelineMode === 'test' ? onDryRun : onRunPipeline} disabled={isProcessing || !hasDocument} title={`${t('pipeline.beginPipeline')} (Ctrl+↵)`} ariaLabel={t('pipeline.beginPipeline')} tooltipSide="right" className="h-9 w-9 border-editorial-charcoal bg-editorial-charcoal text-white hover:bg-editorial-charcoal/85"> | ||
| <IconButton size="md" tone="charcoal" onClick={onRunPipeline} disabled={!hasDocument} title={t('pipeline.executeAll')} tooltipSide="right" className="h-10 w-10"> |
There was a problem hiding this comment.
Risolto in beaa507: in modalità Test il pulsante ora mostra "Esegui test (N blocchi)" (tooltip + aria-label, IT/EN).
| {workMode === 'all' && hasDocument && ( | ||
| <span className="text-[11px] font-bold tabular-nums tracking-[0.1em] text-editorial-muted"> | ||
| {completedCount}/{pipelineMode === 'test' ? runChunkCount : totalChunks} | ||
| {completedCount}/{totalChunks} | ||
| </span> |
There was a problem hiding this comment.
Risolto in beaa507: il contatore ora usa min(pipelineTestChunkCount, totalChunks) come denominatore in Test mode e conta i completati solo dentro quella finestra.
Separate local schema compatibility from calendar dates.
In Test mode the pipeline only processes the first N chunks, but the run button still said "Run all" and the progress counter compared against the whole document, making a finished test run look stuck. The label now announces the test scope and the counter tracks only the chunks the run will actually touch. Also fix a missing space after && in StatsTab JSX.
Release trigger: PR #318 was squash-merged with a non-conventional title, so release-please considered 0 commits. This empty commit carries the releasable type so 1.1.2 picks up the merged work.
Squash merges use the PR title as the commit subject on main; a non-conventional title makes release-please skip the release bump (happened with #318, missing 1.1.2). Block merge until the title carries a conventional type. Co-authored-by: nikazzio <nikazzio@users.noreply.github.com>
Sommario
Chiude il giro di pulizia pre-2.0 avviato dall'audit legacy di questa sessione (#299 verificato/chiuso, nessun codice necessario).
@deprecatedsbagliata sulla formattazione note a piè pagina in stile superscript (ancora usata per import non-markdown); suggerimento termine glossario ora propone la frase intera invece di un troncamento a 3 parole a caso — nessuna chiamata AI nascosta aggiunta.PipelineSidebarRunSection(residuo della vecchia barra dashboard, già cancellata il 3 luglio in Migrare la dashboard / workspace-home alla shell nuova #294); aggiornatoARCHITECTURE.mdche descriveva ancora il sistema pre-Migrazione shell sinistra (barra/tab/drawer/resize) a base strutturata #291.ensureColumn) sono ora nella definizione iniziale delle tabelle. Bump della versione schema per un reset pulito una tantum (c'è già un backup automatico pre-reset).Test plan
tsc --noEmitpulitonpm run tauri:dev(DB init, nessun errore di schema)