Skip to content

Beautiful, AI-native markdown IDE and LLM wiki

Name the validator in Problems rows and collapse duplicates (#3046)

serafin-garcia7df089ad4e66
diff --git a/.changeset/problems-panel-source-and-duplicates.md b/.changeset/problems-panel-source-and-duplicates.md
new file mode 100644
index 000000000..7245d17e7
--- /dev/null
+++ b/.changeset/problems-panel-source-and-duplicates.md
@@ -0,0 +1,5 @@
+---
+"@inkeep/open-knowledge": patch
+---
+
+The Problems panel now names the validator behind each finding instead of tagging every row `LINT` — a frontmatter-schema failure reads `FRONTMATTER` and a markdownlint rule reads `MARKDOWNLINT`, so the two are distinguishable at a glance (the chip carries the producer, so the line below it now shows the bare rule code). Repeated findings collapse into one row with an instance count ("Frontmatter property is missing · 10 instances") that expands to the individual lines, each keeping its own Fix and Ask AI actions, instead of burying the rest of the plane under identical rows. The project-scope refresh icon finally explains itself on hover.
diff --git a/docs/content/advanced/content-rules/overview.mdx b/docs/content/advanced/content-rules/overview.mdx
index 4f857e645..381852a9c 100644
--- a/docs/content/advanced/content-rules/overview.mdx
+++ b/docs/content/advanced/content-rules/overview.mdx
@@ -18,6 +18,8 @@ This page covers what's the same whatever linter runs; each linter's page covers
- **This doc** — live diagnostics for the open document, in both WYSIWYG and source mode. Click a problem to jump to it: source mode lands on the exact line and column, WYSIWYG scrolls to the block it falls in.
- **Project** — an on-demand audit of every in-scope document. It runs when you first open the scope and on the refresh button — never in the background. Results group per file with error/warning totals; configuration problems (a malformed config file, a broken `extends`) surface at the top. Clicking a problem opens the offending doc at that position.
+In both scopes, each row tags the validator that produced it in uppercase — for example `MARKDOWNLINT`, `FRONTMATTER`, or `LINKS` — next to the rule code, and a finding that repeats collapses into one row with an instance count you can expand to reach the individual lines.
+
The panel is also available in [single-file sessions](/docs/features/editor#open-a-single-file) (`ok <file>`).
## Enabling a linter
diff --git a/packages/app/src/components/ProblemsPanel.dom.test.tsx b/packages/app/src/components/ProblemsPanel.dom.test.tsx
index c70e57aec..c9d5b1132 100644
--- a/packages/app/src/components/ProblemsPanel.dom.test.tsx
+++ b/packages/app/src/components/ProblemsPanel.dom.test.tsx
@@ -486,14 +486,178 @@ describe('ProblemsPanel', () => {
}
});
- test('every row carries a source tag: lint for validators, link for dead links', () => {
+ test('every row names the validator that produced it, not a generic category', () => {
render(
- <ProblemsPanel docName="notes" diagnostics={[diag({ line: 2 }), linkDiag({ line: 5 })]} />,
+ <ProblemsPanel
+ docName="notes"
+ diagnostics={[
+ diag({ line: 2 }),
+ diag({ line: 3, source: 'frontmatter', code: 'required', message: 'Missing title' }),
+ linkDiag({ line: 5 }),
+ ]}
+ />,
);
const tags = screen.getAllByTestId('problems-source-tag');
- expect(tags).toHaveLength(2);
- expect(tags[0]?.textContent).toBe('lint');
- expect(tags[1]?.textContent).toBe('link');
+ // Each chip is the producing validator's own name, not a shared "lint"
+ // label — so two different validators read as two distinct chips.
+ expect(tags.map((tag) => tag.textContent)).toEqual(['markdownlint', 'frontmatter', 'links']);
+ // The chip carries the producer, so the subline drops the duplicate prefix
+ // and shows the bare rule code.
+ const row = screen.getByRole('button', { name: /Hard tabs/ });
+ expect(row.textContent).toContain('MD010 · line 2');
+ expect(row.textContent).not.toContain('markdownlint/MD010');
+ });
+
+ test('repeated findings collapse into one row with an instance count', () => {
+ const repeated = [4, 9, 12].map((line) =>
+ diag({
+ line,
+ source: 'frontmatter',
+ code: 'required',
+ message: 'Frontmatter property is missing',
+ }),
+ );
+ render(<ProblemsPanel docName="notes" diagnostics={[...repeated, diag({ line: 2 })]} />);
+ // One collapsed group for the repeat, one plain row for the singleton.
+ const groups = screen.getAllByTestId('problems-duplicate-group');
+ expect(groups).toHaveLength(1);
+ expect(groups[0]?.textContent).toContain('3 instances');
+ // Collapsed by default: the occurrences are not in the tree yet.
+ expect(screen.queryByTestId('problems-duplicate-instances')).toBeNull();
+ // The message appears once, not three times.
+ expect(screen.getAllByText('Frontmatter property is missing')).toHaveLength(1);
+ // The collapsed header's subline shows the bare rule code — a group spans
+ // many lines, so it names none of them.
+ expect(groups[0]?.textContent).toContain('required');
+ expect(groups[0]?.textContent).not.toMatch(/line \d/);
+ });
+
+ test('expanding a group lists each occurrence, and one click jumps to its line', () => {
+ let received: { line: number; column: number } | null = null;
+ const listener = (e: Event) => {
+ received = (e as CustomEvent<{ line: number; column: number }>).detail;
+ };
+ window.addEventListener(LINT_NAV_EVENT, listener);
+ try {
+ render(
+ <ProblemsPanel
+ docName="notes"
+ diagnostics={[4, 9].map((line) => diag({ line, message: 'Hard tabs' }))}
+ />,
+ );
+ fireEvent.click(
+ screen.getByTestId('problems-duplicate-group').querySelector('button') as HTMLElement,
+ );
+ const occurrences = screen
+ .getByTestId('problems-duplicate-instances')
+ .querySelectorAll('button');
+ expect(occurrences).toHaveLength(2);
+ // Each occurrence keeps the message in its accessible name so it still
+ // reads as a whole finding out of list context.
+ expect(occurrences[1]?.getAttribute('aria-label')).toBe('Hard tabs at line 9');
+ fireEvent.click(occurrences[1] as HTMLElement);
+ expect(received).toEqual({ line: 9, column: 1 });
+ } finally {
+ window.removeEventListener(LINT_NAV_EVENT, listener);
+ }
+ });
+
+ test('an expanded occurrence keeps its own Fix action', () => {
+ const fixAt = (line: number) =>
+ diag({
+ line,
+ fixes: [
+ {
+ range: {
+ start: { line: line - 1, character: 0 },
+ end: { line: line - 1, character: 1 },
+ },
+ newText: ' ',
+ },
+ ],
+ });
+ const onFix = vi.fn(() => {});
+ render(<ProblemsPanel docName="notes" diagnostics={[fixAt(4), fixAt(9)]} onFix={onFix} />);
+ // Collapsed, the group header carries no per-occurrence Fix.
+ expect(screen.queryByTestId('problems-fix')).toBeNull();
+ fireEvent.click(
+ screen.getByTestId('problems-duplicate-group').querySelector('button') as HTMLElement,
+ );
+ const fixButtons = screen.getAllByTestId('problems-fix');
+ expect(fixButtons).toHaveLength(2);
+ fixButtons[1]?.click();
+ expect(onFix).toHaveBeenCalledTimes(1);
+ expect((onFix.mock.calls[0] as unknown[])[0]).toMatchObject({
+ range: { start: { line: 8, character: 0 } },
+ });
+ });
+
+ test('an expanded group exposes an Ask AI action per occurrence', () => {
+ const onAskAi = vi.fn(() => {});
+ render(
+ <ProblemsPanel
+ docName="notes"
+ diagnostics={[4, 9].map((line) => diag({ line, message: 'Hard tabs' }))}
+ onAskAi={onAskAi}
+ />,
+ );
+ // Collapsed, the group header carries no per-occurrence Ask AI.
+ expect(screen.queryByTestId('problems-ask-ai')).toBeNull();
+ fireEvent.click(
+ screen.getByTestId('problems-duplicate-group').querySelector('button') as HTMLElement,
+ );
+ // One Ask AI per expanded occurrence — the grouped path renders the same
+ // per-occurrence actions as an ungrouped row.
+ expect(screen.getAllByTestId('problems-ask-ai')).toHaveLength(2);
+ });
+
+ test('same message from different rules stays ungrouped', () => {
+ render(
+ <ProblemsPanel
+ docName="notes"
+ diagnostics={[
+ diag({ line: 2, code: 'MD010', message: 'Same text' }),
+ diag({ line: 5, code: 'MD012', message: 'Same text' }),
+ ]}
+ />,
+ );
+ expect(screen.queryByTestId('problems-duplicate-group')).toBeNull();
+ expect(screen.getAllByText('Same text')).toHaveLength(2);
+ });
+
+ test('dead links to different targets stay ungrouped', () => {
+ const deadLinkTo = (line: number, target: string) => ({
+ ...linkDiag({ line }),
+ linkTarget: target,
+ message: `Link target "${target}" does not resolve to an existing document.`,
+ });
+ render(
+ <ProblemsPanel
+ docName="notes"
+ diagnostics={[deadLinkTo(2, 'alpha'), deadLinkTo(5, 'beta')]}
+ />,
+ );
+ // Same source and code (`links`/`dead-link`), different target: the key's
+ // target/message axis keeps them apart, so each keeps its own Create action.
+ expect(screen.queryByTestId('problems-duplicate-group')).toBeNull();
+ expect(screen.getAllByTestId('problems-create-page')).toHaveLength(2);
+ });
+
+ test('dead links to one target group, and each occurrence keeps its Create action', () => {
+ // Same source, code, target and message: the group key collapses them, so the
+ // Create action has to survive the grouped path, not just the plain-row one.
+ render(
+ <ProblemsPanel
+ docName="notes"
+ diagnostics={[linkDiag({ line: 3 }), linkDiag({ line: 8 })]}
+ />,
+ );
+ const group = screen.getByTestId('problems-duplicate-group');
+ // Collapsed, the header offers no per-occurrence Create.
+ expect(screen.queryByTestId('problems-create-page')).toBeNull();
+ fireEvent.click(group.querySelector('button') as HTMLElement);
+ // One Create per expanded occurrence, each carrying its own target.
+ expect(screen.getAllByTestId('problems-create-page')).toHaveLength(2);
});
test('a dead-link row offers the one-shot Create page action; lint rows do not', async () => {
@@ -604,12 +768,51 @@ describe('ProblemsPanel — project scope', () => {
await waitFor(() => expect(screen.getByText('guides/setup.md')).toBeTruthy());
const tags = screen.getAllByTestId('problems-source-tag');
- expect(tags.map((tag) => tag.textContent)).toEqual(['lint', 'link']);
+ expect(tags.map((tag) => tag.textContent)).toEqual(['markdownlint', 'links']);
// The rollup summary carries the merged plane's counts.
expect(screen.getByTestId('problems-audit-summary').textContent).toContain('1 error');
expect(screen.getByTestId('problems-audit-summary').textContent).toContain('1 warning');
});
+ test('repeats collapse inside a file group while the file count stays the total', async () => {
+ runLintAuditImpl = async () =>
+ auditResult({
+ files: [
+ {
+ file: 'guides/setup.md',
+ diagnostics: [2, 6, 11].map((line) =>
+ diag({ line, source: 'frontmatter', code: 'required', message: 'Missing title' }),
+ ),
+ },
+ ],
+ warningCount: 3,
+ });
+ render(<ProblemsPanel docName="notes" diagnostics={[]} />);
+ fireEvent.click(screen.getByTestId('panel-scope-project'));
+ await waitFor(() => expect(screen.getByText('guides/setup.md')).toBeTruthy());
+
+ expect(screen.getAllByTestId('problems-duplicate-group')).toHaveLength(1);
+ expect(screen.getAllByText('Missing title')).toHaveLength(1);
+ // The per-file badge still counts problems, not collapsed rows.
+ expect(screen.getByTestId('problems-audit-file-count').textContent).toBe('3');
+ });
+
+ test('the refresh icon explains itself in a tooltip', async () => {
+ runLintAuditImpl = async () => auditResult({ fileCount: 2 });
+ render(<ProblemsPanel docName="notes" diagnostics={[]} />);
+ fireEvent.click(screen.getByTestId('panel-scope-project'));
+ // The tooltip only opens once the audit lands — the button is disabled
+ // (and so not hoverable) while it runs.
+ await waitFor(() =>
+ expect((screen.getByTestId('problems-audit-refresh') as HTMLButtonElement).disabled).toBe(
+ false,
+ ),
+ );
+ fireEvent.focus(screen.getByTestId('problems-audit-refresh'));
+ const tooltip = await screen.findByTestId('problems-audit-refresh-tooltip');
+ expect(tooltip.textContent).toContain('Re-run the project audit');
+ });
+
test('a project-scope dead-link row creates its target and re-audits the plane', async () => {
runLintAuditImpl = async () =>
auditResult({
@@ -647,7 +850,7 @@ describe('ProblemsPanel — project scope', () => {
runLintAuditImpl = async () =>
auditResult({ files: [{ file: 'second.md', diagnostics: [diag({})] }] });
- fireEvent.click(screen.getByLabelText('Refresh audit'));
+ fireEvent.click(screen.getByLabelText('Re-run the project audit'));
await waitFor(() => expect(screen.getByText('second.md')).toBeTruthy());
expect(auditCalls).toBe(2);
expect(screen.queryByText('first.md')).toBeNull();
@@ -664,11 +867,15 @@ describe('ProblemsPanel — project scope', () => {
fireEvent.click(screen.getByTestId('panel-scope-project'));
const status = await screen.findByRole('status');
expect(status.getAttribute('aria-busy')).toBe('true');
- expect((screen.getByLabelText('Refresh audit') as HTMLButtonElement).disabled).toBe(true);
+ expect((screen.getByLabelText('Re-run the project audit') as HTMLButtonElement).disabled).toBe(
+ true,
+ );
resolveAudit(auditResult({ fileCount: 2 }));
await waitFor(() => expect(screen.getByText('No problems across 2 documents.')).toBeTruthy());
- expect((screen.getByLabelText('Refresh audit') as HTMLButtonElement).disabled).toBe(false);
+ expect((screen.getByLabelText('Re-run the project audit') as HTMLButtonElement).disabled).toBe(
+ false,
+ );
});
test('a failed audit surfaces the error and refresh retries it', async () => {
@@ -681,7 +888,7 @@ describe('ProblemsPanel — project scope', () => {
runLintAuditImpl = async () =>
auditResult({ files: [{ file: 'retried.md', diagnostics: [diag({})] }] });
- fireEvent.click(screen.getByLabelText('Refresh audit'));
+ fireEvent.click(screen.getByLabelText('Re-run the project audit'));
await waitFor(() => expect(screen.getByText('retried.md')).toBeTruthy());
expect(screen.queryByText('The audit could not be completed. Try again.')).toBeNull();
});
@@ -730,6 +937,58 @@ describe('ProblemsPanel — project scope', () => {
}
});
+ test('a grouped project-scope occurrence banks the clicked line, not the group first', async () => {
+ runLintAuditImpl = async () =>
+ auditResult({
+ files: [
+ {
+ file: 'guides/setup.md',
+ diagnostics: [4, 9].map((line) =>
+ diag({
+ line,
+ source: 'frontmatter',
+ code: 'required',
+ message: 'Frontmatter property is missing',
+ }),
+ ),
+ },
+ ],
+ });
+ let navEvents = 0;
+ const listener = () => {
+ navEvents += 1;
+ };
+ window.addEventListener(LINT_NAV_EVENT, listener);
+ try {
+ render(<ProblemsPanel docName="notes" diagnostics={[]} />);
+ fireEvent.click(screen.getByTestId('panel-scope-project'));
+ await waitFor(() => expect(screen.getByText('guides/setup.md')).toBeTruthy());
+
+ // Expand the collapsed duplicate group, then click the SECOND occurrence.
+ fireEvent.click(
+ screen.getByTestId('problems-duplicate-group').querySelector('button') as HTMLElement,
+ );
+ const occurrences = screen
+ .getByTestId('problems-duplicate-instances')
+ .querySelectorAll('button');
+ expect(occurrences).toHaveLength(2);
+ fireEvent.click(occurrences[1] as HTMLElement);
+
+ // Cross-doc nav banks the intent by hash; the banked line is the clicked
+ // occurrence (9), not the group's first (4) — the click carries its own
+ // diagnostic through the project-scope onNavigate wrapper.
+ expect(window.location.hash).toBe('#/guides/setup');
+ expect(consumePendingSourceNavigation('guides/setup')).toEqual({
+ kind: 'lint',
+ detail: { line: 9, column: 1 },
+ });
+ // Cross-doc clicks stay off the in-doc event (it carries no docName).
+ expect(navEvents).toBe(0);
+ } finally {
+ window.removeEventListener(LINT_NAV_EVENT, listener);
+ }
+ });
+
test('clicking a project-scope diagnostic for the open doc keeps the in-doc event fast path', async () => {
runLintAuditImpl = async () =>
auditResult({ files: [{ file: 'notes.md', diagnostics: [diag({ line: 7, column: 2 })] }] });
diff --git a/packages/app/src/components/ProblemsPanel.tsx b/packages/app/src/components/ProblemsPanel.tsx
index 7b7d56d9d..8bc54d509 100644
--- a/packages/app/src/components/ProblemsPanel.tsx
+++ b/packages/app/src/components/ProblemsPanel.tsx
@@ -11,7 +11,7 @@ import {
Sparkles,
Wrench,
} from 'lucide-react';
-import { type ReactNode, useEffect, useRef, useState } from 'react';
+import { type ReactElement, type ReactNode, useEffect, useRef, useState } from 'react';
import { toast } from 'sonner';
import { useOptionalPageList } from '@/components/PageListContext';
import { type PanelScope, PanelScopeHeader } from '@/components/PanelScopeHeader';
@@ -78,13 +78,20 @@ type ProjectAuditState =
| { status: 'loaded'; result: ValidationAuditResponse }
| { status: 'failed' };
-/** Message line + source chip + `source/code · line` subline shared by doc- and project-scope rows. */
-function DiagnosticRowBody({ diagnostic }: { diagnostic: DiagnosticLike }) {
+/** Message line + producer chip + `code · line` subline shared by doc- and project-scope rows. */
+function DiagnosticRowBody({
+ diagnostic,
+ instanceCount,
+}: {
+ diagnostic: DiagnosticLike;
+ /** When above 1, the row counts occurrences instead of naming a single line. */
+ instanceCount?: number;
+}) {
const { t } = useLingui();
const Icon = diagnostic.severity === 'error' ? AlertCircle : AlertTriangle;
- const flatId = `${diagnostic.source}/${diagnostic.code}`;
const displayLine = diagnostic.range.start.line + 1;
const isLink = diagnostic.source === 'links';
+ const grouped = instanceCount !== undefined && instanceCount > 1;
return (
<>
<span className="flex items-start gap-1.5 text-sm">
@@ -95,12 +102,40 @@ function DiagnosticRowBody({ diagnostic }: { diagnostic: DiagnosticLike }) {
diagnostic.severity === 'error' ? 'text-destructive' : 'text-amber-500',
)}
/>
- <span className="text-foreground">{diagnostic.message}</span>
+ <span className="min-w-0 flex-1 text-foreground">{diagnostic.message}</span>
+ {grouped ? (
+ // Count and disclosure both sit on the right so a grouped row keeps
+ // the exact left edge of an ungrouped one — a leading chevron indents
+ // the icon and message and leaves the list visibly ragged, and
+ // reserving a twistie gutter on every row would cost width this panel
+ // does not have. The count rides the message line — the `flex-1`
+ // element that absorbs panel narrowing and wraps — not the subline,
+ // whose code text already ellipsis-truncates.
+ <span className="mt-0.5 flex shrink-0 items-center gap-1">
+ <Badge
+ variant="gray"
+ data-testid="problems-instance-count"
+ className="h-4 px-1 font-sans text-[10px] leading-none"
+ >
+ <Plural value={instanceCount} one="# instance" other="# instances" />
+ </Badge>
+ <ChevronRight
+ aria-hidden="true"
+ className="size-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-90 motion-reduce:transition-none"
+ />
+ </span>
+ ) : null}
</span>
<span className="flex items-center gap-1.5 ps-5 font-mono text-xs text-muted-foreground">
- {/* Source tag: the unified plane mixes validators per file, so every
- row names its category at a glance (the flatId spells the full
- validator id for the detail-oriented). */}
+ {/* The chip names the validator that PRODUCED the finding, not a generic
+ category — `frontmatter/required` and `markdownlint/MD041` are
+ otherwise indistinguishable at a glance, and the plane keeps
+ absorbing validators. Rendered from the machine `source` verbatim so
+ a new validator needs no table here, and untranslated because those
+ ids are brand names. (The header and settings sidebar show the
+ friendlier `lint-plugin-meta` label instead — e.g. `frontmatter` →
+ "Frontmatter schemas" — which `links` has no entry for.) The subline
+ then carries the bare rule code, not the redundant `source/code`. */}
<Badge
variant="gray"
data-testid="problems-source-tag"
@@ -109,23 +144,144 @@ function DiagnosticRowBody({ diagnostic }: { diagnostic: DiagnosticLike }) {
isLink && 'gap-0.5',
)}
>
- {isLink ? (
- <>
- <Link2 aria-hidden="true" className="size-2.5" />
- <Trans>link</Trans>
- </>
- ) : (
- <Trans>lint</Trans>
- )}
+ {isLink ? <Link2 aria-hidden="true" className="size-2.5" /> : null}
+ {diagnostic.source}
</Badge>
+ {/* A group spans many lines, so only a single finding names one. */}
<span className="min-w-0 truncate">
- {flatId} · {t`line ${displayLine}`}
+ {grouped ? diagnostic.code : `${diagnostic.code} · ${t`line ${displayLine}`}`}
</span>
</span>
</>
);
}
+/** Repeats of one finding — same producer, rule, message and link target. */
+interface DiagnosticGroup {
+ key: string;
+ /** At least one, ordered by line then column. */
+ instances: [DiagnosticLike, ...DiagnosticLike[]];
+}
+
+/**
+ * Collapse repeats of one finding into a single group. A schema rule that fires
+ * on every document property (or a hard-tab rule on every indented line) would
+ * otherwise bury the rest of the plane under identical rows. Insertion order is
+ * first occurrence, so the grouped list stays line-sorted.
+ */
+function groupDiagnostics(sorted: readonly DiagnosticLike[]): DiagnosticGroup[] {
+ const byKey = new Map<string, DiagnosticGroup>();
+ for (const diagnostic of sorted) {
+ // NUL-joined: the message is free text and could otherwise forge a key
+ // that collides with another rule's group.
+ const key = `${diagnostic.source}/${diagnostic.code}\u0000${diagnostic.linkTarget ?? ''}\u0000${diagnostic.message}`;
+ const existing = byKey.get(key);
+ if (existing === undefined) byKey.set(key, { key, instances: [diagnostic] });
+ else existing.instances.push(diagnostic);
+ }
+ return [...byKey.values()];
+}
+
+/**
+ * One row per distinct finding. A lone occurrence renders exactly as before; a
+ * repeated one collapses behind an instance count and expands to per-line
+ * occurrences, each keeping its own actions (a fix is per-occurrence).
+ */
+function DiagnosticGroupItem({
+ group,
+ onNavigate,
+ navTitle,
+ renderActions,
+}: {
+ group: DiagnosticGroup;
+ onNavigate: (diagnostic: DiagnosticLike) => void;
+ /** Hover title for one occurrence. */
+ navTitle: (diagnostic: DiagnosticLike) => string;
+ /** Hover-revealed actions for one occurrence; null when it offers none. The
+ * consumer keys the overlay on a strict `=== null`, so the sentinel must be
+ * `null` (not `undefined`/`false`) — hence `ReactElement | null`, not `ReactNode`. */
+ renderActions: (diagnostic: DiagnosticLike) => ReactElement | null;
+}) {
+ const { t } = useLingui();
+ // `groupDiagnostics` seeds every group with one instance and only ever pushes,
+ // so the non-empty tuple type guarantees a first element.
+ const first = group.instances[0];
+
+ if (group.instances.length === 1) {
+ const actions = renderActions(first);
+ return (
+ <li className="group relative rounded transition-colors hover:bg-muted">
+ {/* Full-width message: the actions are pulled out of flow (absolute,
+ below) so the diagnostic text uses the whole row and wraps, instead
+ of being squeezed to make room for the buttons. */}
+ <button
+ type="button"
+ onClick={() => onNavigate(first)}
+ className="flex w-full cursor-pointer flex-col gap-0.5 rounded px-2 py-1.5 text-left"
+ title={navTitle(first)}
+ >
+ <DiagnosticRowBody diagnostic={first} />
+ </button>
+ {actions === null ? null : (
+ // Bottom-right, revealed on hover/focus. `bg-muted` matches the row's
+ // own hover background so it cleanly occludes the subline underneath.
+ <div className="absolute bottom-1 right-1 flex items-center gap-1 rounded bg-muted opacity-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100 motion-reduce:transition-none">
+ {actions}
+ </div>
+ )}
+ </li>
+ );
+ }
+
+ return (
+ <li className="rounded" data-testid="problems-duplicate-group">
+ <Collapsible>
+ {/* Same padding and column layout as the single-finding row above, so
+ both left edges line up; the disclosure chevron rides the right. */}
+ <CollapsibleTrigger className="group flex w-full cursor-pointer flex-col gap-0.5 rounded px-2 py-1.5 text-left transition-colors hover:bg-muted">
+ <DiagnosticRowBody diagnostic={first} instanceCount={group.instances.length} />
+ </CollapsibleTrigger>
+ <CollapsibleContent className="overflow-hidden data-[state=open]:animate-[collapsible-down_150ms_ease-out] data-[state=closed]:animate-[collapsible-up_150ms_ease-in] motion-reduce:animate-none">
+ <ul
+ aria-label={t`Occurrences of ${first.message}`}
+ className="flex flex-col gap-0.5 pb-1 ps-5"
+ data-testid="problems-duplicate-instances"
+ >
+ {group.instances.map((diagnostic) => {
+ const actions = renderActions(diagnostic);
+ const displayLine = diagnostic.range.start.line + 1;
+ return (
+ <li
+ key={diagnosticKey(diagnostic)}
+ className="group relative rounded transition-colors hover:bg-muted"
+ >
+ <button
+ type="button"
+ onClick={() => onNavigate(diagnostic)}
+ className="flex w-full cursor-pointer rounded px-2 py-1 text-left font-mono text-xs text-muted-foreground"
+ title={navTitle(diagnostic)}
+ // The visible text is just the line number; the message
+ // rides the accessible name so the occurrence still reads
+ // as a whole finding out of list context.
+ aria-label={t`${diagnostic.message} at line ${displayLine}`}
+ >
+ {t`line ${displayLine}`}
+ </button>
+ {actions === null ? null : (
+ <div className="absolute bottom-0.5 right-1 flex items-center gap-1 rounded bg-muted opacity-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100 motion-reduce:transition-none">
+ {actions}
+ </div>
+ )}
+ </li>
+ );
+ })}
+ </ul>
+ </CollapsibleContent>
+ </Collapsible>
+ </li>
+ );
+}
+
function diagnosticKey(diagnostic: DiagnosticLike): string {
return `${diagnostic.source}/${diagnostic.code}-${diagnostic.range.start.line}-${diagnostic.range.start.character}-${diagnostic.message}`;
}
@@ -510,6 +666,52 @@ export function ProblemsPanel({
window.location.hash = hashFromDocName(targetDocName);
}
+ /** Per-occurrence actions in doc scope: create the missing page, fix, ask AI. */
+ function renderDocActions(diagnostic: DiagnosticLike): ReactElement | null {
+ const fixable = onFix !== undefined && (diagnostic.fixes?.length ?? 0) > 0;
+ const canCreate = diagnostic.linkTarget !== undefined && pageList !== null;
+ if (!fixable && !canCreate && onAskAi === undefined) return null;
+ const flatId = `${diagnostic.source}/${diagnostic.code}`;
+ return (
+ <>
+ {canCreate ? (
+ <CreatePageButton
+ target={diagnostic.linkTarget ?? ''}
+ creating={creatingTarget === diagnostic.linkTarget}
+ disabled={creatingTarget !== null}
+ onCreate={() => void createLinkTarget(diagnostic)}
+ />
+ ) : null}
+ {fixable ? (
+ <Button
+ size="sm"
+ variant="ghost"
+ className="h-6 shrink-0 px-2 text-xs"
+ onClick={() => onFix?.(diagnostic)}
+ aria-label={t`Fix ${flatId}`}
+ data-testid="problems-fix"
+ >
+ <Wrench aria-hidden="true" className="size-3" />
+ <Trans>Fix</Trans>
+ </Button>
+ ) : null}
+ {onAskAi !== undefined ? (
+ <Button
+ size="sm"
+ variant="ghost"
+ className="h-6 shrink-0 px-2 text-xs"
+ onClick={() => onAskAi(diagnostic)}
+ aria-label={t`Ask AI to fix ${flatId}`}
+ data-testid="problems-ask-ai"
+ >
+ <Sparkles aria-hidden="true" className="size-3" />
+ <Trans>Ask AI</Trans>
+ </Button>
+ ) : null}
+ </>
+ );
+ }
+
return (
<Panel>
<PanelHeader>
@@ -593,73 +795,15 @@ export function ProblemsPanel({
</div>
) : null}
<ul aria-label={t`Problems`} className="flex flex-col gap-0.5">
- {sorted.map((diagnostic) => {
- const displayLine = diagnostic.range.start.line + 1;
- const fixable = onFix !== undefined && (diagnostic.fixes?.length ?? 0) > 0;
- const canCreate = diagnostic.linkTarget !== undefined && pageList !== null;
- const flatId = `${diagnostic.source}/${diagnostic.code}`;
- return (
- <li
- key={diagnosticKey(diagnostic)}
- className="group relative rounded transition-colors hover:bg-muted"
- >
- {/* Full-width message: the actions are pulled out of flow
- (absolute, below) so the diagnostic text uses the whole
- row and wraps like the project scope, instead of being
- squeezed to make room for the buttons. */}
- <button
- type="button"
- onClick={() => handleNav(diagnostic)}
- className="flex w-full cursor-pointer flex-col gap-0.5 rounded px-2 py-1.5 text-left"
- title={t`Go to line ${displayLine}`}
- >
- <DiagnosticRowBody diagnostic={diagnostic} />
- </button>
- {fixable || onAskAi !== undefined || canCreate ? (
- // Bottom-right, revealed on hover/focus. `bg-muted`
- // matches the row's own hover background so it cleanly
- // occludes the `source/code · line` subline underneath
- // if a long id would otherwise run beneath it.
- <div className="absolute bottom-1 right-1 flex items-center gap-1 rounded bg-muted opacity-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100 motion-reduce:transition-none">
- {canCreate ? (
- <CreatePageButton
- target={diagnostic.linkTarget ?? ''}
- creating={creatingTarget === diagnostic.linkTarget}
- disabled={creatingTarget !== null}
- onCreate={() => void createLinkTarget(diagnostic)}
- />
- ) : null}
- {fixable ? (
- <Button
- size="sm"
- variant="ghost"
- className="h-6 shrink-0 px-2 text-xs"
- onClick={() => onFix?.(diagnostic)}
- aria-label={t`Fix ${flatId}`}
- data-testid="problems-fix"
- >
- <Wrench aria-hidden="true" className="size-3" />
- <Trans>Fix</Trans>
- </Button>
- ) : null}
- {onAskAi !== undefined ? (
- <Button
- size="sm"
- variant="ghost"
- className="h-6 shrink-0 px-2 text-xs"
- onClick={() => onAskAi(diagnostic)}
- aria-label={t`Ask AI to fix ${flatId}`}
- data-testid="problems-ask-ai"
- >
- <Sparkles aria-hidden="true" className="size-3" />
- <Trans>Ask AI</Trans>
- </Button>
- ) : null}
- </div>
- ) : null}
- </li>
- );
- })}
+ {groupDiagnostics(sorted).map((group) => (
+ <DiagnosticGroupItem
+ key={group.key}
+ group={group}
+ onNavigate={handleNav}
+ navTitle={(diagnostic) => t`Go to line ${diagnostic.range.start.line + 1}`}
+ renderActions={renderDocActions}
+ />
+ ))}
</ul>
</>
)}
@@ -744,17 +888,26 @@ function ProjectAuditBody({
</>
)}
</p>
- <Button
- variant="ghost"
- size="icon"
- className="size-6 shrink-0 text-muted-foreground"
- aria-label={t`Refresh audit`}
- data-testid="problems-audit-refresh"
- disabled={loading || fixing !== null}
- onClick={onRefresh}
- >
- <RefreshCw aria-hidden="true" className="size-3.5" />
- </Button>
+ {/* Icon-only, so the label lives in a tooltip as well as the
+ accessible name — nothing on the button says what it does. */}
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Button
+ variant="ghost"
+ size="icon"
+ className="size-6 shrink-0 text-muted-foreground"
+ aria-label={t`Re-run the project audit`}
+ data-testid="problems-audit-refresh"
+ disabled={loading || fixing !== null}
+ onClick={onRefresh}
+ >
+ <RefreshCw aria-hidden="true" className="size-3.5" />
+ </Button>
+ </TooltipTrigger>
+ <TooltipContent data-testid="problems-audit-refresh-tooltip">
+ <Trans>Re-run the project audit</Trans>
+ </TooltipContent>
+ </Tooltip>
</div>
<div className="flex flex-wrap items-center justify-end gap-1">
{/* The Auto-fix button is disabled during a sweep, so AT can't focus it
@@ -909,39 +1062,30 @@ function ProjectFileGroup({
{sorted.length}
</Badge>
</CollapsibleTrigger>
- <CollapsibleContent className="overflow-hidden data-[state=open]:animate-[collapsible-down_150ms_ease-out] data-[state=closed]:animate-[collapsible-up_150ms_ease-in]">
+ <CollapsibleContent className="overflow-hidden data-[state=open]:animate-[collapsible-down_150ms_ease-out] data-[state=closed]:animate-[collapsible-up_150ms_ease-in] motion-reduce:animate-none">
<ul aria-label={t`Problems in ${file.file}`} className="flex flex-col gap-0.5 pb-1 ps-3">
- {sorted.map((diagnostic) => {
- const displayLine = diagnostic.range.start.line + 1;
- const canCreate = diagnostic.linkTarget !== undefined && onCreateTarget !== undefined;
- return (
- <li
- key={diagnosticKey(diagnostic)}
- className="group relative rounded transition-colors hover:bg-muted"
- >
- <button
- type="button"
- onClick={() => onNavigate(file.file, diagnostic)}
- className="flex w-full cursor-pointer flex-col gap-0.5 rounded px-2 py-1.5 text-left"
- title={t`Go to line ${displayLine} in ${file.file}`}
- >
- <DiagnosticRowBody diagnostic={diagnostic} />
- </button>
- {canCreate ? (
- // Same hover-revealed overlay contract as the doc scope's
- // Fix / Ask AI actions.
- <div className="absolute bottom-1 right-1 flex items-center gap-1 rounded bg-muted opacity-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100 motion-reduce:transition-none">
- <CreatePageButton
- target={diagnostic.linkTarget ?? ''}
- creating={creatingTarget === diagnostic.linkTarget}
- disabled={creatingTarget !== null}
- onCreate={() => onCreateTarget?.(diagnostic)}
- />
- </div>
- ) : null}
- </li>
- );
- })}
+ {groupDiagnostics(sorted).map((group) => (
+ <DiagnosticGroupItem
+ key={group.key}
+ group={group}
+ onNavigate={(diagnostic) => onNavigate(file.file, diagnostic)}
+ navTitle={(diagnostic) =>
+ t`Go to line ${diagnostic.range.start.line + 1} in ${file.file}`
+ }
+ // Same hover-revealed overlay contract as the doc scope, minus
+ // the fix / ask-AI actions (both are this-doc only).
+ renderActions={(diagnostic) =>
+ diagnostic.linkTarget === undefined || onCreateTarget === undefined ? null : (
+ <CreatePageButton
+ target={diagnostic.linkTarget}
+ creating={creatingTarget === diagnostic.linkTarget}
+ disabled={creatingTarget !== null}
+ onCreate={() => onCreateTarget(diagnostic)}
+ />
+ )
+ }
+ />
+ ))}
</ul>
</CollapsibleContent>
</Collapsible>
diff --git a/packages/app/src/locales/en/messages.json b/packages/app/src/locales/en/messages.json
index 18d4f9595..89dba3cba 100644
--- a/packages/app/src/locales/en/messages.json
+++ b/packages/app/src/locales/en/messages.json
@@ -789,6 +789,7 @@
"EOjU5V": ["Inline Math Properties"],
"EPwuTC": [["usedLabel"], " / ", ["sizeLabel"], " tokens used"],
"ETyvvg": ["No language match."],
+ "EUiJEM": ["Occurrences of ", ["0"]],
"EWCJFu": ["Created ", ["target"]],
"EWPtMO": ["Code"],
"EWX92Z": ["Collapse Ask AI"],
@@ -1001,6 +1002,7 @@
"I5685_": ["Try a prompt"],
"I5AfhE": ["Sync status unavailable — server unreachable."],
"I7Exsw": ["Follow us on X"],
+ "I7y_vn": ["Re-run the project audit"],
"IA1wNb": ["The Claude Desktop App didn't open the file. Is it installed? (", ["msg"], ")"],
"IA6JW2": ["Detecting"],
"ICoNYz": ["You can also manage this in Settings."],
@@ -1153,7 +1155,6 @@
"Lcehxn": ["Save resolution"],
"LdABLa": ["Could not open ", ["target"], ". Try opening it manually."],
"LdKIHS": ["Draft a spec"],
- "LdyooL": ["link"],
"LeGeTf": ["OpenKnowledge on GitHub"],
"LhQlGR": [
"This project is running an older version of OpenKnowledge (v",
@@ -1524,7 +1525,6 @@
"SItQRc": ["How do you like OpenKnowledge?"],
"SOPwPh": ["Restore to this edit"],
"SQWJ-i": ["Restore sessions"],
- "STOrpI": ["lint"],
"STTOnz": [["keyName"], " type: complex value (nested; read-only)"],
"SUOoXn": ["Failed to open project."],
"SVLPt5": [["formatted"], " GitHub stars"],
@@ -1718,7 +1718,6 @@
"WPwDin": ["Open folder on disk"],
"WR0y2O": ["Share folder"],
"WRNXKp": ["Searching"],
- "WRdYfS": ["Refresh audit"],
"WWcqsG": ["Start here: what this is and how it's organized."],
"WZ-vBy": [
"Permanently deletes <0>",
@@ -1968,7 +1967,6 @@
"aENGMB": [
"Semantic search adds meaning-based ranking to the search tool so conceptually-related pages surface even without shared keywords."
],
- "aHPdYV": ["Go to line ", ["displayLine"]],
"aM23Wr": ["page-name"],
"aOp3hw": ["Couldn't move to Trash"],
"aQD_86": ["Failed to update the embeddings provider — ", ["detail"]],
@@ -2400,6 +2398,9 @@
"iSnkwB": ["Failed to open cloned project."],
"iTylMl": ["Templates"],
"iXTp5j": ["Scope: "],
+ "iZCZmF": [
+ ["instanceCount", "plural", { "one": ["#", " instance"], "other": ["#", " instances"] }]
+ ],
"idD8Ev": ["Saved"],
"idni-S": ["Values for ", ["keyName"]],
"ig5vUe": ["Failed to load file"],
@@ -2493,7 +2494,6 @@
],
"kCjkGY": ["This may take a moment. Your markdown content is kept."],
"kCqCyf": ["Open CodeMirror's lint diagnostics panel."],
- "kDwcbW": ["Go to line ", ["displayLine"], " in ", ["0"]],
"kFLlsI": ["Insert a footnote reference + matching definition stub."],
"kLv8d3": [
"Your copy of branch <0>",
@@ -3038,6 +3038,7 @@
"uA_jXp": ["Switch and update branch"],
"uBAxNB": ["Editor"],
"uCaIdy": ["GitHub sign-in is missing or expired. Reconnect to resume syncing."],
+ "uCe4AX": [["0"], " at line ", ["displayLine"]],
"uDlyqd": [
"Document the architecture of this repo: create an overview page that links to a page per major module describing its responsibilities and entry points."
],
@@ -3118,6 +3119,7 @@
"). Check the API key and the model id."
],
"vbK_ZG": ["Files sidebar"],
+ "vbMHjo": ["Go to line ", ["0"]],
"ve8vEM": ["Code expired — please try again"],
"vfRlCI": ["Could not copy full path"],
"vfWA_g": ["You picked ~/Desktop. OpenKnowledge will index everything on your desktop."],
@@ -3212,6 +3214,7 @@
"xG4tb6": ["Lost connection to \"", ["docName"], "\"."],
"xHGM4U": ["Hide HTML preview"],
"xK291b": ["Two-page (odd)"],
+ "xKDsGS": ["Go to line ", ["0"], " in ", ["1"]],
"xMsnTe": ["Send & continue"],
"xNyj3h": ["Reinstall for Claude Chat & Cowork"],
"xOTzt5": ["just now"],
diff --git a/packages/app/src/locales/en/messages.po b/packages/app/src/locales/en/messages.po
index 88b32ab59..c76f2c1fd 100644
--- a/packages/app/src/locales/en/messages.po
+++ b/packages/app/src/locales/en/messages.po
@@ -209,6 +209,11 @@ msgstr "{0, plural, one {No problems across # document.} other {No problems acro
msgid "{0} added, {1} removed"
msgstr "{0} added, {1} removed"
+#. placeholder {0}: diagnostic.message
+#: src/components/ProblemsPanel.tsx
+msgid "{0} at line {displayLine}"
+msgstr "{0} at line {displayLine}"
+
#. placeholder {0}: info.agent.name
#: src/components/acp/ThreadView.tsx
msgid "{0} can't continue this conversation — the transcript is kept, but the agent session is gone."
@@ -458,6 +463,10 @@ msgstr "{hours}h ago"
msgid "{hrs}h ago"
msgstr "{hrs}h ago"
+#: src/components/ProblemsPanel.tsx
+msgid "{instanceCount, plural, one {# instance} other {# instances}}"
+msgstr "{instanceCount, plural, one {# instance} other {# instances}}"
+
#: src/components/PropertyWidgets.tsx
msgid "{keyName} type: {typeLabel} (inherited from folder properties; not editable here)"
msgstr "{keyName} type: {typeLabel} (inherited from folder properties; not editable here)"
@@ -4583,14 +4592,16 @@ msgstr "Go back"
msgid "Go to line"
msgstr "Go to line"
+#. placeholder {0}: diagnostic.range.start.line + 1
#: src/components/ProblemsPanel.tsx
-msgid "Go to line {displayLine}"
-msgstr "Go to line {displayLine}"
+msgid "Go to line {0}"
+msgstr "Go to line {0}"
-#. placeholder {0}: file.file
+#. placeholder {0}: diagnostic.range.start.line + 1
+#. placeholder {1}: file.file
#: src/components/ProblemsPanel.tsx
-msgid "Go to line {displayLine} in {0}"
-msgstr "Go to line {displayLine} in {0}"
+msgid "Go to line {0} in {1}"
+msgstr "Go to line {0} in {1}"
#: src/components/FeedbackForm.tsx
msgid "Good"
@@ -5269,10 +5280,6 @@ msgstr "Light, dark, or follow the OS."
msgid "line {displayLine}"
msgstr "line {displayLine}"
-#: src/components/ProblemsPanel.tsx
-msgid "link"
-msgstr "link"
-
#: src/editor/bubble-menu/LinkEditPopover.tsx
#: src/editor/slash-command/component-items.tsx
msgid "Link"
@@ -5319,10 +5326,6 @@ msgstr "Links"
msgid "Links & images"
msgstr "Links & images"
-#: src/components/ProblemsPanel.tsx
-msgid "lint"
-msgstr "lint"
-
#: src/components/settings/ContentRulesSection.tsx
msgid "Lint plugins — which rule families run and their per-rule settings — are configured on their own tab under This project → Plugins."
msgstr "Lint plugins — which rule families run and their per-rule settings — are configured on their own tab under This project → Plugins."
@@ -6392,6 +6395,11 @@ msgstr "Numbered list of items."
msgid "Object"
msgstr "Object"
+#. placeholder {0}: first.message
+#: src/components/ProblemsPanel.tsx
+msgid "Occurrences of {0}"
+msgstr "Occurrences of {0}"
+
#. placeholder {0}: basenameOf(project.mainRoot ?? '')
#: src/components/NavigatorApp.tsx
msgid "of {0}"
@@ -7388,6 +7396,10 @@ msgstr "Re-authenticate with GitHub Enterprise Server"
msgid "Re-embedding happens as searches run, so coverage restarts at zero and refills."
msgstr "Re-embedding happens as searches run, so coverage restarts at zero and refills."
+#: src/components/ProblemsPanel.tsx
+msgid "Re-run the project audit"
+msgstr "Re-run the project audit"
+
#: src/components/empty-state/use-create-suggestions.ts
msgid "Read through this codebase and draft a technical spec for the most complex module: an overview, the architecture, key files, and open questions, all linked from a specs index page."
msgstr "Read through this codebase and draft a technical spec for the most complex module: an overview, the architecture, key files, and open questions, all linked from a specs index page."
@@ -7465,10 +7477,6 @@ msgstr "Redo"
msgid "Reference <0>{0}</0>"
msgstr "Reference <0>{0}</0>"
-#: src/components/ProblemsPanel.tsx
-msgid "Refresh audit"
-msgstr "Refresh audit"
-
#: src/components/InstallInClaudeDesktopDialog.tsx
#: src/components/settings/IntegrationsSection.tsx
msgid "Reinstall"
diff --git a/packages/app/src/locales/pseudo/messages.json b/packages/app/src/locales/pseudo/messages.json
index 1a8b61561..65943862b 100644
--- a/packages/app/src/locales/pseudo/messages.json
+++ b/packages/app/src/locales/pseudo/messages.json
@@ -789,6 +789,7 @@
"EOjU5V": ["Ĩńĺĩńē Ḿàţĥ Ƥŕōƥēŕţĩēś"],
"EPwuTC": [["usedLabel"], " / ", ["sizeLabel"], " ţōķēńś ũśēď"],
"ETyvvg": ["Ńō ĺàńĝũàĝē ḿàţćĥ."],
+ "EUiJEM": ["Ōććũŕŕēńćēś ōƒ ", ["0"]],
"EWCJFu": ["Ćŕēàţēď ", ["target"]],
"EWPtMO": ["Ćōďē"],
"EWX92Z": ["Ćōĺĺàƥśē Àśķ ÀĨ"],
@@ -1001,6 +1002,7 @@
"I5685_": ["Ţŕŷ à ƥŕōḿƥţ"],
"I5AfhE": ["Śŷńć śţàţũś ũńàvàĩĺàƀĺē — śēŕvēŕ ũńŕēàćĥàƀĺē."],
"I7Exsw": ["Ƒōĺĺōŵ ũś ōń X"],
+ "I7y_vn": ["Ŕē-ŕũń ţĥē ƥŕōĴēćţ àũďĩţ"],
"IA1wNb": ["Ţĥē Ćĺàũďē Ďēśķţōƥ Àƥƥ ďĩďń'ţ ōƥēń ţĥē ƒĩĺē. Ĩś ĩţ ĩńśţàĺĺēď? (", ["msg"], ")"],
"IA6JW2": ["Ďēţēćţĩńĝ"],
"ICoNYz": ["Ŷōũ ćàń àĺśō ḿàńàĝē ţĥĩś ĩń Śēţţĩńĝś."],
@@ -1153,7 +1155,6 @@
"Lcehxn": ["Śàvē ŕēśōĺũţĩōń"],
"LdABLa": ["Ćōũĺď ńōţ ōƥēń ", ["target"], ". Ţŕŷ ōƥēńĩńĝ ĩţ ḿàńũàĺĺŷ."],
"LdKIHS": ["Ďŕàƒţ à śƥēć"],
- "LdyooL": ["ĺĩńķ"],
"LeGeTf": ["ŌƥēńĶńōŵĺēďĝē ōń ĜĩţĤũƀ"],
"LhQlGR": [
"Ţĥĩś ƥŕōĴēćţ ĩś ŕũńńĩńĝ àń ōĺďēŕ vēŕśĩōń ōƒ ŌƥēńĶńōŵĺēďĝē (v",
@@ -1524,7 +1525,6 @@
"SItQRc": ["Ĥōŵ ďō ŷōũ ĺĩķē ŌƥēńĶńōŵĺēďĝē?"],
"SOPwPh": ["Ŕēśţōŕē ţō ţĥĩś ēďĩţ"],
"SQWJ-i": ["Ŕēśţōŕē śēśśĩōńś"],
- "STOrpI": ["ĺĩńţ"],
"STTOnz": [["keyName"], " ţŷƥē: ćōḿƥĺēx vàĺũē (ńēśţēď; ŕēàď-ōńĺŷ)"],
"SUOoXn": ["Ƒàĩĺēď ţō ōƥēń ƥŕōĴēćţ."],
"SVLPt5": [["formatted"], " ĜĩţĤũƀ śţàŕś"],
@@ -1718,7 +1718,6 @@
"WPwDin": ["Ōƥēń ƒōĺďēŕ ōń ďĩśķ"],
"WR0y2O": ["Śĥàŕē ƒōĺďēŕ"],
"WRNXKp": ["Śēàŕćĥĩńĝ"],
- "WRdYfS": ["Ŕēƒŕēśĥ àũďĩţ"],
"WWcqsG": ["Śţàŕţ ĥēŕē: ŵĥàţ ţĥĩś ĩś àńď ĥōŵ ĩţ'ś ōŕĝàńĩźēď."],
"WZ-vBy": [
"Ƥēŕḿàńēńţĺŷ ďēĺēţēś <0>",
@@ -1968,7 +1967,6 @@
"aENGMB": [
"Śēḿàńţĩć śēàŕćĥ àďďś ḿēàńĩńĝ-ƀàśēď ŕàńķĩńĝ ţō ţĥē śēàŕćĥ ţōōĺ śō ćōńćēƥţũàĺĺŷ-ŕēĺàţēď ƥàĝēś śũŕƒàćē ēvēń ŵĩţĥōũţ śĥàŕēď ķēŷŵōŕďś."
],
- "aHPdYV": ["Ĝō ţō ĺĩńē ", ["displayLine"]],
"aM23Wr": ["ƥàĝē-ńàḿē"],
"aOp3hw": ["Ćōũĺďń'ţ ḿōvē ţō Ţŕàśĥ"],
"aQD_86": ["Ƒàĩĺēď ţō ũƥďàţē ţĥē ēḿƀēďďĩńĝś ƥŕōvĩďēŕ — ", ["detail"]],
@@ -2400,6 +2398,9 @@
"iSnkwB": ["Ƒàĩĺēď ţō ōƥēń ćĺōńēď ƥŕōĴēćţ."],
"iTylMl": ["Ţēḿƥĺàţēś"],
"iXTp5j": ["Śćōƥē: "],
+ "iZCZmF": [
+ ["instanceCount", "plural", { "one": ["#", " ĩńśţàńćē"], "other": ["#", " ĩńśţàńćēś"] }]
+ ],
"idD8Ev": ["Śàvēď"],
"idni-S": ["Vàĺũēś ƒōŕ ", ["keyName"]],
"ig5vUe": ["Ƒàĩĺēď ţō ĺōàď ƒĩĺē"],
@@ -2493,7 +2494,6 @@
],
"kCjkGY": ["Ţĥĩś ḿàŷ ţàķē à ḿōḿēńţ. Ŷōũŕ ḿàŕķďōŵń ćōńţēńţ ĩś ķēƥţ."],
"kCqCyf": ["Ōƥēń ĆōďēḾĩŕŕōŕ'ś ĺĩńţ ďĩàĝńōśţĩćś ƥàńēĺ."],
- "kDwcbW": ["Ĝō ţō ĺĩńē ", ["displayLine"], " ĩń ", ["0"]],
"kFLlsI": ["Ĩńśēŕţ à ƒōōţńōţē ŕēƒēŕēńćē + ḿàţćĥĩńĝ ďēƒĩńĩţĩōń śţũƀ."],
"kLv8d3": [
"Ŷōũŕ ćōƥŷ ōƒ ƀŕàńćĥ <0>",
@@ -3038,6 +3038,7 @@
"uA_jXp": ["Śŵĩţćĥ àńď ũƥďàţē ƀŕàńćĥ"],
"uBAxNB": ["Ēďĩţōŕ"],
"uCaIdy": ["ĜĩţĤũƀ śĩĝń-ĩń ĩś ḿĩśśĩńĝ ōŕ ēxƥĩŕēď. Ŕēćōńńēćţ ţō ŕēśũḿē śŷńćĩńĝ."],
+ "uCe4AX": [["0"], " àţ ĺĩńē ", ["displayLine"]],
"uDlyqd": [
"Ďōćũḿēńţ ţĥē àŕćĥĩţēćţũŕē ōƒ ţĥĩś ŕēƥō: ćŕēàţē àń ōvēŕvĩēŵ ƥàĝē ţĥàţ ĺĩńķś ţō à ƥàĝē ƥēŕ ḿàĴōŕ ḿōďũĺē ďēśćŕĩƀĩńĝ ĩţś ŕēśƥōńśĩƀĩĺĩţĩēś àńď ēńţŕŷ ƥōĩńţś."
],
@@ -3118,6 +3119,7 @@
"). Ćĥēćķ ţĥē ÀƤĨ ķēŷ àńď ţĥē ḿōďēĺ ĩď."
],
"vbK_ZG": ["Ƒĩĺēś śĩďēƀàŕ"],
+ "vbMHjo": ["Ĝō ţō ĺĩńē ", ["0"]],
"ve8vEM": ["Ćōďē ēxƥĩŕēď — ƥĺēàśē ţŕŷ àĝàĩń"],
"vfRlCI": ["Ćōũĺď ńōţ ćōƥŷ ƒũĺĺ ƥàţĥ"],
"vfWA_g": ["Ŷōũ ƥĩćķēď ~/Ďēśķţōƥ. ŌƥēńĶńōŵĺēďĝē ŵĩĺĺ ĩńďēx ēvēŕŷţĥĩńĝ ōń ŷōũŕ ďēśķţōƥ."],
@@ -3212,6 +3214,7 @@
"xG4tb6": ["Ĺōśţ ćōńńēćţĩōń ţō \"", ["docName"], "\"."],
"xHGM4U": ["Ĥĩďē ĤŢḾĹ ƥŕēvĩēŵ"],
"xK291b": ["Ţŵō-ƥàĝē (ōďď)"],
+ "xKDsGS": ["Ĝō ţō ĺĩńē ", ["0"], " ĩń ", ["1"]],
"xMsnTe": ["Śēńď & ćōńţĩńũē"],
"xNyj3h": ["Ŕēĩńśţàĺĺ ƒōŕ Ćĺàũďē Ćĥàţ & Ćōŵōŕķ"],
"xOTzt5": ["Ĵũśţ ńōŵ"],
diff --git a/packages/app/src/locales/pseudo/messages.po b/packages/app/src/locales/pseudo/messages.po
index 955ef7ec3..f5f7c4707 100644
--- a/packages/app/src/locales/pseudo/messages.po
+++ b/packages/app/src/locales/pseudo/messages.po
@@ -209,6 +209,11 @@ msgstr ""
msgid "{0} added, {1} removed"
msgstr ""
+#. placeholder {0}: diagnostic.message
+#: src/components/ProblemsPanel.tsx
+msgid "{0} at line {displayLine}"
+msgstr ""
+
#. placeholder {0}: info.agent.name
#: src/components/acp/ThreadView.tsx
msgid "{0} can't continue this conversation — the transcript is kept, but the agent session is gone."
@@ -458,6 +463,10 @@ msgstr ""
msgid "{hrs}h ago"
msgstr ""
+#: src/components/ProblemsPanel.tsx
+msgid "{instanceCount, plural, one {# instance} other {# instances}}"
+msgstr ""
+
#: src/components/PropertyWidgets.tsx
msgid "{keyName} type: {typeLabel} (inherited from folder properties; not editable here)"
msgstr ""
@@ -4579,13 +4588,15 @@ msgstr ""
msgid "Go to line"
msgstr ""
+#. placeholder {0}: diagnostic.range.start.line + 1
#: src/components/ProblemsPanel.tsx
-msgid "Go to line {displayLine}"
+msgid "Go to line {0}"
msgstr ""
-#. placeholder {0}: file.file
+#. placeholder {0}: diagnostic.range.start.line + 1
+#. placeholder {1}: file.file
#: src/components/ProblemsPanel.tsx
-msgid "Go to line {displayLine} in {0}"
+msgid "Go to line {0} in {1}"
msgstr ""
#: src/components/FeedbackForm.tsx
@@ -5265,10 +5276,6 @@ msgstr ""
msgid "line {displayLine}"
msgstr ""
-#: src/components/ProblemsPanel.tsx
-msgid "link"
-msgstr ""
-
#: src/editor/bubble-menu/LinkEditPopover.tsx
#: src/editor/slash-command/component-items.tsx
msgid "Link"
@@ -5315,10 +5322,6 @@ msgstr ""
msgid "Links & images"
msgstr ""
-#: src/components/ProblemsPanel.tsx
-msgid "lint"
-msgstr ""
-
#: src/components/settings/ContentRulesSection.tsx
msgid "Lint plugins — which rule families run and their per-rule settings — are configured on their own tab under This project → Plugins."
msgstr ""
@@ -6388,6 +6391,11 @@ msgstr ""
msgid "Object"
msgstr ""
+#. placeholder {0}: first.message
+#: src/components/ProblemsPanel.tsx
+msgid "Occurrences of {0}"
+msgstr ""
+
#. placeholder {0}: basenameOf(project.mainRoot ?? '')
#: src/components/NavigatorApp.tsx
msgid "of {0}"
@@ -7384,6 +7392,10 @@ msgstr ""
msgid "Re-embedding happens as searches run, so coverage restarts at zero and refills."
msgstr ""
+#: src/components/ProblemsPanel.tsx
+msgid "Re-run the project audit"
+msgstr ""
+
#: src/components/empty-state/use-create-suggestions.ts
msgid "Read through this codebase and draft a technical spec for the most complex module: an overview, the architecture, key files, and open questions, all linked from a specs index page."
msgstr ""
@@ -7461,10 +7473,6 @@ msgstr ""
msgid "Reference <0>{0}</0>"
msgstr ""
-#: src/components/ProblemsPanel.tsx
-msgid "Refresh audit"
-msgstr ""
-
#: src/components/InstallInClaudeDesktopDialog.tsx
#: src/components/settings/IntegrationsSection.tsx
msgid "Reinstall"
diff --git a/packages/app/tests/stress/markdown-lint.e2e.ts b/packages/app/tests/stress/markdown-lint.e2e.ts
index 4c97495a3..dd5bea26f 100644
--- a/packages/app/tests/stress/markdown-lint.e2e.ts
+++ b/packages/app/tests/stress/markdown-lint.e2e.ts
@@ -36,13 +36,15 @@ import {
// Kept to a single block so the violation maps to one line/node.
const HARD_TAB_BODY = '# Heading\n\n\tindented with a hard tab\n';
const CLEAN_BODY = '# Heading\n\nA clean paragraph with no violations.\n';
-const MD010 = 'markdownlint/MD010';
+// The Problems row names its producing plugin in the chip, so the subline
+// carries the bare rule code rather than a `source/code` pair.
+const MD010 = 'MD010';
// An H1 followed by an H3 skips a level → MD001 (heading-increment). The hard
// tab keeps a second, independent violation in the doc so "MD010 still fires"
// is the positive signal that a re-lint ran with the new config (an MD001
// zero-count alone would also pass against a dead linter).
const MD001_AND_TAB_BODY = '# Heading\n\n### Skipped level\n\n\tindented with a hard tab\n';
-const MD001 = 'markdownlint/MD001';
+const MD001 = 'MD001';
/** Switch to source mode and wait for CodeMirror to paint. */
async function switchToSource(page: Page) {
@@ -503,7 +505,7 @@ test.describe('markdown lint — WYSIWYG block decorations + navigation', () =>
const tallBody = `# Top heading\n\n${filler}\n\nParagraph with trailing spaces here. \n\n### Bottom heading\n`;
await seed(api, testDocName, tallBody);
await openProblemsTab(page);
- await expect(page.getByText('markdownlint/MD009')).toBeVisible();
+ await expect(page.getByText('MD009')).toBeVisible();
const scroller = page.getByTestId('editor-scroll-container');
await expect(scroller).toBeVisible();
@@ -555,7 +557,7 @@ test.describe('markdown lint — WYSIWYG block decorations + navigation', () =>
await seed(api, testDocName, tallBody);
await switchToSource(page);
await openProblemsTab(page);
- await expect(page.getByText('markdownlint/MD009')).toBeVisible();
+ await expect(page.getByText('MD009')).toBeVisible();
const scroller = page.getByTestId('editor-scroll-container');
await expect(scroller).toBeVisible();
@@ -575,7 +577,7 @@ test.describe('markdown lint — WYSIWYG block decorations + navigation', () =>
}) => {
await seed(api, testDocName, MD009_BODY);
await openProblemsTab(page);
- await expect(page.getByText('markdownlint/MD009')).toBeVisible();
+ await expect(page.getByText('MD009')).toBeVisible();
await page.locator('ul[aria-label="Problems"] > li button').first().click();
@@ -661,13 +663,13 @@ test.describe('markdown lint — auto-fix', () => {
}) => {
await seed(api, testDocName, FIXABLE_BODY);
await openProblemsTab(page);
- await expect(page.getByText('markdownlint/MD009')).toBeVisible();
+ await expect(page.getByText('MD009')).toBeVisible();
const fix = page.getByTestId('problems-fix').first();
await expect(fix).toBeAttached();
await fix.click();
// The write lands on Y.Text('source'); useDocDiagnostics re-lints and the
// row disappears, and the WYSIWYG squiggle clears without navigating.
- await expect(page.getByText('markdownlint/MD009')).toHaveCount(0);
+ await expect(page.getByText('MD009')).toHaveCount(0);
await expect(page.getByText('No problems found')).toBeVisible();
await expect(page.locator('.ProseMirror .ok-lint-block')).toHaveCount(0);
});
diff --git a/packages/app/tests/stress/unified-problems.e2e.ts b/packages/app/tests/stress/unified-problems.e2e.ts
index 6edde99ab..e0ba43756 100644
--- a/packages/app/tests/stress/unified-problems.e2e.ts
+++ b/packages/app/tests/stress/unified-problems.e2e.ts
@@ -103,13 +103,16 @@ test.describe('unified Problems — project scope', () => {
await expect(page.getByText(`${lintDocName}.md`)).toBeVisible({ timeout: 15_000 });
await expect(page.getByText(`${linkDocName}.md`)).toBeVisible();
- // Rows are source-tagged: at least one lint chip and one link chip.
+ // Rows name their producing validator, not a generic category.
const tags = page.getByTestId('problems-source-tag');
- await expect(tags.filter({ hasText: 'lint' }).first()).toBeVisible();
- await expect(tags.filter({ hasText: 'link' }).first()).toBeVisible();
-
- // The dead link names its unresolved target and reads as links/dead-link.
- await expect(page.getByText('links/dead-link').first()).toBeVisible();
+ await expect(tags.filter({ hasText: 'markdownlint' }).first()).toBeVisible();
+ await expect(tags.filter({ hasText: 'links' }).first()).toBeVisible();
+
+ // The chip carries the producer, so the subline shows the bare rule code.
+ await expect(page.getByText('dead-link').first()).toBeVisible();
+ // `getByText` substring-matches by default, so asserting `dead-link` alone
+ // also passes against the old `links/dead-link`. Pin the absence too.
+ await expect(page.getByText('links/dead-link')).toHaveCount(0);
});
});