Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
feat: disable a noisy editorial check in-situ from the findings triage (#1602)
[._.]/ Adam Eivy2d8b6f3c8400
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 5cfb47bf41..ed3e381366 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -57,6 +57,8 @@## Editorial checks+- **[issue-1602] You can now mute a noisy check straight from the findings triage — no round-trip to the catalog.** When a check is generating false-positive spam, silencing it used to mean leaving the triage view, scrolling the catalog to find the check, toggling it off, and coming back. Each finding group now carries a **Disable** action: one click turns the check off (so it's skipped on future runs) and immediately hides its findings group, with an **undo** toast if you change your mind. It's only offered for currently-enabled checks (an already-disabled check has nothing to mute), and disabling never deletes existing findings — it's a sync-safe enabled-flag flip, so re-enabling (via undo, or from the catalog) brings the group back. A hidden group's findings also drop out of the bulk-action selection so nothing gets accepted/dismissed unseen, and the count line + empty-state copy reflect the muted groups. (`client/src/components/pipeline/editorial/EditorialFindingsTriage.jsx`, `client/src/pages/PipelineEditorialChecks.jsx`)+- **[issue-1601] Opening an editorial finding now scrolls the manuscript to the flagged passage and flashes it, instead of leaving you to hunt for the text.** A finding anchors to manuscript text by a verbatim quote, but opening it (from the findings triage deep-link, the sidebar index, a pin chip, or stepping prev/next through a triage pass) only ever scrolled the note *card* into view — the offending words themselves weren't called out, so on a long scene you still re-read paragraphs to find what the note was about. The editor now scrolls the anchored text to center and plays a brief tint **flash** over the exact words on open and on every prev/next step, in both view modes: **Review** mode reveals + flashes the highlighted span, and **Live** mode reveals + flashes the underlined text (and keeps it tinted while its card stays open). When the anchor quote isn't found verbatim in the current draft (the section was edited since the review), it falls back gracefully to the previous behavior of scrolling the note card into view — no jump, no flash. The scroll-and-flash is a small reusable hook (`useAnchorReveal`) and honors `prefers-reduced-motion`. (`client/src/hooks/useAnchorReveal.js`, `client/src/components/pipeline/manuscript/ManuscriptHighlightedProse.jsx`, `client/src/components/pipeline/manuscript/ManuscriptLiveSection.jsx`, `client/src/components/pipeline/manuscript/AnnotatedManuscriptSection.jsx`, `client/src/index.css`)- **[issue-1600] The findings triage list now has filter, search, and sort controls so a large batch can be triaged strategically instead of scrolling a flat list.** Past ~50 findings the per-check list grew unwieldy with no way to focus on, say, just the high-severity open findings from one problematic check. A new toolbar above the list filters by **severity**, **status** (open / accepted / dismissed), **category** (check scope), **check**, and **issue**, plus a free-text **search** over each finding's problem/location and a **sort** order (scope & check, severity, issue, or status — sorting both the findings within each group and the groups themselves). The toolbar only ever offers facets that actually exist in the current findings (a single-value facet is hidden), each surviving group's open/total + severity counts are recomputed so the headers never lie about what's shown, and an empty result shows a clear-filters affordance. Every selection persists in the page URL query (`?fsev=`, `?fstatus=`, `?fscope=`, `?fcheck=`, `?fissue=`, `?fq=`, `?fsort=`), so a filtered view — "high-severity open findings on Issue 5, sorted by severity" — is deep-linkable per the repo's linkable-routes convention. The filter/sort logic lives in pure, unit-tested helpers (`deriveFindingFacets` / `applyFindingsView` in `editorialChecks.js`). (`client/src/components/pipeline/editorial/EditorialFindingsTriage.jsx`, `client/src/lib/editorialChecks.js`)diff --git a/client/src/components/pipeline/editorial/EditorialFindingsTriage.jsx b/client/src/components/pipeline/editorial/EditorialFindingsTriage.jsxindex fc6ec18fa5..970b8690f5 100644--- a/client/src/components/pipeline/editorial/EditorialFindingsTriage.jsx+++ b/client/src/components/pipeline/editorial/EditorialFindingsTriage.jsx@@ -15,7 +15,7 @@* bulk-dismisses the selection — each result reactively updates local state.*/import { Link, useSearchParams } from 'react-router-dom';-import { ChevronDown, ChevronRight, ExternalLink, History, Check, X, Loader2, GitCompareArrows, Search } from 'lucide-react';+import { ChevronDown, ChevronRight, ExternalLink, History, Check, X, Loader2, GitCompareArrows, Search, Ban, Undo2 } from 'lucide-react';import { useEffect, useMemo, useRef, useState } from 'react';import {groupFindingsByCheck,@@ -239,7 +239,7 @@ function FindingRow({ seriesId, comment, onCommentChange, selected, onToggleSele// default collapse derives from `group.open > 0`, so a status/search filter that// matches only resolved findings (open === 0) would otherwise hide its matches// behind a collapsed header and make the filtered view look empty.-function CheckGroup({ seriesId, group, onCommentChange, selectedIds, onToggleSelect, onSelectMany, forceOpen = false }) {+function CheckGroup({ seriesId, group, onCommentChange, selectedIds, onToggleSelect, onSelectMany, forceOpen = false, canDisable = false, onDisableCheck }) {const [open, setOpen] = useState(group.open > 0);const expanded = forceOpen || open;const openIds = useMemo(@@ -276,6 +276,21 @@ function CheckGroup({ seriesId, group, onCommentChange, selectedIds, onToggleSel<CountPills counts={group.counts} /></span></button>+ {canDisable && onDisableCheck ? (+ // Mute a noisy/false-positive check without leaving the triage view+ // (#1602): disables it (skipped on future runs) and hides its findings+ // group here, with an undo toast. Only offered for currently-enabled+ // checks — an already-disabled check has nothing to mute.+ <button+ type="button"+ onClick={() => onDisableCheck(group.checkId, group.label)}+ title="Disable this check — hides its findings here and skips it on future runs"+ aria-label={`Disable check: ${group.label}`}+ className="inline-flex shrink-0 items-center gap-1 rounded border border-port-border px-1.5 py-0.5 text-[10px] text-gray-500 hover:border-rose-400/40 hover:text-rose-300"+ >+ <Ban size={11} /> Disable+ </button>+ ) : null}</div>{expanded ? (<ul className="divide-y divide-port-border/60 border-t border-port-border/60">@@ -498,10 +513,42 @@ function FindingsToolbar({ facets, filters, sort, setParam, toggleInParam, onCle);}-export default function EditorialFindingsTriage({ seriesId, comments = [], checksById = {}, onCommentChange }) {+export default function EditorialFindingsTriage({ seriesId, comments = [], checksById = {}, onCommentChange, onToggleCheckEnabled }) {const groups = useMemo(() => groupFindingsByCheck(comments, checksById), [comments, checksById]);const [selectedIds, setSelectedIds] = useState(() => new Set());+ // Checks the user muted from this view this session (#1602). Disabling a check+ // doesn't delete its persisted findings, so the group is hidden locally until an+ // undo (or a fresh findings load) brings it back. Keyed by checkId.+ const [hiddenCheckIds, setHiddenCheckIds] = useState(() => new Set());+ const unhideCheck = (checkId) => setHiddenCheckIds((s) => {+ if (!s.has(checkId)) return s;+ const next = new Set(s);+ next.delete(checkId);+ return next;+ });+ const disableCheck = (checkId, label) => {+ setHiddenCheckIds((s) => new Set(s).add(checkId));+ const toastId = toast((t) => (+ <span className="flex items-center gap-3 text-xs">+ <span className="text-gray-200">Disabled <span className="font-medium text-white">{label}</span> — findings hidden</span>+ <button+ type="button"+ onClick={() => { unhideCheck(checkId); onToggleCheckEnabled?.(checkId, true); toast.dismiss(t.id); }}+ className="inline-flex shrink-0 items-center gap-1 rounded border border-port-border px-2 py-0.5 text-[11px] text-port-accent hover:border-port-accent/40 hover:text-white"+ >+ <Undo2 size={12} /> Undo+ </button>+ </span>+ ), { duration: 8000 });+ // Optimistic hide above; reconcile if the persist fails (onToggleCheckEnabled+ // resolves false on error and has already reverted + toasted) so a failed+ // disable doesn't leave the group stuck hidden behind a dead undo toast.+ Promise.resolve(onToggleCheckEnabled?.(checkId, false)).then((ok) => {+ if (ok === false) { unhideCheck(checkId); toast.dismiss(toastId); }+ });+ };+// ---- Filter / search / sort, persisted in the URL so a view is deep-linkable// (#1600). Facets are derived from the full (unfiltered) groups so options never// vanish as you narrow; the toolbar only ever offers facets that exist. ----@@ -542,6 +589,13 @@ export default function EditorialFindingsTriage({ seriesId, comments = [], check}, { replace: true });const view = useMemo(() => applyFindingsView(groups, filters, sort), [groups, filters, sort]);+ // Drop groups the user muted this session (#1602) so the disabled check's noise+ // disappears immediately; everything downstream (selection, counts, render) keys+ // off this so a hidden group can't be bulk-acted on either.+ const visibleView = useMemo(+ () => (hiddenCheckIds.size ? view.filter((g) => !hiddenCheckIds.has(g.checkId)) : view),+ [view, hiddenCheckIds],+ );// Selection only ever holds open findings — once a finding is accepted/dismissed// (here or in the editor) drop it so the bar's counts never count resolved ones.@@ -575,8 +629,8 @@ export default function EditorialFindingsTriage({ seriesId, comments = [], check// be silently accepted/dismissed by the sticky bar. Selection state itself is// preserved (clearing the filter brings hidden selections back).const selectedComments = useMemo(- () => view.flatMap((g) => g.comments).filter((c) => isOpenFinding(c) && selectedIds.has(c.id)),- [view, selectedIds],+ () => visibleView.flatMap((g) => g.comments).filter((c) => isOpenFinding(c) && selectedIds.has(c.id)),+ [visibleView, selectedIds],);if (!groups.length) {@@ -587,7 +641,7 @@ export default function EditorialFindingsTriage({ seriesId, comments = [], check);}const totalOpen = openFindingsTotal(groups);- const shownOpen = openFindingsTotal(view);+ const shownOpen = openFindingsTotal(visibleView);return (<div className="space-y-2"><FindingsToolbar@@ -608,22 +662,28 @@ export default function EditorialFindingsTriage({ seriesId, comments = [], check/>) : (<p className="text-[11px] text-gray-500">- {activeFilterCount > 0- ? `${shownOpen} of ${totalOpen} open finding${totalOpen === 1 ? '' : 's'} shown · ${view.length} of ${groups.length} check${groups.length === 1 ? '' : 's'}`+ {activeFilterCount > 0 || hiddenCheckIds.size > 0+ ? `${shownOpen} of ${totalOpen} open finding${totalOpen === 1 ? '' : 's'} shown · ${visibleView.length} of ${groups.length} check${groups.length === 1 ? '' : 's'}`: `${totalOpen} open finding${totalOpen === 1 ? '' : 's'} across ${groups.length} check${groups.length === 1 ? '' : 's'}`}</p>)}- {view.length === 0 ? (+ {visibleView.length === 0 ? (<p className="rounded-lg border border-dashed border-port-border p-4 text-center text-xs text-gray-500">- No findings match the current filters. <button type="button" onClick={clearFilters} className="text-port-accent hover:underline">Clear filters</button>.+ {activeFilterCount > 0 ? (+ <>No findings match the current filters. <button type="button" onClick={clearFilters} className="text-port-accent hover:underline">Clear filters</button>.</>+ ) : (+ 'Every check with findings is disabled. Re-enable a check from the catalog to triage its findings.'+ )}</p>) : null}- {view.map((g) => (+ {visibleView.map((g) => (<CheckGroupkey={g.checkId}seriesId={seriesId}group={g}onCommentChange={onCommentChange}+ canDisable={onToggleCheckEnabled ? checksById[g.checkId]?.enabled === true : false}+ onDisableCheck={onToggleCheckEnabled ? disableCheck : undefined}selectedIds={selectedIds}onToggleSelect={toggleSelect}onSelectMany={selectMany}diff --git a/client/src/components/pipeline/editorial/EditorialFindingsTriage.test.jsx b/client/src/components/pipeline/editorial/EditorialFindingsTriage.test.jsxindex 091236d0f9..f057b2ca64 100644--- a/client/src/components/pipeline/editorial/EditorialFindingsTriage.test.jsx+++ b/client/src/components/pipeline/editorial/EditorialFindingsTriage.test.jsx@@ -2,6 +2,7 @@ import { describe, it, expect, vi, beforeEach } from 'vitest';import { render, screen, fireEvent, waitFor } from '@testing-library/react';import { MemoryRouter } from 'react-router-dom';import EditorialFindingsTriage from './EditorialFindingsTriage';+import { Toaster, toast } from '../../ui/Toast';import { findingManuscriptLink } from '../../../lib/editorialChecks';import { acceptPipelineManuscriptFix, patchPipelineManuscriptComment } from '../../../services/api';@@ -27,6 +28,7 @@ describe('EditorialFindingsTriage', () => {beforeEach(() => {acceptPipelineManuscriptFix.mockReset();patchPipelineManuscriptComment.mockReset();+ toast.dismiss(); // clear any toast left over from a prior test});it('shows the empty state when there are no check-sourced findings', () => {@@ -263,4 +265,72 @@ describe('EditorialFindingsTriage', () => {fireEvent.change(screen.getByLabelText('Search findings'), { target: { value: 'confusable' } });expect(screen.getByText('1 selected')).toBeTruthy();});++ // ---- Disable a noisy check in-situ (#1602) ----+ const enabledChecksById = {+ 'naming.dissimilar-names': { label: 'Character name dissimilarity', scope: 'series', kind: 'deterministic', enabled: true },+ };+ const renderDisable = (props) => render(+ <MemoryRouter>+ <EditorialFindingsTriage seriesId="ser-1" checksById={enabledChecksById} {...props} />+ <Toaster />+ </MemoryRouter>,+ );++ it('offers a Disable action only when onToggleCheckEnabled is wired and the check is enabled (#1602)', () => {+ const comments = [{ id: 'c1', checkId: 'naming.dissimilar-names', status: 'open', severity: 'high', problem: 'Noisy' }];+ // No handler → no disable affordance (read-only triage).+ renderTriage({ comments });+ expect(screen.queryByRole('button', { name: /Disable check:/i })).toBeNull();+ });++ it('does NOT offer Disable for an already-disabled check (#1602)', () => {+ const comments = [{ id: 'c1', checkId: 'naming.dissimilar-names', status: 'open', severity: 'high', problem: 'Noisy' }];+ renderDisable({+ comments,+ checksById: { 'naming.dissimilar-names': { label: 'Character name dissimilarity', scope: 'series', enabled: false } },+ onToggleCheckEnabled: vi.fn(),+ });+ expect(screen.queryByRole('button', { name: /Disable check:/i })).toBeNull();+ });++ it('disables a check in-situ, hides its findings group, and disables it server-side (#1602)', () => {+ const onToggleCheckEnabled = vi.fn().mockResolvedValue(true);+ const comments = [{ id: 'c1', checkId: 'naming.dissimilar-names', status: 'open', severity: 'high', problem: 'Noisy finding' }];+ renderDisable({ comments, onToggleCheckEnabled });++ expect(screen.getByText('Noisy finding')).toBeTruthy();+ fireEvent.click(screen.getByRole('button', { name: /Disable check: Character name dissimilarity/i }));++ // PATCHes the check off + the group's findings vanish from the view.+ expect(onToggleCheckEnabled).toHaveBeenCalledWith('naming.dissimilar-names', false);+ expect(screen.queryByText('Noisy finding')).toBeNull();+ // Empty-state copy points the user back to the catalog to re-enable.+ expect(screen.getByText(/Every check with findings is disabled/i)).toBeTruthy();+ });++ it('restores the hidden group and re-enables the check via the undo toast (#1602)', async () => {+ const onToggleCheckEnabled = vi.fn().mockResolvedValue(true);+ const comments = [{ id: 'c1', checkId: 'naming.dissimilar-names', status: 'open', severity: 'high', problem: 'Noisy finding' }];+ renderDisable({ comments, onToggleCheckEnabled });++ fireEvent.click(screen.getByRole('button', { name: /Disable check: Character name dissimilarity/i }));+ expect(screen.queryByText('Noisy finding')).toBeNull();++ // The undo toast re-enables the check and brings the group back.+ fireEvent.click(await screen.findByRole('button', { name: /undo/i }));+ expect(onToggleCheckEnabled).toHaveBeenCalledWith('naming.dissimilar-names', true);+ expect(screen.getByText('Noisy finding')).toBeTruthy();+ });++ it('un-hides the group when the disable PATCH fails (#1602)', async () => {+ // onToggleCheckEnabled resolves false on failure (the page reverts + toasts).+ const onToggleCheckEnabled = vi.fn().mockResolvedValue(false);+ const comments = [{ id: 'c1', checkId: 'naming.dissimilar-names', status: 'open', severity: 'high', problem: 'Noisy finding' }];+ renderDisable({ comments, onToggleCheckEnabled });++ fireEvent.click(screen.getByRole('button', { name: /Disable check: Character name dissimilarity/i }));+ // Optimistically hidden, then reconciled back once the PATCH rejects.+ await waitFor(() => expect(screen.getByText('Noisy finding')).toBeTruthy());+ });});diff --git a/client/src/pages/PipelineEditorialChecks.jsx b/client/src/pages/PipelineEditorialChecks.jsxindex c700ef1104..a2609a01b3 100644--- a/client/src/pages/PipelineEditorialChecks.jsx+++ b/client/src/pages/PipelineEditorialChecks.jsx@@ -201,9 +201,12 @@ export default function PipelineEditorialChecks() {// settings, so the run buttons must gate on this PATCH landing (and the card// shows its saving spinner for the toggle too).setSavingIds((s) => new Set(s).add(checkId));- patchEditorialCheck(checkId, { enabled: nextEnabled }, { silent: true })- .then((row) => { if (row) setChecks((rows) => rows.map((r) => (r.id === checkId ? row : r))); })- .catch((err) => { apply(!nextEnabled); toast.error(err.message || 'Failed to update check'); })+ // Returns a success boolean so callers that mirror a UI side effect on this+ // toggle (e.g. the triage view hiding a just-disabled check's group, #1602)+ // can reconcile when the PATCH fails — the catch has already reverted here.+ return patchEditorialCheck(checkId, { enabled: nextEnabled }, { silent: true })+ .then((row) => { if (row) setChecks((rows) => rows.map((r) => (r.id === checkId ? row : r))); return true; })+ .catch((err) => { apply(!nextEnabled); toast.error(err.message || 'Failed to update check'); return false; }).finally(() => setSavingIds((s) => { const n = new Set(s); n.delete(checkId); return n; }));}, []);@@ -537,7 +540,7 @@ export default function PipelineEditorialChecks() {{loadingFindings ? (<p className="flex items-center gap-2 text-sm text-gray-400"><Loader2 size={16} className="animate-spin" /> Loading findings…</p>) : (- <EditorialFindingsTriage seriesId={seriesId} comments={comments} checksById={checksById} onCommentChange={handleCommentChange} />+ <EditorialFindingsTriage seriesId={seriesId} comments={comments} checksById={checksById} onCommentChange={handleCommentChange} onToggleCheckEnabled={handleToggle} />)}</>)}