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: stack editorial triage catalog/findings into a single column on mobile (#1611)
[._.]/ Adam Eivy6ab1aa67a387
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex aff9a80d4f..d1776b16e3 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -57,6 +57,8 @@## Editorial checks+- **[issue-1611] The editorial triage page is now usable on a phone — the catalog and findings columns stack with a segmented switch.** The Editorial Checks surface was a fixed two-column `lg:grid-cols-2` layout that shrank both the check catalog and the findings triage to unreadable widths on small screens. Below the `lg` breakpoint the two columns now stack into a single full-width column with a **Catalog / Findings** segmented switch at the top so you read one at a time at full width (defaulting to Findings, the primary mobile task); on `lg+` both columns render side-by-side exactly as before. (`client/src/pages/PipelineEditorialChecks.jsx`)+- **[issue-1610] Manually edit a finding whose suggested fix is wrong or missing — rewrite the anchored span right in the card.** The comment card's diff/apply UI only rendered when a generated `fix` existed, so a finding with no suggestion (or a wrong one) was a dead-end: your only move was to dismiss it and edit the manuscript elsewhere. The card now offers a **Manual edit** affordance (button + `m` shortcut) for any finding that carries an anchor span: it opens an editable replacement seeded with the anchored text, previews the change in the same before/after diff a suggested fix uses, and **Apply edit** splices your replacement in through the exact accept path a generated fix takes — resolving the finding and offering the same one-click Undo. Apply stays disabled until the text actually differs from the span, and the option is hidden for findings with no anchor (nothing to locate). (`client/src/components/pipeline/manuscript/ManuscriptCommentCard.jsx`)- **[issue-1609] Undo an accepted editorial fix — restore the pre-edit manuscript text and re-open the finding.** Accepting a suggested fix rewrote the manuscript with no quick way back: a mistaken acceptance meant hunting the spot and hand-reverting (or digging through the section's version history). Accept now **captures the section's pre-edit text** and offers an undo in two places: an **Undo** button on the success toast right after you accept (the immediate "oops"), and a per-finding **Undo fix** button on the accepted finding in the Editorial Checks triage list. Undo restores the exact pre-edit text and flips the finding back to *open*. The restore is itself a versioned stage write (it lands in the section's history like any edit), and it's guarded: if you kept editing the section after accepting, undo refuses rather than clobber that later work and points you to the version history instead. The snapshot is stored on the finding only while it's accepted (a re-open or dismiss drops it) and is optional + additive, so the synced review document stays backward-compatible with older peers. (`server/services/pipeline/manuscriptFix.js`, `server/services/pipeline/manuscriptReview.js`, `server/routes/pipeline/manuscript.js`, `client/src/services/apiPipeline.js`, `client/src/components/pipeline/manuscript/ManuscriptCommentCard.jsx`, `client/src/components/pipeline/editorial/EditorialFindingsTriage.jsx`)diff --git a/client/src/pages/PipelineEditorialChecks.jsx b/client/src/pages/PipelineEditorialChecks.jsxindex b0b057062e..bff04a2aad 100644--- a/client/src/pages/PipelineEditorialChecks.jsx+++ b/client/src/pages/PipelineEditorialChecks.jsx@@ -45,6 +45,11 @@ export default function PipelineEditorialChecks() {const [loadingCatalog, setLoadingCatalog] = useState(true);const [savingIds, setSavingIds] = useState(() => new Set());const [selectedIds, setSelectedIds] = useState(() => new Set());+ // Below `lg` the catalog + findings columns stack into one; this segmented+ // switch picks which one is visible. Default to triage since that's the+ // page's primary mobile task (#1611). No URL param — it's a breakpoint-only+ // presentation toggle that doesn't exist on desktop.+ const [mobileTab, setMobileTab] = useState('findings');const [series, setSeries] = useState([]);// Per-series editorial-check config overrides (#1591) are saved through the@@ -532,9 +537,32 @@ export default function PipelineEditorialChecks() {{loadingCatalog ? (<p className="flex items-center gap-2 text-sm text-gray-400"><Loader2 size={16} className="animate-spin" /> Loading checks…</p>) : (- <div className="grid gap-6 lg:grid-cols-2">+ <div className="space-y-4">+ {/* Below `lg` the two columns stack — this segmented switch picks which+ one shows. Hidden on `lg+`, where both render side-by-side. */}+ <div className="flex gap-1 rounded-lg border border-port-border p-1 lg:hidden" role="tablist" aria-label="Editorial sections">+ <button+ type="button"+ role="tab"+ aria-selected={mobileTab === 'catalog'}+ onClick={() => setMobileTab('catalog')}+ className={`flex-1 rounded px-3 py-1.5 text-xs font-medium transition-colors ${mobileTab === 'catalog' ? 'bg-port-accent text-white' : 'text-gray-400 hover:text-gray-200'}`}+ >+ Catalog+ </button>+ <button+ type="button"+ role="tab"+ aria-selected={mobileTab === 'findings'}+ onClick={() => setMobileTab('findings')}+ className={`flex-1 rounded px-3 py-1.5 text-xs font-medium transition-colors ${mobileTab === 'findings' ? 'bg-port-accent text-white' : 'text-gray-400 hover:text-gray-200'}`}+ >+ Findings+ </button>+ </div>+ <div className="grid gap-6 lg:grid-cols-2">{/* Catalog */}- <section className="space-y-3">+ <section className={`space-y-3 ${mobileTab === 'catalog' ? '' : 'hidden'} lg:block`}><div className="flex items-center justify-between gap-2"><h2 className="text-sm font-semibold uppercase tracking-wide text-gray-400">Catalog</h2>{!formOpen ? (@@ -602,7 +630,7 @@ export default function PipelineEditorialChecks() {</section>{/* Findings */}- <section className="space-y-3">+ <section className={`space-y-3 ${mobileTab === 'findings' ? '' : 'hidden'} lg:block`}><h2 className="text-sm font-semibold uppercase tracking-wide text-gray-400">Findings</h2>{!seriesId ? (<p className="rounded-lg border border-dashed border-port-border p-4 text-center text-xs text-gray-500">Select a series to view its findings.</p>@@ -617,6 +645,7 @@ export default function PipelineEditorialChecks() {</>)}</section>+ </div></div>)}</div>diff --git a/client/src/pages/PipelineEditorialChecks.responsive.test.jsx b/client/src/pages/PipelineEditorialChecks.responsive.test.jsxnew file mode 100644index 0000000000..b11acdb30a--- /dev/null+++ b/client/src/pages/PipelineEditorialChecks.responsive.test.jsx@@ -0,0 +1,102 @@+import { describe, it, expect, vi, beforeEach } from 'vitest';+import { render, screen, fireEvent, waitFor } from '@testing-library/react';+import { MemoryRouter } from 'react-router-dom';+import PipelineEditorialChecks from './PipelineEditorialChecks';++// The catalog loads global checks; findings load per-series. Resolve both with+// minimal data so the page renders the two-column body (#1611 responsive switch).+const getEditorialChecks = vi.fn();+const listPipelineSeries = vi.fn();+const getPipelineManuscriptReview = vi.fn();++vi.mock('../services/api', () => ({+ listPipelineSeries: (...a) => listPipelineSeries(...a),+ updatePipelineSeries: vi.fn(),+ getEditorialChecks: (...a) => getEditorialChecks(...a),+ patchEditorialCheck: vi.fn(),+ createEditorialCustomCheck: vi.fn(),+ updateEditorialCustomCheck: vi.fn(),+ deleteEditorialCustomCheck: vi.fn(),+ previewEditorialCustomCheck: vi.fn(),+ startEditorialChecksRun: vi.fn(),+ cancelEditorialChecksRun: vi.fn(),+ getEditorialChecksRunStatus: vi.fn(),+ editorialChecksRunSseUrl: () => '',+ getPipelineManuscriptReview: (...a) => getPipelineManuscriptReview(...a),+}));++vi.mock('../hooks/usePipelineProgress', () => ({+ usePipelineProgress: () => ({ latest: null, closed: true }),+}));++vi.mock('../hooks/useProviderModels', () => ({+ default: () => ({+ providers: [],+ selectedProviderId: '',+ selectedModel: '',+ availableModels: [],+ setSelectedProviderId: vi.fn(),+ setSelectedModel: vi.fn(),+ }),+}));++// Child surfaces are exercised in their own suites; stub them to keep this test+// focused on the column-stacking switch.+vi.mock('../components/pipeline/editorial/EditorialCheckCard', () => ({ default: () => <div>check-card</div> }));+vi.mock('../components/pipeline/editorial/EditorialCustomCheckForm', () => ({ default: () => <div>custom-form</div> }));+vi.mock('../components/pipeline/editorial/EditorialFindingsTriage', () => ({ default: () => <div>findings-triage</div> }));+vi.mock('../components/pipeline/editorial/EditorialHealthPanel', () => ({ default: () => <div>health-panel</div> }));+vi.mock('../components/ProviderModelSelector', () => ({ default: () => <div>provider-selector</div> }));+vi.mock('../components/ui/Toast', () => ({ default: { success: vi.fn(), error: vi.fn() } }));++function renderPage() {+ return render(+ <MemoryRouter initialEntries={['/pipeline/editorial-checks']}>+ <PipelineEditorialChecks />+ </MemoryRouter>,+ );+}++describe('PipelineEditorialChecks responsive switch (#1611)', () => {+ beforeEach(() => {+ vi.clearAllMocks();+ getEditorialChecks.mockResolvedValue({ checks: [] });+ listPipelineSeries.mockResolvedValue({ series: [] });+ getPipelineManuscriptReview.mockResolvedValue({ comments: [] });+ });++ it('renders a mobile-only Catalog/Findings tablist that toggles which section is visible', async () => {+ renderPage();++ const tablist = await screen.findByRole('tablist', { name: /editorial sections/i });+ expect(tablist).toHaveClass('lg:hidden');++ const catalogTab = screen.getByRole('tab', { name: 'Catalog' });+ const findingsTab = screen.getByRole('tab', { name: 'Findings' });++ // Findings is the default mobile tab (primary triage task on small screens).+ expect(findingsTab).toHaveAttribute('aria-selected', 'true');+ expect(catalogTab).toHaveAttribute('aria-selected', 'false');++ // The Catalog <section> heading is the one stacked-hidden on mobile.+ const catalogHeading = screen.getByRole('heading', { name: 'Catalog' });+ const findingsHeading = screen.getByRole('heading', { name: 'Findings' });+ const catalogSection = catalogHeading.closest('section');+ const findingsSection = findingsHeading.closest('section');++ // Both columns always reappear on lg+; only the small-screen visibility flips.+ expect(catalogSection).toHaveClass('lg:block');+ expect(findingsSection).toHaveClass('lg:block');++ // Default: findings shown, catalog hidden below lg.+ expect(findingsSection).not.toHaveClass('hidden');+ expect(catalogSection).toHaveClass('hidden');++ fireEvent.click(catalogTab);++ await waitFor(() => expect(catalogTab).toHaveAttribute('aria-selected', 'true'));+ expect(findingsTab).toHaveAttribute('aria-selected', 'false');+ expect(catalogSection).not.toHaveClass('hidden');+ expect(findingsSection).toHaveClass('hidden');+ });+});