Beautiful, AI-native markdown IDE and LLM wiki
TypeScript 2nd-brainagent-skillsclaudecodexcompany-braindocsknowledge-knowledge-baseknowledge-managementllmllm-wikillm-wiki-karpathymarkdownmarkdown-editormdmdxnotespkmsecond-brainskills
PRD-8194 Open Problems from file error counts (#3774)
serafin-garciabdf6b9b78f72
diff --git a/.changeset/prd-8194-problem-badge-opens-panel.md b/.changeset/prd-8194-problem-badge-opens-panel.mdnew file mode 100644index 000000000..7dbe1d7d0--- /dev/null+++ b/.changeset/prd-8194-problem-badge-opens-panel.md@@ -0,0 +1,5 @@+---+"@inkeep/open-knowledge": patch+---++The problem count on a file-explorer row is now a control instead of a label. Clicking it, or focusing it and pressing Enter or Space, opens that file and shows the Problems panel listing its problems, expanding the right rail if it was collapsed and switching a panel left in project scope back to the clicked file. Keyboard activation moves focus into the panel, while pointer activation preserves pointer focus. The badge already told you to open the Problems panel for details, and now it takes you there rather than leaving you to find the tab yourself. Tabbing through the file explorer now stops on the count of each row that has problems, which is how the badge becomes reachable without a pointer. It keeps the accessible name and tooltip it always had, and a click carrying cmd, ctrl, shift, or alt still belongs to the tree, so multi-select on a badged row is unchanged.diff --git a/docs/content/advanced/content-rules/overview.mdx b/docs/content/advanced/content-rules/overview.mdxindex 1682ca14c..ff8ec5986 100644--- a/docs/content/advanced/content-rules/overview.mdx+++ b/docs/content/advanced/content-rules/overview.mdx@@ -17,6 +17,7 @@ This page covers what's the same whatever linter runs; each linter's page covers- **The Problems panel** — a tab in the document panel on the right, with a live count badge and two scopes:- **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.+- **The file sidebar** — a file with problems has its row tinted (red for errors, amber for warnings) and carries a count badge. The badge is a control: click it, or tab to it and press Enter or Space, and the file opens with the Problems panel showing that file's problems in **This doc** scope. Keyboard activation moves focus into the panel; clicking preserves pointer focus. Set `validation.fileTreeIndicators: false` in the project's `config.yml` to turn the tint and the badge off (see the [configuration reference](/docs/reference/configuration)).Skill documents are excluded from link checking: files in a skills folder (`.claude/skills`, `.agents/skills`, `.github/skills`, and the like) and the skill documents you open from the Skills panel. A skill's links routinely name files it creates only when it runs, so they report as broken by construction. What goes quiet is the Problems panel in both scopes, and with it the squiggles and gutter marks the panel drives. What stays is the link styling the editor resolves on its own as you type, so a wiki link to a file the skill has not created yet still renders as unresolved, and the Links panel still lists it under Missing. In short: the skill's Problems tab reads clean while the link itself may still look broken in the text. `links({ kind: "dead" })` and `GET /api/dead-links` list them too.diff --git a/docs/content/features/editor.mdx b/docs/content/features/editor.mdxindex 95d6bdea8..70dda35e1 100644--- a/docs/content/features/editor.mdx+++ b/docs/content/features/editor.mdx@@ -124,7 +124,7 @@ A folder can describe itself (its own properties, just like a doc's) and offer t## File sidebar-The sidebar lists every file in your project on disk, including files excluded by `.gitignore` / `.okignore`, except dot-prefixed entries and tooling internals (`.git/`, `.ok/`, `node_modules/`). Turn on **Show Hidden Files** to reveal the dot-prefixed entries. Folder rows expand and collapse; file rows open in a tab on click. The toolbar at the top of the sidebar has buttons to create files, create folders, and search.+The sidebar lists every file in your project on disk, including files excluded by `.gitignore` / `.okignore`, except dot-prefixed entries and tooling internals (`.git/`, `.ok/`, `node_modules/`). Turn on **Show Hidden Files** to reveal the dot-prefixed entries. Folder rows expand and collapse; file rows open in a tab on click. A file with validation problems shows a tinted row and a count badge, and clicking the badge (or tabbing to it and pressing Enter) opens that file with the Problems panel on it, see [Where problems show up](../advanced/content-rules/overview.mdx#where-problems-show-up). The toolbar at the top of the sidebar has buttons to create files, create folders, and search.### Right-click context menusdiff --git a/docs/content/reference/configuration.mdx b/docs/content/reference/configuration.mdxindex b9dac0689..8e93cd88e 100644--- a/docs/content/reference/configuration.mdx+++ b/docs/content/reference/configuration.mdx@@ -36,6 +36,8 @@ A key set in a file more specific than its scope (a user-scope key in `.ok/confi| `contentRules.markdownlint.enabled` | boolean | `false` | project | Enable the [markdownlint](/docs/advanced/content-rules/markdownlint) content-rules plugin for this project (shared via git). Off by default — turn it on in **Settings → This project → Plugins**. The rules themselves live in your native `.markdownlint.*` file, not here. || `contentRules.frontmatter.enabled` | boolean | `false` | project | Enable the [Frontmatter schemas](/docs/advanced/content-rules/frontmatter) content-rules plugin for this project (shared via git). Off by default — turn it on in **Settings → This project → Plugins**. || `contentRules.frontmatter.schemas` | array | `[]` | project | Frontmatter schema mappings: each entry scopes one JSON Schema file to a set of docs — `file` (project-root-relative path), optional `appliesTo` (glob or list; leading `!` excludes; absent means every doc), optional `enabled: false` to park a mapping. Schema content lives in the mapped files, not here. See [Frontmatter schemas](/docs/advanced/content-rules/frontmatter). |+| `validation.links` | `"off" \| "warning" \| "error"` | `"warning"` | project | How broken internal links are reported on the validation plane: `off` hides them, `warning` (default) or `error` sets their severity. Shared via git, like `contentRules`. |+| `validation.fileTreeIndicators` | boolean | `true` | project | Whether the file sidebar tints and badges files that have validation problems. The badge is also the row's entry point into the Problems panel, so turning this off removes both the indicator and that shortcut (see [Where problems show up](/docs/advanced/content-rules/overview#where-problems-show-up)). || `appearance.theme` | `"light" \| "dark" \| "system"` | (unset) | user | Editor light/dark theme. || `appearance.language` | `"system" \| "en" \| "zh-Hans" \| "zh-Hant" \| "hi" \| "es" \| "ar" \| "fr" \| "bn" \| "pt-BR" \| "id" \| "ur" \| "ko"` | (unset) | user | Interface language. `system` (the effective value when unset) follows your operating system or browser, and keeps following it. A personal preference, not project-shared — and it applies to the app's own chrome only: your documents, titles, file and folder names, frontmatter values and tags stay in the language you wrote them in. **Settings → Preferences → Language** offers ten of them (English, 简体中文, 繁體中文, हिन्दी, Español, Français, বাংলা, Português do Brasil, Indonesia, 한국어). Every catalog is complete, but only `es` has been through a Spanish reader; the rest, `zh-Hans` included, are machine-translated and nobody who reads them has checked the wording. Treat it as provisional and [tell us what is wrong](/docs/contribute/translations). `ar` and `ur` are complete translations too, but they stay out of the picker until the interface lays out right to left; set either here by hand to run the app in it, and note the app will not select them from your OS language alone. `OK_LANG=<tag>` overrides the desktop app's native menus for a single run; the rest of the interface follows this field. || `appearance.colorThemeLight` | theme id (`[a-z0-9-]`, 1–32 characters) | (unset) | user | IDE color palette applied while the resolved mode is light. Built-in ids include `default`, `dracula`, `catppuccin-frappe`, `catppuccin-latte`, `monokai`, `gruvbox`, `solarized`, and `custom`; saved themes use their generated `saved-*` id. `default` (the effective value when unset or when no available palette matches an explicitly configured id) means no palette — the base stylesheet shows through. `custom` applies `appearance.customTheme`. Pick it in **Settings → Plugins → [Themes](/docs/plugins/themes)** with the tile's sun. |diff --git a/packages/app/src/components/DocPanel.dom.test.tsx b/packages/app/src/components/DocPanel.dom.test.tsxindex 0127f37a1..f0f803987 100644--- a/packages/app/src/components/DocPanel.dom.test.tsx+++ b/packages/app/src/components/DocPanel.dom.test.tsx@@ -142,9 +142,14 @@ describe('DocPanel — tab gating', () => {expect(screen.getByTestId('outline-panel')).toBeTruthy();});- test('renders the Problems panel when its tab is active', () => {+ test('renders the Problems panel when its tab is active, against the active doc', () => {renderPanel('problems');expect(screen.getByTestId('problems-panel')).toBeTruthy();+ // The panel answers a question about one file, so the doc it is handed has+ // to be the one the editor has open — a stale or absent name would list+ // another file's problems under this one's tab.+ expect(lastProblemsProps?.docName).toBe('notes');+ expect(screen.getByRole('tabpanel').getAttribute('id')).toBe('panel-problems');});});diff --git a/packages/app/src/components/EditorArea.dom.test.tsx b/packages/app/src/components/EditorArea.dom.test.tsxindex 70d1f5bfe..aaca34db6 100644--- a/packages/app/src/components/EditorArea.dom.test.tsx+++ b/packages/app/src/components/EditorArea.dom.test.tsx@@ -1,6 +1,7 @@import { act, cleanup, fireEvent, render, screen } from '@testing-library/react';-import { type ReactNode, useEffect } from 'react';+import { type ReactNode, useEffect, useState } from 'react';import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest';+import type { PanelTab } from './DocPanel';type SettingsDialogShellProps = {open: boolean;@@ -42,11 +43,18 @@ vi.doMock('@/lib/config-provider', () => ({useConfigContext: () => ({ projectBinding: null }),}));+/** Counts the rail handing itself back from the agent drill-in. */+let closeActivityPanelCalls = 0;+const closeActivityPanel = () => {+ closeActivityPanelCalls += 1;+};+const FOLDER_DOC_CTX = {activeDocName: 'folder/index',activeProvider: null,activeTarget: { kind: 'folder', target: 'folder', folderPath: 'folder' },recycleDocument: () => {},+ closeActivityPanel,docPanelMode: 'timeline',docPanelAgentId: null,docPanelExpandSignal: 0,@@ -56,6 +64,7 @@ const EMPTY_DOC_CTX = {activeProvider: null,activeTarget: null,recycleDocument: () => {},+ closeActivityPanel,docPanelMode: 'timeline',docPanelAgentId: null,docPanelExpandSignal: 0,@@ -65,6 +74,7 @@ const LARGE_FILE_DOC_CTX = {activeProvider: null,activeTarget: { kind: 'large-file', docName: 'big', size: 9_999_999, limit: 1_000_000 },recycleDocument: () => {},+ closeActivityPanel,docPanelMode: 'timeline',docPanelAgentId: null,docPanelExpandSignal: 0,@@ -74,6 +84,7 @@ const ASSET_DOC_CTX = {activeProvider: null,activeTarget: { kind: 'asset', assetPath: 'images/diagram.png', mediaKind: 'image' },recycleDocument: () => {},+ closeActivityPanel,docPanelMode: 'timeline',docPanelAgentId: null,docPanelExpandSignal: 0,@@ -104,6 +115,7 @@ const DOC_COLD_CTX = {activeProvider: null,activeTarget: { kind: 'doc', target: 'some-doc', docName: 'some-doc' },recycleDocument: () => {},+ closeActivityPanel,docPanelMode: 'timeline',docPanelAgentId: null,docPanelExpandSignal: 0,@@ -334,6 +346,7 @@ vi.doMock('@/lib/use-settings-route', () => ({const { EditorArea } = await import('./EditorArea');const { TooltipProvider } = await import('@/components/ui/tooltip');const { emitLocalMenuAction } = await import('@/lib/local-menu-action-bus');+const { requestDocPanelTab } = await import('./doc-panel-events');function renderEditorArea() {return render(@@ -1524,3 +1537,100 @@ describe('EditorArea terminal persists across a mid-session cold navigation', ()expect(screen.queryByTestId('terminal-dock')).toBeNull();});});++// The doc-panel tab bus is the rail's remote control: anything that wants the+// panel on a given tab dispatches a request rather than reaching for panel+// state it does not own (the file tree's problem badge, a comment reveal, the+// command palette). EditorArea owns the half a caller is promised here — the+// tab switches, a collapsed rail comes back open, and the agent drill-in gives+// the rail back — pinned against the real DocPanel and the real group-layout+// assert. The scope half of a request belongs to `ProblemsPanel`, which+// subscribes to the same bus and is covered in its own suite.+describe('EditorArea doc-panel tab requests', () => {+ const pctOf = (px: number) => (px / 1360) * 100;++ // The real app owns the tab as state and hands EditorArea a setter, so the+ // request's effect is only visible through a parent that honours the callback.+ function TabHost({ initialTab }: { initialTab: PanelTab }) {+ const [tab, setTab] = useState<PanelTab>(initialTab);+ return (+ <TooltipProvider>+ <EditorArea+ editorMode="wysiwyg"+ onModeChange={() => {}}+ activeTab={tab}+ onActiveTabChange={setTab}+ />+ </TooltipProvider>+ );+ }++ beforeEach(() => {+ cleanup();+ localStorage.clear();+ // `mode: 'doc'` is what renders the tab strip — the agent drill-in owns the+ // panel body in the other mode and offers no tabs to switch.+ docCtx = { ...DOC_LIVE_CTX, docPanelMode: 'doc' };+ groupLayout = {};+ groupSetLayoutCalls = [];+ mockGroupPx = 1360;+ closeActivityPanelCalls = 0;+ });++ test('a doc-scoped problems request opens the Problems tab and expands the collapsed rail', () => {+ render(<TabHost initialTab="timeline" />);+ groupLayout = { 'editor-main': 100, 'doc-panel': 0 };+ groupSetLayoutCalls = [];++ act(() => requestDocPanelTab('problems', { scope: 'doc' }));++ const panel = screen.getByRole('tabpanel');+ expect(panel.getAttribute('id')).toBe('panel-problems');+ expect(groupSetLayoutCalls.at(-1)?.['doc-panel']).toBeCloseTo(pctOf(320), 3);+ });++ test('a panel already parked on Problems in project scope comes back in doc scope', () => {+ render(<TabHost initialTab="problems" />);+ fireEvent.click(screen.getByTestId('panel-scope-project'));+ expect(screen.getByTestId('problems-project-scope')).toBeTruthy();+ // The rail is shut with the tab already selected: nothing about the tab+ // changes, so the expand and the scope reset are the whole of the answer.+ groupLayout = { 'editor-main': 100, 'doc-panel': 0 };+ groupSetLayoutCalls = [];++ act(() => requestDocPanelTab('problems', { scope: 'doc' }));++ expect(screen.getByTestId('panel-scope-doc').getAttribute('data-state')).toBe('on');+ expect(screen.queryByTestId('problems-project-scope')).toBeNull();+ expect(groupSetLayoutCalls.at(-1)?.['doc-panel']).toBeCloseTo(pctOf(320), 3);+ });++ test('a tab request takes the rail back from the agent drill-in', () => {+ docCtx = { ...DOC_LIVE_CTX, docPanelMode: 'agent', docPanelAgentId: 'agent-1' };+ render(<TabHost initialTab="timeline" />);+ // The drill-in owns the whole body and offers no tab strip, so there is no+ // tabpanel to find while it is up.+ expect(screen.queryByRole('tabpanel')).toBeNull();++ act(() => requestDocPanelTab('problems', { scope: 'doc' }));++ expect(closeActivityPanelCalls).toBe(1);+ });++ test('re-rendering does not stack the subscription, and unmounting drops it', () => {+ const view = render(<TabHost initialTab="timeline" />);+ // The subscribing effect mounts once; useEffectEvent keeps its callback's+ // render-owned values fresh without resubscribing. A cleanup that stopped+ // running would leave that mount-time handler live after unmount.+ for (let i = 0; i < 3; i += 1) view.rerender(<TabHost initialTab="timeline" />);+ groupLayout = { 'editor-main': 100, 'doc-panel': 0 };+ groupSetLayoutCalls = [];++ act(() => requestDocPanelTab('problems', { scope: 'doc' }));+ expect(groupSetLayoutCalls).toHaveLength(1);++ view.unmount();+ act(() => requestDocPanelTab('problems', { scope: 'doc' }));+ expect(groupSetLayoutCalls).toHaveLength(1);+ });+});diff --git a/packages/app/src/components/EditorArea.tsx b/packages/app/src/components/EditorArea.tsxindex 9067847e7..82904ac5e 100644--- a/packages/app/src/components/EditorArea.tsx+++ b/packages/app/src/components/EditorArea.tsx@@ -16,6 +16,7 @@ import {Suspense,useDeferredValue,useEffect,+ useEffectEvent,useLayoutEffect,useRef,useState,@@ -375,6 +376,7 @@ function EditorAreaInner({docPanelMode,docPanelAgentId,docPanelExpandSignal,+ closeActivityPanel,} = useDocumentContext();const { openDocumentTransition } = useDocumentTransition();const stats = useDocumentStats(activeProvider, activeDocName);@@ -1197,33 +1199,35 @@ function EditorAreaInner({return () => ro.disconnect();}, [groupContainerEl, isEmbedded]);- // Expand-on-avatar-click. `docPanelExpandSignal` is a monotonic counter- // incremented by `DocumentContext.openActivityPanel` (called from- // `PresenceBar` avatar clicks and the mode-toggle button). When it- // increments, expand/open the panel in whichever layout mode is active.- // Initial 0 → 0 transition (mount) is harmless — calling `expand` when- // already expanded is a no-op in react-resizable-panels.- useEffect(() => {- const openRequestedTab = (tab: PanelTab) => {- onActiveTabChange(tab);- expandDocPanel();- };+ const openRequestedDocPanelTab = useEffectEvent((tab: PanelTab) => {+ // The agent drill-in owns the whole panel body and offers no tab strip, so+ // answering a tab request means giving the rail back to the document.+ if (docPanelMode === 'agent') closeActivityPanel();+ onActiveTabChange(tab);+ expandDocPanel();+ });+ // Install the tab-request subscription once. The effect event keeps the+ // render-owned callbacks and current panel mode fresh without replaying the+ // mount-only pending-request read on later mode changes.+ useEffect(() => {const pendingTab = consumePendingDocPanelTabRequest();if (pendingTab) {- openRequestedTab(pendingTab);+ openRequestedDocPanelTab(pendingTab);}return subscribeToDocPanelTabRequests((tab) => {consumePendingDocPanelTabRequest();- openRequestedTab(tab);+ openRequestedDocPanelTab(tab);});- }, [- onActiveTabChange,- // biome-ignore lint/correctness/useExhaustiveDependencies: expandDocPanel is render-bound; re-subscribing keeps the handler fresh- expandDocPanel,- ]);+ }, []);+ // Expand-on-avatar-click. `docPanelExpandSignal` is a monotonic counter+ // incremented by `DocumentContext.openActivityPanel` (called from+ // `PresenceBar` avatar clicks and the mode-toggle button). When it+ // increments, expand/open the panel in whichever layout mode is active.+ // Initial 0 → 0 transition (mount) is harmless — calling `expand` when+ // already expanded is a no-op in react-resizable-panels.useEffect(() => {if (docPanelExpandSignal === 0) return;expandDocPanel();diff --git a/packages/app/src/components/FileTree.problem-badge.dom.test.tsx b/packages/app/src/components/FileTree.problem-badge.dom.test.tsxnew file mode 100644index 000000000..bb93e6871--- /dev/null+++ b/packages/app/src/components/FileTree.problem-badge.dom.test.tsx@@ -0,0 +1,581 @@+/**+ * Full-mount DOM test for the seam between FileTree's problem-indicator pass+ * and the doc-panel bus: activating a row's problem badge has to open that+ * row's doc and ask the panel for that doc's problems.+ *+ * Pierre's tree is mocked down to the only part of the host the pass reads — a+ * shadow root holding Pierre-shaped rows — and that host is nested inside the+ * element carrying `onClickCapture`, exactly as Pierre nests it, because the+ * capture-phase row handler is what a badge click has to stay clear of.+ *+ * The validation store and the doc-panel event bus are the real modules; they+ * are the boundaries under test, so mocking either would leave the wiring+ * unproven.+ */++import { act, cleanup, render, waitFor } from '@testing-library/react';+import { createElement, type ReactNode, useLayoutEffect, useRef } from 'react';+import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest';+import { subscribeToDocPanelTabRequests } from '@/components/doc-panel-events';+import { OK_PROBLEM_BADGE_ATTR } from '@/components/file-tree-problem-indicators';+import { emitDocumentsChanged } from '@/lib/documents-events';+import { replaceValidationFromCounts } from '@/lib/validation-store';+import type { FileEntry } from './file-tree-utils';++const PROBLEM_DOC_NAME = 'notes/source';+const PROBLEM_ROW_PATH = 'notes/source.mdx';+const CLEAN_ROW_PATH = 'notes/clean.mdx';+const ASSET_ROW_PATH = 'notes/diagram.png';+/** A row the tree renders that no document entry backs — a path the resolver must refuse. */+const GHOST_ROW_PATH = 'notes/ghost.mdx';++/** Ordered activation log — assertions here are about sequence, not just counts. */+let events: string[] = [];+let mergedConfig: unknown = null;++const DOCUMENTS: FileEntry[] = [+ { kind: 'folder', path: 'notes', size: 0, modified: '2026-08-18T00:00:00.000Z' },+ {+ kind: 'document',+ docName: PROBLEM_DOC_NAME,+ docExt: '.mdx',+ size: 1,+ modified: '2026-08-18T00:00:00.000Z',+ },+ {+ kind: 'document',+ docName: 'notes/clean',+ docExt: '.mdx',+ size: 1,+ modified: '2026-08-18T00:00:00.000Z',+ },+ {+ kind: 'asset',+ path: ASSET_ROW_PATH,+ assetExt: 'png',+ mediaKind: null,+ size: 1,+ modified: '2026-08-18T00:00:00.000Z',+ referencedBy: [],+ },+];+let listedDocuments: FileEntry[] = DOCUMENTS;++class StubItem {+ expanded = false;+ selected = false;+ constructor(+ readonly path: string,+ private readonly directory: boolean,+ ) {}+ getPath() {+ return this.path;+ }+ isDirectory() {+ return this.directory;+ }+ isExpanded() {+ return this.expanded;+ }+ expand() {+ this.expanded = true;+ }+ collapse() {+ this.expanded = false;+ }+ isSelected() {+ return this.selected;+ }+ select() {+ this.selected = true;+ }+ deselect() {+ this.selected = false;+ }+ focus() {}+}++class StubModel {+ focusedPath: string | null = null;+ selectedPaths: string[] = [];+ items = new Map<string, StubItem>();+ startRenaming = vi.fn(() => {});+ getFocusedPath() {+ return this.focusedPath;+ }+ getFocusedIndex() {+ return -1;+ }+ getItemHeight() {+ return 24;+ }+ getSelectedPaths() {+ return this.selectedPaths;+ }+ getItem(path: string) {+ return this.items.get(path) ?? null;+ }+ resetPaths(paths: string[]) {+ this.items.clear();+ for (const path of paths) {+ this.items.set(path, new StubItem(path, path.endsWith('/')));+ }+ }+ add(path: string) {+ this.items.set(path, new StubItem(path, path.endsWith('/')));+ }+ move() {}+ remove() {}+ subscribe() {+ return () => {};+ }+ onMutation() {+ return () => {};+ }+ isSearchOpen() {+ return false;+ }+}++let model = new StubModel();++function PassThrough({ children }: { children?: ReactNode }) {+ return <>{children}</>;+}++function jsonResponse(body: unknown, status = 200): Response {+ return new Response(JSON.stringify(body), {+ status,+ headers: { 'content-type': 'application/json' },+ });+}++vi.doMock('sonner', () => ({+ toast: { success: vi.fn(() => {}), error: vi.fn(() => {}) },+}));++vi.doMock('next-themes', () => ({+ useTheme: () => ({ resolvedTheme: 'light' }),+}));++vi.doMock('@/hooks/use-git-sync-status', () => ({+ useGitSyncStatusDetailed: () => ({+ status: { hasRemote: false, syncEnabled: false, behind: 0, ahead: 0 },+ fetchError: null,+ }),+ useGitSyncStatus: () => ({ hasRemote: false, syncEnabled: false, behind: 0, ahead: 0 }),+}));++vi.doMock('@/editor/DocumentContext', () => ({+ useDocumentContext: () => ({+ activeDocName: 'notes/other',+ activeTarget: { kind: 'doc', target: 'notes/other', docName: 'notes/other' },+ closeTabs: () => {},+ closeDocument: () => {},+ isNewTabActive: false,+ openTarget: (+ target: { kind?: string; docName?: string; assetPath?: string },+ options?: { disposition?: string },+ ) => {+ events.push(+ target.kind === 'asset'+ ? `open-asset:${target.assetPath}:${options?.disposition}`+ : `open:${target.docName}:${options?.disposition}`,+ );+ },+ prewarm: () => {},+ reconcileLocalRemoval: async () => {},+ reconcileLocalRename: async () => {},+ setSkillsSidebar: () => {},+ }),+}));++vi.doMock('@/components/PageListContext', () => ({+ usePageList: () => ({+ // Logged so a page registration neither path should make would break the+ // exact-sequence assertions rather than passing unnoticed.+ addPage: (docName: string) => events.push(`addPage:${docName}`),+ pageMeta: new Map(),+ pages: [],+ }),+}));++vi.doMock('./ui/sidebar', () => ({+ useSidebar: () => ({ notifySidebarFileSelected: () => {} }),+}));++vi.doMock('@/lib/config-provider', () => ({+ useConfigContext: () => ({+ okignoreBinding: null,+ projectLocalBinding: null,+ merged: mergedConfig,+ }),+}));++vi.doMock('./handoff/useInstalledAgents', () => ({+ useInstalledAgents: () => ({ states: {} }),+}));++vi.doMock('./handoff/useHandoffDispatch', () => ({+ buildFolderHandoffInput: () => null,+ buildHandoffInput: () => null,+ useHandoffDispatch: () => ({ dispatch: async () => ({ ok: true as const }) }),+}));++vi.doMock('./handoff/OpenInAgentContextSubmenu', () => ({+ OpenInAgentContextSubmenu: () => null,+}));++vi.doMock('./sidebar-hover-prewarm', () => ({+ cancelHoverPrewarm: () => {},+ scheduleHoverPrewarm: () => {},+}));++vi.doMock('@/components/ui/button', () => ({+ Button: ({ children, ...props }: { children?: ReactNode; [key: string]: unknown }) => (+ <button type="button" {...props}>+ {children}+ </button>+ ),+}));++vi.doMock('@/components/ui/dialog', () => ({ Dialog: PassThrough }));++vi.doMock('@/components/ui/dropdown-menu', () => ({+ DropdownMenu: PassThrough,+ DropdownMenuCheckboxItem: PassThrough,+ DropdownMenuContent: PassThrough,+ DropdownMenuItem: PassThrough,+ DropdownMenuSeparator: () => null,+ DropdownMenuSub: PassThrough,+ DropdownMenuSubContent: PassThrough,+ DropdownMenuSubTrigger: PassThrough,+ DropdownMenuTrigger: PassThrough,+}));++vi.doMock('@/components/ui/skeleton', () => ({+ Skeleton: ({ className }: { className?: string }) => <span className={className} />,+}));++vi.doMock('@/components/DeleteConfirmationDialog', () => ({+ DeleteConfirmationDialog: () => null,+}));++vi.doMock('@/components/NewItemDialog', () => ({ NewItemDialog: () => null }));++vi.doMock('@/components/TrashFailureModal', () => ({+ TrashFailureModal: () => null,+ coerceTrashFailureReason: (reason: string) => reason,+}));++vi.doMock('@/components/use-selection-mirror', () => ({+ asDirectoryHandle: (item: StubItem | null) => (item?.isDirectory() ? item : null),+ useSelectionMirror: () => {},+}));++vi.doMock('@pierre/trees', () => ({+ FILE_TREE_TAG_NAME: 'ok-file-tree',+ themeToTreeStyles: () => ({}),+}));++/**+ * The host element whose shadow root the indicator pass walks. Rows carry the+ * `data-type` / `data-item-path` / action-section shape Pierre gives them,+ * which is the whole contract between the two.+ */+function PierreTreeShadowRows() {+ const hostRef = useRef<HTMLElement | null>(null);++ useLayoutEffect(() => {+ const host = hostRef.current;+ if (!host) return;+ const shadow = host.shadowRoot ?? host.attachShadow({ mode: 'open' });+ for (const path of [PROBLEM_ROW_PATH, CLEAN_ROW_PATH, ASSET_ROW_PATH, GHOST_ROW_PATH]) {+ const row = document.createElement('div');+ row.setAttribute('data-type', 'item');+ row.setAttribute('data-item-path', path);+ row.setAttribute('data-item-type', 'file');+ const content = document.createElement('div');+ content.setAttribute('data-item-section', 'content');+ content.textContent = path;+ row.appendChild(content);+ const action = document.createElement('div');+ action.setAttribute('data-item-section', 'action');+ row.appendChild(action);+ shadow.append(row);+ }+ }, []);++ return createElement('ok-file-tree', { ref: hostRef });+}++vi.doMock('@pierre/trees/react', () => ({+ useFileTree: () => ({ model }),+ FileTree: ({+ onClickCapture,+ }: {+ onClickCapture?: (event: unknown) => void;+ [key: string]: unknown;+ }) => (+ <div+ data-testid="fake-pierre-tree"+ role="tree"+ onClickCapture={onClickCapture as never}+ data-file-tree-virtualized-root=""+ >+ <PierreTreeShadowRows />+ </div>+ ),+}));++const { FileTree } = await import('./FileTree');++function shadowRoot(): ShadowRoot {+ const host = document.querySelector('ok-file-tree');+ if (!host?.shadowRoot) throw new Error('tree host has no shadow root');+ return host.shadowRoot;+}++function findBadge(rowPath: string): HTMLElement | null {+ return (+ shadowRoot()+ .querySelector(`[data-item-path="${rowPath}"]`)+ ?.querySelector<HTMLElement>(`[${OK_PROBLEM_BADGE_ATTR}]`) ?? null+ );+}++async function clickBadge(badge: HTMLElement): Promise<void> {+ await act(async () => {+ badge.dispatchEvent(+ new MouseEvent('click', { bubbles: true, cancelable: true, composed: true }),+ );+ // The row's own capture-phase handler defers its navigation to a+ // microtask, so a same-turn assertion would miss a double-fire.+ await Promise.resolve();+ });+}++async function pressBadge(badge: HTMLElement, key: 'Enter' | ' '): Promise<void> {+ await act(async () => {+ badge.dispatchEvent(+ new KeyboardEvent('keydown', { key, bubbles: true, cancelable: true, composed: true }),+ );+ await Promise.resolve();+ });+}++function setProblemCounts(errorCount: number): void {+ act(() => {+ replaceValidationFromCounts([+ {+ file: PROBLEM_ROW_PATH,+ lint: { errorCount, warningCount: 0 },+ links: { errorCount: 0, warningCount: 0 },+ },+ ]);+ });+}++async function renderTreeWithProblems(): Promise<ReturnType<typeof render>> {+ const view = render(<FileTree />);+ setProblemCounts(2);+ await waitFor(() => {+ expect(findBadge(PROBLEM_ROW_PATH)).not.toBeNull();+ });+ return view;+}++describe('FileTree problem badge', () => {+ let unsubscribeFromTabRequests: () => void;+ let fetchSpy: ReturnType<typeof vi.spyOn>;++ beforeEach(() => {+ events = [];+ model = new StubModel();+ mergedConfig = null;+ listedDocuments = DOCUMENTS;+ replaceValidationFromCounts([]);+ unsubscribeFromTabRequests = subscribeToDocPanelTabRequests((tab, request) => {+ events.push(`tab:${tab}:${request.scope ?? 'unscoped'}:${request.focus ?? 'no-focus'}`);+ });+ fetchSpy = vi.spyOn(globalThis, 'fetch').mockImplementation(async (input) => {+ const url = typeof input === 'string' ? input : input instanceof URL ? input.href : input.url;+ if (url.startsWith('/api/documents')) return jsonResponse({ documents: listedDocuments });+ if (url === '/api/workspace') {+ return jsonResponse({+ contentDir: '/tmp/open-knowledge',+ pathSeparator: '/',+ symlinkResolved: true,+ });+ }+ return jsonResponse({});+ });+ });++ afterEach(() => {+ unsubscribeFromTabRequests();+ fetchSpy.mockRestore();+ replaceValidationFromCounts([]);+ cleanup();+ });++ test('activates the clicked file, then asks the panel for that file in doc scope', async () => {+ await renderTreeWithProblems();+ const badge = findBadge(PROBLEM_ROW_PATH);+ expect(badge).not.toBeNull();++ await clickBadge(badge as HTMLElement);++ // Order is the requirement, not just the pair: the panel renders against+ // the active doc, so a request that lands first would open the previous+ // file's problems.+ expect(events).toEqual([`open:${PROBLEM_DOC_NAME}:preview`, 'tab:problems:doc:no-focus']);+ });++ test('keyboard activation asks the Problems panel to take focus', async () => {+ await renderTreeWithProblems();++ await pressBadge(findBadge(PROBLEM_ROW_PATH) as HTMLElement, 'Enter');++ expect(events).toEqual([`open:${PROBLEM_DOC_NAME}:preview`, 'tab:problems:doc:panel']);+ });++ test('a badge click does not also fire the row own navigation', async () => {+ await renderTreeWithProblems();++ await clickBadge(findBadge(PROBLEM_ROW_PATH) as HTMLElement);++ // The row resolves a click into its own activation from the capture phase,+ // one microtask behind the badge's. Both open the same doc, so the count is+ // what separates "the badge answered" from "both did".+ expect(events.filter((entry) => entry.startsWith('open:'))).toHaveLength(1);+ });++ test('a click elsewhere on a badged row still activates the row', async () => {+ await renderTreeWithProblems();+ const label = shadowRoot().querySelector<HTMLElement>(+ `[data-item-path="${PROBLEM_ROW_PATH}"] [data-item-section="content"]`,+ );++ await act(async () => {+ label?.dispatchEvent(+ new MouseEvent('click', { bubbles: true, cancelable: true, composed: true }),+ );+ await Promise.resolve();+ });++ // Guarding the badge must not cost the rest of the row its own click.+ expect(events).toEqual([`open:${PROBLEM_DOC_NAME}:preview`]);+ });++ test('disabled file-tree indicators leave no badge to activate', async () => {+ mergedConfig = { validation: { fileTreeIndicators: false } };+ render(<FileTree />);+ setProblemCounts(2);+ await waitFor(() => expect(shadowRoot().querySelectorAll('[data-item-path]')).toHaveLength(4));++ expect(findBadge(PROBLEM_ROW_PATH)).toBeNull();+ expect(events).toEqual([]);+ });++ test('a badge on a row no document backs opens nothing at all', async () => {+ const debug = vi.spyOn(console, 'debug').mockImplementation(() => {});+ render(<FileTree />);+ act(() => {+ replaceValidationFromCounts([+ {+ file: GHOST_ROW_PATH,+ lint: { errorCount: 1, warningCount: 0 },+ links: { errorCount: 0, warningCount: 0 },+ },+ ]);+ });+ await waitFor(() => {+ expect(findBadge(GHOST_ROW_PATH)).not.toBeNull();+ });++ await clickBadge(findBadge(GHOST_ROW_PATH) as HTMLElement);++ // The tree can render a row ahead of the document index. Minting a doc open+ // from the badge's own path would create an empty CRDT doc for a file the+ // app has never heard of, so the badge resolves through the same guard the+ // row does and declines with a breadcrumb.+ expect(events).toEqual([]);+ expect(debug).toHaveBeenCalled();+ debug.mockRestore();+ });++ test('a badge on an asset row does not ask for a panel the asset view cannot render', async () => {+ render(<FileTree />);+ act(() => {+ replaceValidationFromCounts([+ {+ file: ASSET_ROW_PATH,+ lint: { errorCount: 1, warningCount: 0 },+ links: { errorCount: 0, warningCount: 0 },+ },+ ]);+ });+ await waitFor(() => expect(findBadge(ASSET_ROW_PATH)).not.toBeNull());++ await clickBadge(findBadge(ASSET_ROW_PATH) as HTMLElement);++ expect(events).toEqual([`open-asset:${ASSET_ROW_PATH}:preview`]);+ });++ test('a file-list refresh preserves a focused badge in place', async () => {+ await renderTreeWithProblems();+ const badge = findBadge(PROBLEM_ROW_PATH);+ expect(badge).not.toBeNull();+ badge?.focus();+ expect(shadowRoot().activeElement).toBe(badge);+ const initialDocumentFetches = fetchSpy.mock.calls.filter(([input]) =>+ String(input).startsWith('/api/documents'),+ ).length;++ listedDocuments = [+ ...DOCUMENTS,+ {+ kind: 'document',+ docName: 'notes/new',+ docExt: '.md',+ size: 1,+ modified: '2026-08-18T00:00:00.000Z',+ },+ ];+ act(() => emitDocumentsChanged(['files']));+ await waitFor(() => {+ const documentFetches = fetchSpy.mock.calls.filter(([input]) =>+ String(input).startsWith('/api/documents'),+ ).length;+ expect(documentFetches).toBeGreaterThan(initialDocumentFetches);+ });++ expect(findBadge(PROBLEM_ROW_PATH)).toBe(badge);+ expect(shadowRoot().activeElement).toBe(badge);+ });++ test('a badge re-applied by a later validation update still activates exactly once', async () => {+ await renderTreeWithProblems();+ // A store update re-runs the whole indicator pass over the same badge,+ // which is where a listener-per-pass implementation would start stacking.+ setProblemCounts(5);+ setProblemCounts(3);++ await clickBadge(findBadge(PROBLEM_ROW_PATH) as HTMLElement);++ expect(events).toEqual([`open:${PROBLEM_DOC_NAME}:preview`, 'tab:problems:doc:no-focus']);+ });++ test('activation reads the latest render, not the one that installed it', async () => {+ const view = await renderTreeWithProblems();+ // The pass runs from an effect that does not re-run per render, so the+ // handler it installed has to resolve settings as of the click.+ mergedConfig = { editor: { previewTabs: false } };+ view.rerender(<FileTree />);++ await clickBadge(findBadge(PROBLEM_ROW_PATH) as HTMLElement);++ expect(events).toEqual([`open:${PROBLEM_DOC_NAME}:permanent`, 'tab:problems:doc:no-focus']);+ });+});diff --git a/packages/app/src/components/FileTree.tsx b/packages/app/src/components/FileTree.tsxindex a1c9eeae8..bfd7597d5 100644--- a/packages/app/src/components/FileTree.tsx+++ b/packages/app/src/components/FileTree.tsx@@ -43,6 +43,7 @@ import {} from 'react';import { toast } from 'sonner';import { DeleteConfirmationDialog } from '@/components/DeleteConfirmationDialog';+import { requestDocPanelTab } from '@/components/doc-panel-events';import {FileTargetMenuItems,type FileTargetMenuPrimitives,@@ -127,6 +128,7 @@ import {import {applyProblemIndicators,FILE_TREE_PROBLEM_CSS,+ OK_PROBLEM_BADGE_ATTR,} from '@/components/file-tree-problem-indicators';import {applyRenameInputAffordance,@@ -1019,14 +1021,17 @@ export function FileTree({ ref }: { ref?: Ref<FileTreeHandle | null> }) {setSkillsSidebar(false);notifySidebarFileSelected();}- function activateTreePath(treePath: string, entries: readonly FileEntry[] = documents) {+ function activateTreePath(+ treePath: string,+ entries: readonly FileEntry[] = documents,+ ): 'doc' | 'non-doc' | 'none' {const action = resolveFileTreeSelectionAction(treePath, entries);if (action.kind === 'none') {console.debug('[FileTree] Dropped selection for unknown docName:',treePathToAppPath(treePath),);- return;+ return 'none';}if (action.kind === 'asset') {openTarget(@@ -1040,11 +1045,11 @@ export function FileTree({ ref }: { ref?: Ref<FileTreeHandle | null> }) {);pushHashWithoutNavigation(action.hash);notifySidebarFileSelected();- return;+ return 'non-doc';}if (action.kind === 'folder') {navigateWithPulse({ kind: 'folder', folderPath: action.path });- return;+ return 'non-doc';}const docEntry = entries.find((item): item is DocumentEntry => isDocumentEntry(item) && item.docName === action.path,@@ -1064,11 +1069,11 @@ export function FileTree({ ref }: { ref?: Ref<FileTreeHandle | null> }) {openTarget(okTarget, previewOpenOptions);pushHashWithoutNavigation(hashFromAssetPath(okTarget.assetPath));notifySidebarFileSelected();- return;+ return 'non-doc';}if (okTarget?.kind === 'doc') {navigateWithPulse({ kind: 'doc', docName: okTarget.docName });- return;+ return 'doc';}navigateWithPulse({kind: 'doc',@@ -1076,6 +1081,7 @@ export function FileTree({ ref }: { ref?: Ref<FileTreeHandle | null> }) {size: docEntry?.size,registerPage: hasSupportedDocumentExtension(action.path),});+ return 'doc';}const activeDocNameRef = useRef(activeDocName);const assetTreePaths = new Set(@@ -2640,6 +2646,30 @@ export function FileTree({ ref }: { ref?: Ref<FileTreeHandle | null> }) {// this component but would leave every chip already on screen in the old// language until the tree next mutated or an audit landed.const problemIndicatorsEnabled = merged?.validation?.fileTreeIndicators !== false;+ /**+ * A row's problem badge asks about that row's file, so activation opens that+ * row first and only then asks for the panel — the panel lists problems for+ * whatever doc is active when it opens.+ *+ * `activateTreePath` rather than a navigation built from the badge's own+ * docName: it is the single resolver that already knows about tree paths with+ * no matching document, asset rows, and the read-only reroute a revealed+ * `.ok` doc takes. A badge has to land exactly where a click on its own row+ * would, and reaching past the resolver is how those three diverge.+ *+ * An effect event rather than a plain closure: the pass below installs this+ * on a badge from an effect that does not re-run per render, so it has to+ * resolve the navigation deps as of the click, not as of the install.+ */+ const openProblemsForTreePath = useEffectEvent(+ (treePath: string, source: 'pointer' | 'keyboard') => {+ if (activateTreePath(treePath) !== 'doc') return;+ requestDocPanelTab('problems', {+ scope: 'doc',+ focus: source === 'keyboard' ? 'panel' : undefined,+ });+ },+ );// biome-ignore lint/correctness/useExhaustiveDependencies: i18n.locale is an intentional re-run trigger, not a value the body reads; the strings it controls are written inside applyProblemIndicators.useEffect(() => {if (loading || documents.length === 0) return;@@ -2651,7 +2681,8 @@ export function FileTree({ ref }: { ref?: Ref<FileTreeHandle | null> }) {applyProblemIndicators(shadow, new Map());return;}- const apply = () => applyProblemIndicators(shadow, getValidationSnapshot());+ const apply = () =>+ applyProblemIndicators(shadow, getValidationSnapshot(), openProblemsForTreePath);apply();const observer = new MutationObserver(apply);observer.observe(shadow, {@@ -2664,6 +2695,10 @@ export function FileTree({ ref }: { ref?: Ref<FileTreeHandle | null> }) {return () => {observer.disconnect();unsubscribe();+ // Dependency changes also run this cleanup. Stripping a focused badge+ // here would move focus back to its row during unrelated file-list or+ // locale updates; the next pass updates badges in place, while an actual+ // unmount removes the shadow host with them.};}, [loading, documents.length, problemIndicatorsEnabled, i18n.locale]);@@ -3372,6 +3407,13 @@ export function FileTree({ ref }: { ref?: Ref<FileTreeHandle | null> }) {if (event.defaultPrevented || event.button !== 0) return;if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;+ // A row's problem badge is a control of its own and answers this click+ // itself. Letting the row resolve it as well navigates twice for one+ // gesture, down two different resolution paths. The badge cannot prevent+ // that by stopping propagation: this handler runs in the capture phase,+ // before the badge's own listener ever sees the event.+ if (eventPathHasProblemBadge(event.nativeEvent)) return;+// Pierre only emits selection changes when the selected path changes.// If app navigation lags behind the selected row, a plain click on that// already-selected row still needs to activate the row's target.@@ -3774,6 +3816,20 @@ function findTreeItemElement(event: MouseEvent): HTMLElement | null {return null;}+/**+ * Whether the click started on a problem badge. Walks the composed path rather+ * than reading `event.target`, which retargets to the shadow host for any+ * listener outside Pierre's shadow root.+ */+function eventPathHasProblemBadge(event: MouseEvent): boolean {+ for (const entry of event.composedPath()) {+ if (entry instanceof HTMLElement && entry.hasAttribute(OK_PROBLEM_BADGE_ATTR)) {+ return true;+ }+ }+ return false;+}+function findTreeVirtualizedRootElement(event: MouseEvent): HTMLElement | null {for (const entry of event.composedPath()) {if (entry instanceof HTMLElement && entry.matches('[data-file-tree-virtualized-root]')) {diff --git a/packages/app/src/components/NoteWindowMainActionReceiver.dom.test.ts b/packages/app/src/components/NoteWindowMainActionReceiver.dom.test.tsindex 37e1c8525..2a84a7c9b 100644--- a/packages/app/src/components/NoteWindowMainActionReceiver.dom.test.ts+++ b/packages/app/src/components/NoteWindowMainActionReceiver.dom.test.ts@@ -1,4 +1,10 @@import { describe, expect, test } from 'vitest';+import {+ consumePendingDocPanelRequest,+ consumePendingDocPanelTabRequest,+ requestDocPanelTab,+ subscribeToDocPanelTabRequests,+} from '@/components/doc-panel-events';import { subscribeToActiveTerminalInput } from '@/components/handoff/terminal-input-events';import { subscribeToTerminalLaunchRequests } from '@/components/handoff/terminal-launch-events';import { subscribeToAgentThreadLaunchRequests } from '@/components/handoff/thread-launch-events';@@ -50,4 +56,26 @@ describe('dispatchNoteWindowMainAction', () => {]);for (const stop of unsubscribe) stop();});++ test('routes comment reveals through the owning renderer target', () => {+ const target = new EventTarget();+ const received: string[] = [];+ const unsubscribe = subscribeToDocPanelTabRequests((tab) => received.push(tab), target);++ dispatchNoteWindowMainAction(+ { kind: 'reveal-comments', scope: 'doc', docName: 'notes/alpha' },+ target,+ );++ expect(received).toEqual(['comments']);+ expect(consumePendingDocPanelTabRequest()).toBeNull();+ unsubscribe();+ });++ test('does not latch detailed requests addressed to a foreign renderer target', () => {+ requestDocPanelTab('problems', { scope: 'doc', focus: 'panel' }, new EventTarget());++ expect(consumePendingDocPanelRequest('problems')).toBeNull();+ expect(consumePendingDocPanelTabRequest()).toBeNull();+ });});diff --git a/packages/app/src/components/NoteWindowMainActionReceiver.tsx b/packages/app/src/components/NoteWindowMainActionReceiver.tsxindex e6306328a..ee6ef6bcb 100644--- a/packages/app/src/components/NoteWindowMainActionReceiver.tsx+++ b/packages/app/src/components/NoteWindowMainActionReceiver.tsx@@ -44,7 +44,7 @@ export function dispatchNoteWindowMainAction(revealQueue();return;}- requestDocPanelTab('comments', target);+ requestDocPanelTab('comments', {}, target);if (typeof window === 'undefined' || target !== window) return;const nextHash = hashFromDocName(action.docName);if (!isSameHash(window.location.hash, nextHash)) window.location.hash = nextHash;diff --git a/packages/app/src/components/ProblemsPanel.dom.test.tsx b/packages/app/src/components/ProblemsPanel.dom.test.tsxindex 695c06fe5..9d18949f6 100644--- a/packages/app/src/components/ProblemsPanel.dom.test.tsx+++ b/packages/app/src/components/ProblemsPanel.dom.test.tsx@@ -8,7 +8,14 @@*/import type { LintDiagnostic, ValidationAuditResponse } from '@inkeep/open-knowledge-core';-import { cleanup, fireEvent, render as rtlRender, screen, waitFor } from '@testing-library/react';+import {+ act,+ cleanup,+ fireEvent,+ render as rtlRender,+ screen,+ waitFor,+} from '@testing-library/react';import type { ReactElement, ReactNode } from 'react';import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest';import { SWEEP_PROGRESS_CHUNK, sweepProgressInterval } from '@/components/problems-sweep';@@ -133,6 +140,9 @@ const { __resetProjectFixSweepForTests } = await import('@/lib/project-fix-sweepconst { consumePendingSourceNavigation, clearPendingSourceNavigationsForTest } = await import('@/editor/source-editor-navigation');+// The real bus, deliberately unmocked: the scope tests raise a request exactly+// the way the file tree's problem badge does.+const { consumePendingDocPanelRequest, requestDocPanelTab } = await import('./doc-panel-events');/** Diagnostic at a 1-based line/column (the display convention these tests assert). */function diag(over: Partial<LintDiagnostic> & { line?: number; column?: number }): LintDiagnostic {@@ -247,6 +257,9 @@ afterEach(() => {clearPendingSourceNavigationsForTest();__resetProjectFixSweepForTests();window.location.hash = '';+ // Production expiry owns abandoned requests; the explicit drain keeps this+ // synchronous test boundary deterministic even under fake timers.+ consumePendingDocPanelRequest('problems');});/**@@ -1736,6 +1749,108 @@ describe('ProblemsPanel — project scope', () => {});});+describe('ProblemsPanel — scoped tab requests', () => {+ /** Put a freshly rendered panel into project scope with a settled plane. */+ async function showProjectScope() {+ runLintAuditImpl = async () =>+ auditResult({ files: [{ file: 'guides/setup.md', diagnostics: [diag({})] }] });+ fireEvent.click(screen.getByTestId('panel-scope-project'));+ await waitFor(() => expect(screen.getByText('guides/setup.md')).toBeTruthy());+ }++ test('a doc-scoped problems request pulls a project-scope panel back to this doc', async () => {+ render(+ <ProblemsPanel docName="notes" diagnostics={[diag({ line: 1, message: 'Hard tabs' })]} />,+ );+ await showProjectScope();++ act(() => requestDocPanelTab('problems', { scope: 'doc' }));++ expect(screen.queryByTestId('problems-project-scope')).toBeNull();+ expect(screen.getByTestId('panel-scope-doc').getAttribute('data-state')).toBe('on');+ expect(screen.getByText('Hard tabs')).toBeTruthy();+ });++ test('leaves the scope alone for another tab and for a request carrying no scope', async () => {+ render(<ProblemsPanel docName="notes" diagnostics={[]} />);+ await showProjectScope();++ act(() => requestDocPanelTab('comments', { scope: 'doc' }));+ expect(screen.getByTestId('problems-project-scope')).toBeTruthy();++ act(() => requestDocPanelTab('problems'));+ expect(screen.getByTestId('problems-project-scope')).toBeTruthy();+ });++ test('scope and keyboard focus named before the panel existed reach it on mount', async () => {+ runLintAuditImpl = async () =>+ auditResult({ files: [{ file: 'guides/setup.md', diagnostics: [diag({})] }] });+ // The request that names the Problems tab is what mounts this panel, so it+ // goes out with nobody subscribed. Delivering only over the wire would drop+ // the scope and leave the panel on its own default.+ act(() => requestDocPanelTab('problems', { scope: 'project', focus: 'panel' }));++ render(<ProblemsPanel docName="notes" diagnostics={[]} />);++ await waitFor(() => expect(screen.getByText('guides/setup.md')).toBeTruthy());+ expect(screen.getByTestId('panel-scope-project').getAttribute('data-state')).toBe('on');+ expect(document.activeElement).toBe(screen.getByTestId('problems-panel'));+ });++ test('pointer-style requests preserve focus while keyboard requests move it to the panel', () => {+ render(<ProblemsPanel docName="notes" diagnostics={[]} />);+ const prior = document.createElement('button');+ document.body.appendChild(prior);+ prior.focus();++ act(() => requestDocPanelTab('problems', { scope: 'doc' }));+ expect(document.activeElement).toBe(prior);++ act(() => requestDocPanelTab('problems', { scope: 'doc', focus: 'panel' }));+ expect(document.activeElement).toBe(screen.getByTestId('problems-panel'));+ prior.remove();+ });++ test('a latched scope is spent once, not re-applied to the next panel', async () => {+ runLintAuditImpl = async () =>+ auditResult({ files: [{ file: 'guides/setup.md', diagnostics: [diag({})] }] });+ act(() => requestDocPanelTab('problems', { scope: 'project' }));+ const first = render(<ProblemsPanel docName="notes" diagnostics={[]} />);+ await waitFor(() => expect(screen.getByText('guides/setup.md')).toBeTruthy());+ first.unmount();++ render(<ProblemsPanel docName="notes" diagnostics={[]} />);++ expect(screen.getByTestId('panel-scope-doc').getAttribute('data-state')).toBe('on');+ });++ test('a live panel consumes the scope, leaving nothing for the next mount', async () => {+ render(<ProblemsPanel docName="notes" diagnostics={[]} />);+ await showProjectScope();++ act(() => requestDocPanelTab('problems', { scope: 'doc' }));+ cleanup();+ render(<ProblemsPanel docName="notes" diagnostics={[]} />);++ // Nothing latched, so this panel lands on its own default rather than+ // re-running a scope the previous panel already answered.+ expect(screen.getByTestId('panel-scope-doc').getAttribute('data-state')).toBe('on');+ });++ test('stops honoring scoped requests once the panel unmounts', () => {+ runLintAuditImpl = async () => auditResult();+ const { unmount } = render(<ProblemsPanel docName="notes" diagnostics={[]} />);+ unmount();++ // A leaked subscription would run the scope change against the dead panel;+ // asking for project scope is what makes that observable, because a first+ // project activation fetches the audit plane.+ act(() => requestDocPanelTab('problems', { scope: 'project' }));++ expect(auditCalls).toBe(0);+ });+});+describe('ProblemsPanel — project scope: collapse and expand-all', () => {const twoFileAudit = () =>auditResult({diff --git a/packages/app/src/components/ProblemsPanel.tsx b/packages/app/src/components/ProblemsPanel.tsxindex 11f5cdc50..6e87af4e9 100644--- a/packages/app/src/components/ProblemsPanel.tsx+++ b/packages/app/src/components/ProblemsPanel.tsx@@ -21,8 +21,22 @@ import {Sparkles,Wrench,} from 'lucide-react';-import { type ReactElement, type ReactNode, useEffect, useRef, useState } from 'react';+import {+ type ReactElement,+ type ReactNode,+ useEffect,+ useEffectEvent,+ useId,+ useRef,+ useState,+} from 'react';import { toast } from 'sonner';+import type { PanelTab } from '@/components/DocPanel';+import {+ consumePendingDocPanelRequest,+ type DocPanelTabRequest,+ subscribeToDocPanelTabRequests,+} from '@/components/doc-panel-events';import { useOptionalPageList } from '@/components/PageListContext';import { type PanelScope, PanelScopeHeader } from '@/components/PanelScopeHeader';import { LINT_PLUGIN_META, type LintPluginMeta } from '@/components/settings/lint-plugin-meta';@@ -605,6 +619,8 @@ export function ProblemsPanel({onFixWithAi?: (scope: PanelScope) => void;}) {const { t } = useLingui();+ const panelRef = useRef<HTMLElement>(null);+ const panelTitleId = useId();const [scope, setScope] = useState<PanelScope>('doc');// Which lint plugins actually check content, from the server-resolved// effective config (the same truth the diagnostics come from). Null while@@ -782,6 +798,29 @@ export function ProblemsPanel({[],);+ // A request that names a scope was raised on behalf of one document (the file+ // tree's problem badge), so it overrides whatever scope the user last left the+ // panel in — otherwise a panel parked in project scope answers a question+ // about one file with the whole project. Keyboard activation also moves focus+ // to the panel so the user's next Tab continues from the content they opened;+ // pointer activation preserves pointer focus. The subscription is installed+ // once, while the Effect Event reads the latest scope and audit state.+ const onDocPanelTabRequest = useEffectEvent((tab: PanelTab, request: DocPanelTabRequest) => {+ if (tab !== 'problems') return;+ // Handled live, so no part of this request stays latched for a later mount.+ consumePendingDocPanelRequest('problems');+ if (request.scope !== undefined) handleScopeChange(request.scope);+ if (request.focus === 'panel') panelRef.current?.focus({ preventScroll: true });+ });+ useEffect(() => {+ // The request that switches TO this tab is what mounts this panel, so it+ // went out before this subscription existed. The latch is the only way that+ // scope and focus intent reach the panel they were addressed to.+ const pending = consumePendingDocPanelRequest('problems');+ if (pending !== null) onDocPanelTabRequest('problems', pending);+ return subscribeToDocPanelTabRequests(onDocPanelTabRequest);+ }, []);+// A settled sweep leaves the loaded plane describing problems it just fixed.// Refresh it in place — but only for a panel that is actually mounted and// showing one; a sweep that outlives this panel has nothing to refresh, and@@ -878,10 +917,10 @@ export function ProblemsPanel({}return (- <Panel>+ <Panel ref={panelRef} tabIndex={-1} aria-labelledby={panelTitleId} data-testid="problems-panel"><PanelHeader><div className="flex min-w-0 items-center gap-2">- <PanelTitle>+ <PanelTitle id={panelTitleId}><Trans>Problems</Trans></PanelTitle>{activePlugins !== null && activePlugins.length > 0 && (diff --git a/packages/app/src/components/doc-panel-events.test.ts b/packages/app/src/components/doc-panel-events.test.tsindex 27c8d91b7..689d9252c 100644--- a/packages/app/src/components/doc-panel-events.test.ts+++ b/packages/app/src/components/doc-panel-events.test.ts@@ -1,10 +1,16 @@-import { describe, expect, test, vi } from 'vitest';+import { afterEach, describe, expect, test, vi } from 'vitest';import {+ consumePendingDocPanelRequest,consumePendingDocPanelTabRequest,requestDocPanelTab,subscribeToDocPanelTabRequests,} from './doc-panel-events';+afterEach(() => {+ vi.useRealTimers();+ vi.unstubAllGlobals();+});+describe('doc-panel-events', () => {test('dispatches and subscribes tab requests through the shared event name', () => {const target = new EventTarget();@@ -12,15 +18,141 @@ describe('doc-panel-events', () => {const unsubscribe = subscribeToDocPanelTabRequests(onRequest, target);consumePendingDocPanelTabRequest();- requestDocPanelTab('graph', target);+ requestDocPanelTab('graph', {}, target);expect(onRequest).toHaveBeenCalledTimes(1);- expect(onRequest).toHaveBeenCalledWith('graph');+ expect(onRequest).toHaveBeenCalledWith('graph', { scope: undefined, focus: undefined });expect(consumePendingDocPanelTabRequest()).toBe('graph');unsubscribe();- requestDocPanelTab('outline', target);+ requestDocPanelTab('outline', {}, target);expect(onRequest).toHaveBeenCalledTimes(1);expect(consumePendingDocPanelTabRequest()).toBe('outline');});++ test('carries a requested panel scope to subscribers, and omits it otherwise', () => {+ const target = new EventTarget();+ const onRequest = vi.fn(() => {});++ const unsubscribe = subscribeToDocPanelTabRequests(onRequest, target);+ requestDocPanelTab('problems', { scope: 'doc' }, target);+ expect(onRequest).toHaveBeenLastCalledWith('problems', {+ scope: 'doc',+ focus: undefined,+ });++ requestDocPanelTab('problems', {}, target);+ expect(onRequest).toHaveBeenLastCalledWith('problems', {+ scope: undefined,+ focus: undefined,+ });++ unsubscribe();+ consumePendingDocPanelTabRequest();+ consumePendingDocPanelRequest('problems');+ });++ test('latches request details for the panel that the request itself mounts', () => {+ const target = new EventTarget();+ // Nobody is listening: the tab this names is not on screen, so the panel+ // that owns the scope has not mounted and cannot have subscribed.+ requestDocPanelTab('problems', { scope: 'project', focus: 'panel' }, target);++ expect(consumePendingDocPanelRequest('problems')).toEqual({+ scope: 'project',+ focus: 'panel',+ });+ // Once only — a second mount must not re-apply a request already delivered.+ expect(consumePendingDocPanelRequest('problems')).toBeNull();+ consumePendingDocPanelTabRequest();+ });++ test('the latched scope is addressed to one tab and no other', () => {+ const target = new EventTarget();+ requestDocPanelTab('comments', { scope: 'project' }, target);++ expect(consumePendingDocPanelRequest('problems')).toBeNull();+ expect(consumePendingDocPanelRequest('comments')).toEqual({ scope: 'project' });+ consumePendingDocPanelTabRequest();+ });++ test('a tab-only request clears a scope an earlier request left latched', () => {+ const target = new EventTarget();+ requestDocPanelTab('problems', { scope: 'project' }, target);+ // "Show this tab" says nothing about scope, so it must not deliver the+ // previous request's scope to whatever mounts next.+ requestDocPanelTab('problems', {}, target);++ expect(consumePendingDocPanelRequest('problems')).toBeNull();+ consumePendingDocPanelTabRequest();+ });++ test('retires request details that no resulting panel consumes', async () => {+ const target = new EventTarget();+ requestDocPanelTab('problems', { scope: 'doc', focus: 'panel' }, target);++ await new Promise((resolve) => setTimeout(resolve, 0));++ expect(consumePendingDocPanelRequest('problems')).toBeNull();+ consumePendingDocPanelTabRequest();+ });++ test('keeps request details through the commit frame and expires them after the next frame', () => {+ const frames = new Map<number, FrameRequestCallback>();+ let nextFrameId = 0;+ vi.stubGlobal(+ 'requestAnimationFrame',+ vi.fn((callback: FrameRequestCallback) => {+ nextFrameId += 1;+ frames.set(nextFrameId, callback);+ return nextFrameId;+ }),+ );+ vi.stubGlobal(+ 'cancelAnimationFrame',+ vi.fn((frameId: number) => frames.delete(frameId)),+ );++ const target = new EventTarget();+ requestDocPanelTab('problems', { scope: 'doc', focus: 'panel' }, target);++ const commitFrame = frames.get(1);+ expect(commitFrame).toBeDefined();+ frames.delete(1);+ commitFrame?.(0);++ expect(consumePendingDocPanelRequest('problems')).toEqual({+ scope: 'doc',+ focus: 'panel',+ });++ requestDocPanelTab('problems', { scope: 'doc', focus: 'panel' }, target);+ const nextCommitFrame = frames.get(3);+ expect(nextCommitFrame).toBeDefined();+ frames.delete(3);+ nextCommitFrame?.(16);++ const expiryFrame = frames.get(4);+ expect(expiryFrame).toBeDefined();+ frames.delete(4);+ expiryFrame?.(32);++ expect(consumePendingDocPanelRequest('problems')).toBeNull();+ consumePendingDocPanelTabRequest();+ });++ test('expires request details on a wall-clock backstop when frames are suspended', () => {+ vi.useFakeTimers();+ vi.stubGlobal(+ 'requestAnimationFrame',+ vi.fn(() => 1),+ );+ vi.stubGlobal('cancelAnimationFrame', vi.fn());++ requestDocPanelTab('problems', { scope: 'doc', focus: 'panel' }, new EventTarget());+ vi.advanceTimersByTime(250);++ expect(consumePendingDocPanelRequest('problems')).toBeNull();+ consumePendingDocPanelTabRequest();+ });});diff --git a/packages/app/src/components/doc-panel-events.ts b/packages/app/src/components/doc-panel-events.tsindex aada2470d..b5b05d927 100644--- a/packages/app/src/components/doc-panel-events.ts+++ b/packages/app/src/components/doc-panel-events.ts@@ -1,12 +1,35 @@import type { PanelTab } from './DocPanel';+import type { PanelScope } from './PanelScopeHeader';type DocPanelTab = PanelTab;const DOC_PANEL_TAB_EVENT = 'open-knowledge:doc-panel-tab';let pendingRequestedTab: DocPanelTab | null = null;-interface DocPanelTabDetail {- tab: DocPanelTab;+/**+ * What a request asks of the receiving panel beyond which tab to show. Every+ * field is optional and an absent one means "leave that alone", so a plain+ * "show this tab" request never overrides state the user chose themselves.+ */+export interface DocPanelTabRequest {+ /** Scope the receiving panel should switch to, for requests made on behalf of+ * a specific document (a file row's problem badge) rather than the open one. */+ readonly scope?: PanelScope;+ /** Move focus into the requested panel after a keyboard activation. */+ readonly focus?: 'panel';+}++type DocPanelTabRequestHandler = (tab: DocPanelTab, request: DocPanelTabRequest) => void;++type DocPanelTabEventTarget = Pick<Window, 'dispatchEvent'> | EventTarget;++interface DocPanelTabDetail extends DocPanelTabRequest {+ readonly tab: DocPanelTab;+}++/** A detached target keeps a non-browser import (SSR, node test) from throwing. */+function defaultTarget(): EventTarget {+ return typeof window === 'undefined' ? new EventTarget() : window;}export function consumePendingDocPanelTabRequest(): DocPanelTab | null {@@ -15,33 +38,118 @@ export function consumePendingDocPanelTabRequest(): DocPanelTab | null {return next;}+/**+ * Latch for request details that go out before their panel exists to hear them.+ *+ * `DocPanel` mounts a tab's body only while that tab is showing, so a request+ * that switches TO a tab only schedules the mount — the panel it names has not+ * subscribed by the time the event dispatches, and details delivered only over+ * the wire land in an empty room. Keyed by tab so intent meant for one panel+ * cannot be picked up by another. A live subscriber clears it; a panel mounting+ * afterwards consumes it instead. Latching the whole request keeps future+ * fields from silently inheriting the same delivery hole.+ *+ * `comments/reveal-queue.ts` carries the same latch for the Comments tab's+ * scope, on a channel of its own that predates this field. The two have not+ * been merged: `revealComments` becomes expressible here once the comment+ * scope moves onto this request, and until someone does that migration the+ * older channel stays the Comments tab's only route. An unconsumed request+ * expires after the next browser paint: the latch bridges the resulting React+ * commit and passive effects without depending on discrete-event scheduling,+ * but cannot change an unrelated navigation later in the session.+ */+let pendingPanelRequest: { tab: DocPanelTab; request: DocPanelTabRequest } | null = null;+let cancelPendingPanelRequestExpiry: (() => void) | null = null;++function clearPendingPanelRequest(): void {+ pendingPanelRequest = null;+ cancelPendingPanelRequestExpiry?.();+ cancelPendingPanelRequestExpiry = null;+}++function schedulePendingPanelRequestExpiry(+ pending: NonNullable<typeof pendingPanelRequest>,+): () => void {+ let firstFrame: number | null = null;+ let secondFrame: number | null = null;+ let backstop: ReturnType<typeof setTimeout> | null = null;+ const cancel = () => {+ if (typeof cancelAnimationFrame === 'function') {+ if (firstFrame !== null) cancelAnimationFrame(firstFrame);+ if (secondFrame !== null) cancelAnimationFrame(secondFrame);+ }+ if (backstop !== null) clearTimeout(backstop);+ if (cancelPendingPanelRequestExpiry === cancel) {+ cancelPendingPanelRequestExpiry = null;+ }+ };+ const expire = () => {+ if (pendingPanelRequest === pending) pendingPanelRequest = null;+ cancel();+ };+ if (typeof requestAnimationFrame === 'function') {+ firstFrame = requestAnimationFrame(() => {+ firstFrame = null;+ secondFrame = requestAnimationFrame(() => {+ secondFrame = null;+ expire();+ });+ });+ // Hidden or occluded windows may suspend animation frames indefinitely.+ // Bound the latch even when no paint arrives.+ backstop = setTimeout(expire, 250);+ } else {+ backstop = setTimeout(expire, 0);+ }+ return cancel;+}++function shouldLatchForTarget(target: DocPanelTabEventTarget): boolean {+ return typeof window === 'undefined' || target === window;+}++/** Details a request named for `tab` and no live subscriber took, once. */+export function consumePendingDocPanelRequest(tab: DocPanelTab): DocPanelTabRequest | null {+ if (pendingPanelRequest?.tab !== tab) return null;+ const { request } = pendingPanelRequest;+ clearPendingPanelRequest();+ return request;+}+export function requestDocPanelTab(tab: DocPanelTab,- target: Pick<Window, 'dispatchEvent'> | EventTarget = typeof window === 'undefined'- ? new EventTarget()- : window,+ request: DocPanelTabRequest = {},+ // A request raised inside a popped-out note window addresses that window+ // rather than the main one, so the target stays overridable.+ target: DocPanelTabEventTarget = defaultTarget(),): void {- pendingRequestedTab = tab;+ if (shouldLatchForTarget(target)) {+ pendingRequestedTab = tab;+ clearPendingPanelRequest();+ if (request.scope !== undefined || request.focus !== undefined) {+ const pending = { tab, request };+ pendingPanelRequest = pending;+ // A second animation frame runs after the React commit's passive effects,+ // including the subscriber mounted by this request. The timeout fallback+ // retains deterministic expiry for non-browser imports and tests.+ cancelPendingPanelRequestExpiry = schedulePendingPanelRequestExpiry(pending);+ }+ }target.dispatchEvent(new CustomEvent<DocPanelTabDetail>(DOC_PANEL_TAB_EVENT, {- detail: { tab },+ detail: { tab, ...request },}),);}export function subscribeToDocPanelTabRequests(- onRequest: (tab: DocPanelTab) => void,- target: Pick<Window, 'addEventListener' | 'removeEventListener'> | EventTarget = typeof window ===- 'undefined'- ? new EventTarget()- : window,+ onRequest: DocPanelTabRequestHandler,+ target: Pick<Window, 'addEventListener' | 'removeEventListener'> | EventTarget = defaultTarget(),): () => void {const listener = (event: Event) => {- const tab =- event instanceof CustomEvent- ? (event as CustomEvent<DocPanelTabDetail>).detail?.tab- : undefined;- if (tab) onRequest(tab);+ const detail =+ event instanceof CustomEvent ? (event as CustomEvent<DocPanelTabDetail>).detail : undefined;+ if (detail?.tab) onRequest(detail.tab, { scope: detail.scope, focus: detail.focus });};target.addEventListener(DOC_PANEL_TAB_EVENT, listener as EventListener);return () => target.removeEventListener(DOC_PANEL_TAB_EVENT, listener as EventListener);diff --git a/packages/app/src/components/file-tree-problem-indicators.dom.test.tsx b/packages/app/src/components/file-tree-problem-indicators.dom.test.tsxindex 79afeb3db..c1dac9ada 100644--- a/packages/app/src/components/file-tree-problem-indicators.dom.test.tsx+++ b/packages/app/src/components/file-tree-problem-indicators.dom.test.tsx@@ -61,7 +61,7 @@ describe('applyProblemIndicators', () => {const errorBadge = errorRow?.querySelector(`[${OK_PROBLEM_BADGE_ATTR}]`);expect(errorBadge?.textContent).toBe('3');expect(errorBadge?.getAttribute('aria-label')).toBe(- '2 errors and 1 warning in this file. Open the Problems panel for details.',+ '3 problems. 2 errors and 1 warning in this file. Open the Problems panel for details.',);expect(errorBadge?.hasAttribute('aria-hidden')).toBe(false);@@ -70,7 +70,7 @@ describe('applyProblemIndicators', () => {const warningBadge = warningRow?.querySelector(`[${OK_PROBLEM_BADGE_ATTR}]`);expect(warningBadge?.textContent).toBe('4');expect(warningBadge?.getAttribute('aria-label')).toBe(- '4 warnings in this file. Open the Problems panel for details.',+ '4 problems. 4 warnings in this file. Open the Problems panel for details.',);const cleanRow = rows.get('clean.md');@@ -111,18 +111,45 @@ describe('applyProblemIndicators', () => {expect(rows.get('a.md')?.querySelectorAll(`[${OK_PROBLEM_BADGE_ATTR}]`)).toHaveLength(1);});+ test('a recycled row rebinds its existing badge to the current file', () => {+ const { root, rows } = buildTree(['a.md']);+ const row = rows.get('a.md');+ const activated: string[] = [];+ const onActivate = (treePath: string) => activated.push(treePath);+ applyProblemIndicators(root, new Map([['a', { errorCount: 1, warningCount: 0 }]]), onActivate);+ const badge = row?.querySelector<HTMLElement>(`[${OK_PROBLEM_BADGE_ATTR}]`);++ if (row) row.dataset.itemPath = 'b.md';+ applyProblemIndicators(root, new Map([['b', { errorCount: 0, warningCount: 2 }]]), onActivate);++ const reboundBadge = row?.querySelector<HTMLElement>(`[${OK_PROBLEM_BADGE_ATTR}]`);+ expect(reboundBadge).toBe(badge);+ expect(reboundBadge?.textContent).toBe('2');+ expect(reboundBadge?.getAttribute('aria-label')).toBe(+ '2 problems. 2 warnings in this file. Open the Problems panel for details.',+ );+ reboundBadge?.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true }));+ expect(activated).toEqual(['b.md']);+ });+test('counts above 99 clamp the badge label', () => {const { root, rows } = buildTree(['a.md']);applyProblemIndicators(root, new Map([['a', { errorCount: 100, warningCount: 50 }]]));- expect(rows.get('a.md')?.querySelector(`[${OK_PROBLEM_BADGE_ATTR}]`)?.textContent).toBe('99+');+ const badge = rows.get('a.md')?.querySelector(`[${OK_PROBLEM_BADGE_ATTR}]`);+ expect(badge?.textContent).toBe('99+');+ expect(badge?.getAttribute('aria-label')).toBe(+ '99+ problems. 100 errors and 50 warnings in this file. Open the Problems panel for details.',+ );});- test('badge carries its own hover tooltip, not just an accessible name', () => {+ test('badge carries its own hover tooltip and leads its accessible name with the visible count', () => {const { root, rows } = buildTree(['a.md']);applyProblemIndicators(root, new Map([['a', { errorCount: 0, warningCount: 1 }]]));const badge = rows.get('a.md')?.querySelector<HTMLElement>(`[${OK_PROBLEM_BADGE_ATTR}]`);expect(badge?.title).toBe('1 warning in this file. Open the Problems panel for details.');- expect(badge?.getAttribute('aria-label')).toBe(badge?.title);+ expect(badge?.getAttribute('aria-label')).toBe(+ '1 problem. 1 warning in this file. Open the Problems panel for details.',+ );// Without a name-from-author role the aria-label is dropped and a screen// reader announces the bare digit, which is the thing this fix is about.expect(badge?.getAttribute('role')).toBe('img');@@ -157,12 +184,325 @@ describe('applyProblemIndicators', () => {expect(badgeRule).not.toMatch(/pointer-events:\s*none/);});+ test('clicking the badge activates its own doc without selecting the row', () => {+ const { root, rows } = buildTree(['guides/a.md']);+ const activated: string[] = [];+ const rowClicks: number[] = [];+ rows.get('guides/a.md')?.addEventListener('click', () => rowClicks.push(1));++ applyProblemIndicators(+ root,+ new Map([['guides/a', { errorCount: 1, warningCount: 0 }]]),+ (treePath) => activated.push(treePath),+ );+ rows+ .get('guides/a.md')+ ?.querySelector<HTMLElement>(`[${OK_PROBLEM_BADGE_ATTR}]`)+ ?.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true }));++ expect(activated).toEqual(['guides/a.md']);+ // The row owns navigation for a row click; a badge click is its own intent+ // and must not also drive the row's selection.+ expect(rowClicks).toHaveLength(0);+ });++ test('the badge activates on Enter and on Space, and Space does not scroll the tree', () => {+ const { root, rows } = buildTree(['guides/a.md']);+ const activated: string[] = [];+ applyProblemIndicators(+ root,+ new Map([['guides/a', { errorCount: 1, warningCount: 0 }]]),+ (treePath) => activated.push(treePath),+ );+ const badge = rows.get('guides/a.md')?.querySelector<HTMLElement>(`[${OK_PROBLEM_BADGE_ATTR}]`);++ const enter = new KeyboardEvent('keydown', { key: 'Enter', bubbles: true, cancelable: true });+ badge?.dispatchEvent(enter);+ const space = new KeyboardEvent('keydown', { key: ' ', bubbles: true, cancelable: true });+ badge?.dispatchEvent(space);++ expect(activated).toEqual(['guides/a.md', 'guides/a.md']);+ // Space on a focused control otherwise scrolls the tree out from under it.+ expect(space.defaultPrevented).toBe(true);+ });++ test('keys the tree navigates with are left to the tree', () => {+ const { root, rows } = buildTree(['a.md']);+ const activated: string[] = [];+ const reachedRow: string[] = [];+ rows+ .get('a.md')+ ?.addEventListener('keydown', (event) => reachedRow.push((event as KeyboardEvent).key));++ applyProblemIndicators(root, new Map([['a', { errorCount: 1, warningCount: 0 }]]), (treePath) =>+ activated.push(treePath),+ );+ rows+ .get('a.md')+ ?.querySelector<HTMLElement>(`[${OK_PROBLEM_BADGE_ATTR}]`)+ ?.dispatchEvent(new KeyboardEvent('keydown', { key: 'ArrowDown', bubbles: true }));++ expect(activated).toHaveLength(0);+ // Swallowing arrows would strand focus on a badge with no way back to the+ // tree's own row navigation.+ expect(reachedRow).toEqual(['ArrowDown']);+ });++ test('an activatable badge announces exactly what the inert one announced', () => {+ const counts = new Map([['a', { errorCount: 2, warningCount: 1 }]]);+ const inert = buildTree(['a.md']);+ applyProblemIndicators(inert.root, counts);+ const inertBadge = inert.rows+ .get('a.md')+ ?.querySelector<HTMLElement>(`[${OK_PROBLEM_BADGE_ATTR}]`);++ const operable = buildTree(['a.md']);+ applyProblemIndicators(operable.root, counts, () => {});+ const operableBadge = operable.rows+ .get('a.md')+ ?.querySelector<HTMLElement>(`[${OK_PROBLEM_BADGE_ATTR}]`);++ expect(operableBadge?.getAttribute('role')).toBe('button');+ expect(operableBadge?.getAttribute('tabindex')).toBe('0');+ // Becoming operable must not cost the badge the explanation it already had.+ expect(operableBadge?.getAttribute('aria-label')).toBe(inertBadge?.getAttribute('aria-label'));+ expect(operableBadge?.title).toBe(inertBadge?.title);+ });++ test('a focused badge gets a ring instead of the outline reset it inherits', () => {+ // Same fidelity split as the hit-target test above: jsdom applies no+ // adopted stylesheet and matches no :focus-visible, so the declaration is+ // the observable here. `unified-problems.e2e.ts` reads the resolved ring+ // off a really-focused badge, which is the rung that can see paint.+ const withoutComments = FILE_TREE_PROBLEM_CSS.replace(/\/\*[\s\S]*?\*\//g, '');+ const focusRule = withoutComments.match(+ new RegExp(`\\[${OK_PROBLEM_BADGE_ATTR}\\]:focus-visible\\s*\\{([^}]*)\\}`),+ )?.[1];+ expect(focusRule).toBeDefined();+ expect(focusRule).toMatch(/outline:/);+ expect(focusRule).not.toMatch(/outline:\s*none/);+ });++ test('hover is pointer-gated and activation has its own pressed state', () => {+ const withoutComments = FILE_TREE_PROBLEM_CSS.replace(/\/\*[\s\S]*?\*\//g, '');+ expect(withoutComments).toMatch(+ new RegExp(+ `@media\\s*\\(hover:\\s*hover\\)[\\s\\S]*\\[${OK_PROBLEM_BADGE_ATTR}\\]\\[role='button'\\]:hover`,+ ),+ );+ expect(withoutComments).toMatch(+ new RegExp(`\\[${OK_PROBLEM_BADGE_ATTR}\\]\\[role='button'\\]:active\\s*\\{`),+ );+ });++ test('the badge keeps a shape under forced colors, and severity stays readable', () => {+ // Same fidelity split as the focus-ring test: jsdom evaluates no media+ // query, so the declaration is the observable. Forced colors overrides the+ // chip's translucent background with the system canvas, which would leave+ // the badge as a bare digit and make error and warning identical, so the+ // border is what keeps it a chip and keeps the two apart.+ const withoutComments = FILE_TREE_PROBLEM_CSS.replace(/\/\*[\s\S]*?\*\//g, '');+ const forcedColorsBlock = withoutComments.match(+ /@media\s*\(forced-colors:\s*active\)\s*\{([\s\S]*)\}/,+ )?.[1];+ expect(forcedColorsBlock).toBeDefined();+ expect(forcedColorsBlock).toMatch(+ new RegExp(`\\[${OK_PROBLEM_BADGE_ATTR}\\]\\s*\\{[^}]*border:[^}]*CanvasText`),+ );+ expect(forcedColorsBlock).toMatch(+ new RegExp(`${OK_PROBLEM_ROW_ATTR}='error'[^{]*\\{[^}]*border-width:`),+ );+ });++ test('re-applying the pass does not stack activations on the badge', () => {+ const { root, rows } = buildTree(['a.md']);+ const counts = new Map([['a', { errorCount: 1, warningCount: 0 }]]);+ const activated: string[] = [];+ // The tree's MutationObserver re-runs the whole pass on every re-render, so+ // a badge outlives far more passes than clicks.+ for (let pass = 0; pass < 4; pass += 1) {+ applyProblemIndicators(root, counts, (treePath) => activated.push(treePath));+ }+ rows+ .get('a.md')+ ?.querySelector<HTMLElement>(`[${OK_PROBLEM_BADGE_ATTR}]`)+ ?.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true }));++ expect(activated).toEqual(['a.md']);+ });++ test('a later pass replaces the handler an earlier pass installed', () => {+ const { root, rows } = buildTree(['a.md']);+ const counts = new Map([['a', { errorCount: 1, warningCount: 0 }]]);+ const stale: string[] = [];+ const fresh: string[] = [];+ applyProblemIndicators(root, counts, (treePath) => stale.push(treePath));+ // Whatever the host passes on the latest pass is what the badge must answer+ // to — an earlier pass's handler cannot survive alongside it.+ applyProblemIndicators(root, counts, (treePath) => fresh.push(treePath));+ rows+ .get('a.md')+ ?.querySelector<HTMLElement>(`[${OK_PROBLEM_BADGE_ATTR}]`)+ ?.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true }));++ expect(stale).toHaveLength(0);+ expect(fresh).toEqual(['a.md']);+ });++ test("a modified click stays the tree's multi-select gesture", () => {+ const { root, rows } = buildTree(['a.md']);+ const activated: string[] = [];+ const reachedRow: string[] = [];+ const row = rows.get('a.md');+ row?.addEventListener('click', () => reachedRow.push('click'));+ applyProblemIndicators(root, new Map([['a', { errorCount: 1, warningCount: 0 }]]), (treePath) =>+ activated.push(treePath),+ );+ const badge = row?.querySelector<HTMLElement>(`[${OK_PROBLEM_BADGE_ATTR}]`);++ for (const modifier of ['metaKey', 'ctrlKey', 'shiftKey', 'altKey'] as const) {+ badge?.dispatchEvent(+ new MouseEvent('click', { bubbles: true, cancelable: true, [modifier]: true }),+ );+ }++ // The badge has no modified meaning, so it neither activates nor eats the+ // event: cmd-click adds a row to the selection and shift-click extends it,+ // and both resolve on the row the badge sits in.+ expect(activated).toHaveLength(0);+ expect(reachedRow).toHaveLength(4);+ });++ test("the host's ctrl/meta+Space selection chord reaches the row", () => {+ const { root, rows } = buildTree(['a.md']);+ const activated: string[] = [];+ const reachedRow: string[] = [];+ const row = rows.get('a.md');+ row?.addEventListener('keydown', () => reachedRow.push('keydown'));+ applyProblemIndicators(root, new Map([['a', { errorCount: 1, warningCount: 0 }]]), (treePath) =>+ activated.push(treePath),+ );+ const badge = row?.querySelector<HTMLElement>(`[${OK_PROBLEM_BADGE_ATTR}]`);++ const chord = new KeyboardEvent('keydown', {+ key: ' ',+ metaKey: true,+ bubbles: true,+ cancelable: true,+ });+ badge?.dispatchEvent(chord);++ expect(activated).toHaveLength(0);+ expect(reachedRow).toEqual(['keydown']);+ expect(chord.defaultPrevented).toBe(false);+ });++ test('holding the key down activates once, the way a real button does', () => {+ const { root, rows } = buildTree(['a.md']);+ const activated: Array<{ treePath: string; source: 'pointer' | 'keyboard' }> = [];+ applyProblemIndicators(+ root,+ new Map([['a', { errorCount: 1, warningCount: 0 }]]),+ (treePath, source) => activated.push({ treePath, source }),+ );+ const badge = rows.get('a.md')?.querySelector<HTMLElement>(`[${OK_PROBLEM_BADGE_ATTR}]`);++ badge?.dispatchEvent(+ new KeyboardEvent('keydown', { key: ' ', bubbles: true, cancelable: true }),+ );+ // Auto-repeat while the key is still held: one press, one activation.+ for (let tick = 0; tick < 3; tick += 1) {+ badge?.dispatchEvent(+ new KeyboardEvent('keydown', { key: ' ', repeat: true, bubbles: true, cancelable: true }),+ );+ }++ expect(activated).toEqual([{ treePath: 'a.md', source: 'keyboard' }]);+ });++ test('the operable badge claims a hit area the painted chip is too small for', () => {+ // jsdom resolves no layout, so the declaration is the observable; the e2e+ // measures the real box. The chip itself cannot grow — it has to stay beside+ // the file name in a 26px row — so the target is expanded around it, and+ // only for the variant that is actually a target.+ const withoutComments = FILE_TREE_PROBLEM_CSS.replace(/\/\*[\s\S]*?\*\//g, '');+ const hitArea = withoutComments.match(+ new RegExp(`\\[${OK_PROBLEM_BADGE_ATTR}\\]\\[role='button'\\]::after\\s*\\{([^}]*)\\}`),+ )?.[1];+ expect(hitArea).toBeDefined();+ expect(hitArea).toMatch(/position:\s*absolute/);+ // Negative block inset is what lifts the 16px chip over the 24px floor.+ expect(hitArea).toMatch(/inset:\s*-\d/);+ expect(+ withoutComments.match(+ new RegExp(`\\[${OK_PROBLEM_BADGE_ATTR}\\]\\[role='button'\\]\\s*\\{([^}]*)\\}`),+ )?.[1],+ ).toMatch(/position:\s*relative/);+ });++ test('dropping the activation handler retires the control instead of leaving it dead', () => {+ const { root, rows } = buildTree(['a.md']);+ const counts = new Map([['a', { errorCount: 1, warningCount: 0 }]]);+ const activated: string[] = [];+ applyProblemIndicators(root, counts, (treePath) => activated.push(treePath));+ applyProblemIndicators(root, counts);++ const badge = rows.get('a.md')?.querySelector<HTMLElement>(`[${OK_PROBLEM_BADGE_ATTR}]`);+ expect(badge?.getAttribute('role')).toBe('img');+ expect(badge?.hasAttribute('tabindex')).toBe(false);+ badge?.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true }));+ expect(activated).toHaveLength(0);+ });++ test('a healed row keeps nothing that could still fire', () => {+ const { root, rows } = buildTree(['a.md']);+ const activated: string[] = [];+ const onActivate = (treePath: string) => activated.push(treePath);+ applyProblemIndicators(root, new Map([['a', { errorCount: 1, warningCount: 0 }]]), onActivate);+ applyProblemIndicators(root, new Map(), onActivate);++ const row = rows.get('a.md');+ expect(row?.querySelector(`[${OK_PROBLEM_BADGE_ATTR}]`)).toBeNull();+ row?.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true }));+ expect(activated).toHaveLength(0);+ });++ test('a badge that heals while focused hands focus back to its row', () => {+ // The host renders rows as focusable buttons inside an open shadow root,+ // which is what makes `activeElement` observable at all. A file can heal+ // while its own badge holds focus, and removing the focused node without+ // this leaves focus on the body with the tree unreachable by keyboard.+ const host = document.createElement('div');+ document.body.appendChild(host);+ const shadow = host.attachShadow({ mode: 'open' });+ const row = document.createElement('button');+ row.setAttribute('data-type', 'item');+ row.setAttribute('data-item-path', 'a.md');+ const action = document.createElement('span');+ action.setAttribute('data-item-section', 'action');+ row.appendChild(action);+ shadow.appendChild(row);++ applyProblemIndicators(shadow, new Map([['a', { errorCount: 1, warningCount: 0 }]]), () => {});+ const badge = row.querySelector<HTMLElement>(`[${OK_PROBLEM_BADGE_ATTR}]`);+ badge?.focus();+ expect(shadow.activeElement).toBe(badge);++ applyProblemIndicators(shadow, new Map(), () => {});++ expect(row.querySelector(`[${OK_PROBLEM_BADGE_ATTR}]`)).toBeNull();+ expect(shadow.activeElement).toBe(row);+ host.remove();+ });+test('tooltip tracks the counts as they change', () => {const { root, rows } = buildTree(['a.md']);applyProblemIndicators(root, new Map([['a', { errorCount: 1, warningCount: 0 }]]));const badge = rows.get('a.md')?.querySelector<HTMLElement>(`[${OK_PROBLEM_BADGE_ATTR}]`);expect(badge?.title).toBe('1 error in this file. Open the Problems panel for details.');- expect(badge?.getAttribute('aria-label')).toBe(badge?.title);+ expect(badge?.getAttribute('aria-label')).toBe(+ '1 problem. 1 error in this file. Open the Problems panel for details.',+ );// Both attributes are written behind separate value-gates, so the update// path has to assert both: breaking one guard leaves the other passing.@@ -170,6 +510,8 @@ describe('applyProblemIndicators', () => {expect(badge?.title).toBe('3 errors and 2 warnings in this file. Open the Problems panel for details.',);- expect(badge?.getAttribute('aria-label')).toBe(badge?.title);+ expect(badge?.getAttribute('aria-label')).toBe(+ '5 problems. 3 errors and 2 warnings in this file. Open the Problems panel for details.',+ );});});diff --git a/packages/app/src/components/file-tree-problem-indicators.ts b/packages/app/src/components/file-tree-problem-indicators.tsindex b41c6ca29..dc3e22a0d 100644--- a/packages/app/src/components/file-tree-problem-indicators.ts+++ b/packages/app/src/components/file-tree-problem-indicators.ts@@ -44,9 +44,10 @@ export const FILE_TREE_PROBLEM_CSS = `border-radius: 0.5rem;padding: 0 0.25rem;flex-shrink: 0;- /* No pointer-events: none. The badge has to stay a hit target or the- cursor falls through to the row and resolves the row's full-path- title instead of the badge's own explanation. */+ /* No pointer-events: none. The badge is the row's problems control, so+ suppressing hit-testing would make it unclickable outright — and even+ before it was a control, the cursor fell through to the row and resolved+ the row's full-path title instead of the badge's own explanation. */user-select: none;color: var(--ok-tree-problem-warning, oklch(70% 0.15 75));background: color-mix(in oklab, currentColor 14%, transparent);@@ -54,16 +55,69 @@ export const FILE_TREE_PROBLEM_CSS = `[data-type='item'][${OK_PROBLEM_ROW_ATTR}='error'] [${OK_PROBLEM_BADGE_ATTR}] {color: var(--ok-tree-problem-error, oklch(55% 0.15 25));}+ /* The painted chip is sized for a two-character count and lands ~24x16, under+ the 24x24 a pointer target owes. It cannot grow: the row is 26px and the+ digit has to stay beside the file name. So the TARGET grows instead of the+ chip, on the operable variant only — an inert badge is not a target and+ keeps its old footprint. Inset covers the row's full height, which also+ clears the 24px-diameter circle the spacing exception measures. */+ [${OK_PROBLEM_BADGE_ATTR}][role='button'] {+ position: relative;+ }+ [${OK_PROBLEM_BADGE_ATTR}][role='button']::after {+ content: '';+ position: absolute;+ inset: -5px -1px;+ }+ /* Under the pointer the chip is otherwise indistinguishable from the label it+ replaced: the row already sets a pointer cursor, so crossing into a+ sub-target that does something DIFFERENT from the row gives no signal at+ all. Stepping the tint up is the whole affordance, so it is a state change+ rather than a transition and has nothing for reduced motion to suppress. */+ @media (hover: hover) {+ [${OK_PROBLEM_BADGE_ATTR}][role='button']:hover {+ background: color-mix(in oklab, currentColor 28%, transparent);+ }+ }+ [${OK_PROBLEM_BADGE_ATTR}][role='button']:active {+ background: color-mix(in oklab, currentColor 38%, transparent);+ }+ /* The tree publishes its focus-ring tokens on the shadow host, so borrowing+ them keeps the badge's ring identical to a focused row's under either+ theme. Only width and color carry over: the tree's offset token is+ negative because a row paints its ring inset on a ::before, and inset on+ a chip this small would land the ring on top of the digit. */+ [${OK_PROBLEM_BADGE_ATTR}]:focus-visible {+ outline: var(--trees-focus-ring-width, 2px) solid+ var(--trees-focus-ring-color, currentColor);+ outline-offset: 1px;+ }+ /* Forced colors substitutes its own palette for the chip's translucent+ background, so a badge carrying meaning only in that background dissolves+ into the row and takes the error/warning distinction with it. A border in+ the system text color restores the chip as a shape, and severity rides its+ weight rather than a hue the palette refuses to honor. Same contract the+ drop-target affordances keep in FILE_TREE_UNSAFE_CSS. */+ @media (forced-colors: active) {+ [${OK_PROBLEM_BADGE_ATTR}] {+ border: 1px solid CanvasText;+ }+ [data-type='item'][${OK_PROBLEM_ROW_ATTR}='error'] [${OK_PROBLEM_BADGE_ATTR}] {+ border-width: 3px;+ }+ }`;/*** Tint + badge every file row whose doc has problems in `counts`; strip* indicators from rows that healed. Idempotent — repeated calls with no- * change are no-ops. Folder rows are untouched (FR: files tint).+ * change are no-ops. Folder rows are left untouched; only file rows carry+ * tint and a badge.*/export function applyProblemIndicators(root: ParentNode,counts: ReadonlyMap<string, DocProblemCounts>,+ onActivate?: (treePath: string, source: 'pointer' | 'keyboard') => void,): void {const rows = root.querySelectorAll<HTMLElement>('[data-type="item"][data-item-path]');for (const row of rows) {@@ -72,7 +126,8 @@ export function applyProblemIndicators(clearProblemIndicators(row);continue;}- const entry = counts.get(filePathToDocName(treePath));+ const docName = filePathToDocName(treePath);+ const entry = counts.get(docName);if (entry === undefined || (entry.errorCount === 0 && entry.warningCount === 0)) {clearProblemIndicators(row);continue;@@ -81,19 +136,27 @@ export function applyProblemIndicators(if (row.getAttribute(OK_PROBLEM_ROW_ATTR) !== severity) {row.setAttribute(OK_PROBLEM_ROW_ATTR, severity);}- upsertProblemBadge(row, entry);+ upsertProblemBadge(row, treePath, entry, onActivate);}}function clearProblemIndicators(row: HTMLElement): void {if (row.hasAttribute(OK_PROBLEM_ROW_ATTR)) row.removeAttribute(OK_PROBLEM_ROW_ATTR);- row.querySelector(`[${OK_PROBLEM_BADGE_ATTR}]`)?.remove();+ const badge = row.querySelector(`[${OK_PROBLEM_BADGE_ATTR}]`);+ if (!badge) return;+ // A file can heal while its own badge holds focus (the audit that clears it+ // is asynchronous). Removing the focused element strands focus on the body,+ // so hand it back to the row the badge belonged to first.+ const treeRoot = row.getRootNode();+ if (treeRoot instanceof ShadowRoot && treeRoot.activeElement === badge) row.focus();+ badge.remove();}/**- * The badge's hover tooltip and accessible name. Names what the number counts- * and where to act on it, because the digit alone reads as unexplained- * decoration next to the file name.+ * The badge's hover tooltip and the tail of its accessible name. Names what the+ * number counts and where to act on it, because the digit alone reads as+ * unexplained decoration next to the file name. `problemBadgeAccessibleName`+ * prepends the painted count summary.** A function rather than a module constant: the macro at module scope would* resolve once at import and then keep whatever language was active then.@@ -118,6 +181,14 @@ function problemBadgeLabel(counts: DocProblemCounts): string {return t`${summary} in this file. Open the Problems panel for details.`;}+/** Accessible name whose opening text exactly matches the painted count. */+function problemBadgeAccessibleName(label: string, counts: DocProblemCounts): string {+ const total = counts.errorCount + counts.warningCount;+ const visibleSummary =+ total > 99 ? t`${label} problems` : plural(total, { one: '# problem', other: '# problems' });+ return t`${visibleSummary}. ${problemBadgeLabel(counts)}`;+}+/*** Inject (or update) the count badge right before the action lane — the same* slot contract as the extension badge's `upsertBadge`, landing AFTER any@@ -126,19 +197,26 @@ function problemBadgeLabel(counts: DocProblemCounts): string {** The badge sets its OWN `title`. FileTree stamps the full path as the row's* title, and a descendant only escapes that by carrying a title of its own.+ *+ * With an `onActivate` the badge becomes an operable control; without one it+ * stays the inert indicator it is in any host that has nowhere to send the+ * activation, since a focusable control that does nothing is worse than a+ * label. Both roles are on the name-from-author list, so the accessible name+ * survives either way — which a bare span's implicit `generic` role would not,+ * ARIA 1.2 prohibiting a name on it.*/-function upsertProblemBadge(row: HTMLElement, counts: DocProblemCounts): void {+function upsertProblemBadge(+ row: HTMLElement,+ treePath: string,+ counts: DocProblemCounts,+ onActivate?: (treePath: string, source: 'pointer' | 'keyboard') => void,+): void {const total = counts.errorCount + counts.warningCount;const label = total > 99 ? '99+' : String(total);let badge = row.querySelector<HTMLSpanElement>(`[${OK_PROBLEM_BADGE_ATTR}]`);if (!badge) {badge = row.ownerDocument.createElement('span');badge.setAttribute(OK_PROBLEM_BADGE_ATTR, '');- // A bare span's implicit role is `generic`, and ARIA 1.2 prohibits a name- // on it, so browsers drop the aria-label below and announce only the- // digit. `img` is on the name-from-author list, which is what makes the- // accessible name reach a screen reader at all.- badge.setAttribute('role', 'img');const actionSection = row.querySelector('[data-item-section="action"]');if (actionSection) {actionSection.before(badge);@@ -148,8 +226,71 @@ function upsertProblemBadge(row: HTMLElement, counts: DocProblemCounts): void {}if (badge.textContent !== label) badge.textContent = label;const description = problemBadgeLabel(counts);- if (badge.getAttribute('aria-label') !== description) {- badge.setAttribute('aria-label', description);+ const accessibleName = problemBadgeAccessibleName(label, counts);+ if (badge.getAttribute('aria-label') !== accessibleName) {+ badge.setAttribute('aria-label', accessibleName);}if (badge.title !== description) badge.title = description;+ applyBadgeActivation(badge, treePath, onActivate);+}++/**+ * Wire (or unwire) the badge as a control. Handlers are assigned to the event+ * PROPERTIES rather than added as listeners: the tree's MutationObserver+ * re-runs this whole pass whenever Pierre re-renders, and assignment replaces+ * where `addEventListener` would stack, so one click stays one activation no+ * matter how many passes ran. Property assignment is also invisible to that+ * observer, unlike the attribute writes, which stay value-gated.+ *+ * `tabindex="0"` diverges from the tree's roving-tabindex idiom, where the row+ * is the only tab stop and even the host's own in-row action affordance is+ * `aria-hidden` and untabbable. Nothing in the host routes a key press down to+ * a descendant, so the alternative is a control no keyboard can reach at all.+ * The added tab stops are bounded by the virtualized rows that actually carry+ * problems.+ */+function applyBadgeActivation(+ badge: HTMLSpanElement,+ treePath: string,+ onActivate?: (treePath: string, source: 'pointer' | 'keyboard') => void,+): void {+ const role = onActivate === undefined ? 'img' : 'button';+ if (badge.getAttribute('role') !== role) badge.setAttribute('role', role);+ if (onActivate === undefined) {+ if (badge.hasAttribute('tabindex')) badge.removeAttribute('tabindex');+ badge.onclick = null;+ badge.onkeydown = null;+ return;+ }+ if (badge.getAttribute('tabindex') !== '0') badge.setAttribute('tabindex', '0');+ badge.onclick = (event) => {+ // A modified click is the tree's own multi-select gesture — the host reads+ // ctrl/meta/shift off it to extend or toggle the selection. The badge has+ // no modified meaning of its own, so it declines the event outright rather+ // than swallowing it: returning before `stopPropagation` is what leaves the+ // gesture intact for the row underneath.+ if (isModifiedActivation(event) || event.button !== 0) return;+ // The row resolves a plain click into its own selection + navigation. The+ // badge asks for something more specific about the same file, so it answers+ // for this click alone rather than letting both fire.+ event.stopPropagation();+ onActivate(treePath, 'pointer');+ };+ badge.onkeydown = (event) => {+ if (event.key !== 'Enter' && event.key !== ' ') return;+ // Same deference as the click: ctrl/meta + Space is the host's+ // toggle-selection chord, and it has to reach the row to mean anything.+ if (isModifiedActivation(event)) return;+ // A held key auto-repeats; a real button activates once, on release.+ if (event.repeat) return;+ event.stopPropagation();+ // Space would otherwise scroll the tree out from under the badge.+ event.preventDefault();+ onActivate(treePath, 'keyboard');+ };+}++/** Whether a modifier is held, i.e. the gesture belongs to the tree, not the badge. */+function isModifiedActivation(event: MouseEvent | KeyboardEvent): boolean {+ return event.metaKey || event.ctrlKey || event.shiftKey || event.altKey;}diff --git a/packages/app/src/locales/ar/messages.json b/packages/app/src/locales/ar/messages.jsonindex b5aba847c..2265a7b3f 100644--- a/packages/app/src/locales/ar/messages.json+++ b/packages/app/src/locales/ar/messages.json@@ -1338,6 +1338,7 @@"F4_wQj": ["البحث باستخدام Google"],"F4vEsL": ["حالة المزامنة: ", ["syncStateLabel"]],"F6pfE9": ["نشط"],+ "F8GW_c": [["label"], " مشكلة"],"FBknns": ["HTML"],"FCAcjR": ["شغّل طرفية حقيقية مرسّاة داخل OpenKnowledge، تبدأ في مجلد هذا المشروع."],"FCKppt": ["نقطة النهاية"],@@ -3535,6 +3536,7 @@"dbhUX1": ["إخفاء هذا الملف"],"dbtjJh": ["(يفتح في تبويب جديد)"],"deD5fS": ["احسم التعارض في ", ["files"], " و", ["overflow"], " ملفات أخرى قبل الحذف."],+ "dibzbg": [["visibleSummary"], ". ", ["0"]],"djc1l9": ["حُظر أكثر من ", ["0"], " طلب بسياسة أمان المعاينة"],"dprWmL": ["مرساة في هذه الصفحة"],"dr1vFs": ["استبدال كل التطابقات"],@@ -3557,6 +3559,20 @@"e8zYa8": ["تعذّر فتح ", ["shareBranch"], " في شجرة عمل. أعد المحاولة."],"e9sHSO": ["تابع من حيث توقفت"],"eBIT9h": ["فشل اللصق.", ["restoreSuffix"]],+ "eCDwNN": [+ [+ "total",+ "plural",+ {+ "zero": ["#", " مشكلة"],+ "one": ["#", " مشكلة"],+ "two": ["#", " مشكلتان"],+ "few": ["#", " مشكلات"],+ "many": ["#", " مشكلة"],+ "other": ["#", " مشكلة"]+ }+ ]+ ],"eFJkVt": ["فشل الاستنساخ: ", ["cloneError"]],"eG8Jsg": ["تبديل وضع تركيز مفتاح Tab في المصدر"],"eGUbmF": ["نسخ الملف أو المجلد المحدد"],diff --git a/packages/app/src/locales/ar/messages.po b/packages/app/src/locales/ar/messages.poindex 4d307647d..626611edc 100644--- a/packages/app/src/locales/ar/messages.po+++ b/packages/app/src/locales/ar/messages.po@@ -739,6 +739,10 @@ msgstr "{label} ({0})"msgid "{label} enabled"msgstr "{label} مفعَّل"+#: src/components/file-tree-problem-indicators.ts+msgid "{label} problems"+msgstr "{label} مشكلة"+#: src/components/ActivityPanelBurstRow.tsxmsgid "{laterEdits, plural, one {Removes # newer edit on this file.} other {Removes # newer edits on this file.}}"msgstr "{laterEdits, plural, zero {يزيل # تعديل أحدث على هذا الملف.} one {يزيل تعديلًا واحدًا أحدث على هذا الملف.} two {يزيل تعديلين أحدث على هذا الملف.} few {يزيل # تعديلات أحدث على هذا الملف.} many {يزيل # تعديلًا أحدث على هذا الملف.} other {يزيل # تعديل أحدث على هذا الملف.}}"@@ -917,6 +921,10 @@ msgstr "{templateCount, plural, zero {قوالب} one {قالب} two {قالباmsgid "{tokens, plural, one {token} other {tokens}}"msgstr "{tokens, plural, zero {رموز} one {رمز} two {رمزان} few {رموز} many {رمزًا} other {رمز}}"+#: src/components/file-tree-problem-indicators.ts+msgid "{total, plural, one {# problem} other {# problems}}"+msgstr "{total, plural, zero {# مشكلة} one {# مشكلة} two {# مشكلتان} few {# مشكلات} many {# مشكلة} other {# مشكلة}}"+#: src/components/FileTree.tsxmsgid "{truncatedShownCount, plural, one {Showing the first item in one folder — the rest of that folder is hidden.} other {Showing the first {formattedCount} items in one folder — the rest of that folder is hidden.}}"msgstr "{truncatedShownCount, plural, zero {يجري عرض أول {formattedCount} عنصر في مجلد واحد — بقية ذلك المجلد مخفية.} one {يجري عرض أول عنصر في مجلد واحد — بقية ذلك المجلد مخفية.} two {يجري عرض أول عنصرين في مجلد واحد — بقية ذلك المجلد مخفية.} few {يجري عرض أول {formattedCount} عناصر في مجلد واحد — بقية ذلك المجلد مخفية.} many {يجري عرض أول {formattedCount} عنصرًا في مجلد واحد — بقية ذلك المجلد مخفية.} other {يجري عرض أول {formattedCount} عنصر في مجلد واحد — بقية ذلك المجلد مخفية.}}"@@ -950,6 +958,11 @@ msgstr "{userName} · {tabCount, plural, zero {# تبويب} one {تبويب وmsgid "{userName}, {tabCount, plural, one {# concurrent tab} other {# concurrent tabs}}"msgstr "{userName}، {tabCount, plural, zero {# تبويب متزامن} one {تبويب واحد متزامن} two {تبويبان متزامنان} few {# تبويبات متزامنة} many {# تبويبًا متزامنًا} other {# تبويب متزامن}}"+#. placeholder {0}: problemBadgeLabel(counts)+#: src/components/file-tree-problem-indicators.ts+msgid "{visibleSummary}. {0}"+msgstr "{visibleSummary}. {0}"+#: src/components/file-tree-problem-indicators.tsmsgid "{warningCount, plural, one {# warning} other {# warnings}}"msgstr "{warningCount, plural, zero {# تحذير} one {تحذير واحد} two {تحذيران} few {# تحذيرات} many {# تحذيرًا} other {# تحذير}}"diff --git a/packages/app/src/locales/bn/messages.json b/packages/app/src/locales/bn/messages.jsonindex f0f7c0b37..447d98692 100644--- a/packages/app/src/locales/bn/messages.json+++ b/packages/app/src/locales/bn/messages.json@@ -1134,6 +1134,7 @@"F4_wQj": ["Google দিয়ে খুঁজুন"],"F4vEsL": ["সিঙ্কের অবস্থা: ", ["syncStateLabel"]],"F6pfE9": ["সক্রিয়"],+ "F8GW_c": [["label"], " সমস্যা"],"FBknns": ["HTML"],"FCAcjR": ["OpenKnowledge-এর ভেতরে জোড়া একটি সত্যিকারের টার্মিনাল চালান, যা এই প্রকল্পের ফোল্ডার থেকে শুরু হয়।"@@ -2988,6 +2989,7 @@"dbhUX1": ["এই ফাইলটি লুকান"],"dbtjJh": ["(নতুন ট্যাবে খোলে)"],"deD5fS": ["মোছার আগে ", ["files"], " এবং আরও ", ["overflow"], "টি ফাইলের দ্বন্দ্ব মিটিয়ে নিন।"],+ "dibzbg": [["visibleSummary"], "। ", ["0"]],"djc1l9": ["প্রাকদর্শনের নিরাপত্তা নীতি ", ["0"], "-এর বেশি অনুরোধ আটকে দিয়েছে"],"dprWmL": ["এই পাতায় অ্যাংকর"],"dr1vFs": ["সব মিল বদলান"],@@ -3010,6 +3012,7 @@"e8zYa8": [["shareBranch"], " কোনো ওয়ার্কট্রিতে খোলা যায়নি। আবার চেষ্টা করুন।"],"e9sHSO": ["যেখানে ছেড়েছিলেন সেখান থেকেই শুরু করুন"],"eBIT9h": ["পেস্ট ব্যর্থ।", ["restoreSuffix"]],+ "eCDwNN": [["total", "plural", { "one": ["#", " সমস্যা"], "other": ["#", " সমস্যা"] }]],"eFJkVt": ["ক্লোন ব্যর্থ: ", ["cloneError"]],"eG8Jsg": ["সোর্স ট্যাব ফোকাস মোড চালু বা বন্ধ করুন"],"eGUbmF": ["নির্বাচিত ফাইল বা ফোল্ডার কপি করুন"],diff --git a/packages/app/src/locales/bn/messages.po b/packages/app/src/locales/bn/messages.poindex 1569a1614..8da2000cc 100644--- a/packages/app/src/locales/bn/messages.po+++ b/packages/app/src/locales/bn/messages.po@@ -739,6 +739,10 @@ msgstr "{label} ({0})"msgid "{label} enabled"msgstr "{label} সক্রিয়"+#: src/components/file-tree-problem-indicators.ts+msgid "{label} problems"+msgstr "{label} সমস্যা"+#: src/components/ActivityPanelBurstRow.tsxmsgid "{laterEdits, plural, one {Removes # newer edit on this file.} other {Removes # newer edits on this file.}}"msgstr "{laterEdits, plural, one {এই ফাইলের # নতুন সম্পাদনা সরিয়ে দেয়।} other {এই ফাইলের # নতুন সম্পাদনা সরিয়ে দেয়।}}"@@ -917,6 +921,10 @@ msgstr "{templateCount, plural, one {টেমপ্লেট} other {টেমmsgid "{tokens, plural, one {token} other {tokens}}"msgstr "{tokens, plural, one {টোকেন} other {টোকেন}}"+#: src/components/file-tree-problem-indicators.ts+msgid "{total, plural, one {# problem} other {# problems}}"+msgstr "{total, plural, one {# সমস্যা} other {# সমস্যা}}"+#: src/components/FileTree.tsxmsgid "{truncatedShownCount, plural, one {Showing the first item in one folder — the rest of that folder is hidden.} other {Showing the first {formattedCount} items in one folder — the rest of that folder is hidden.}}"msgstr "{truncatedShownCount, plural, one {একটি ফোল্ডারের প্রথম আইটেম দেখানো হচ্ছে — সেই ফোল্ডারের বাকিটা লুকানো।} other {একটি ফোল্ডারের প্রথম {formattedCount}টি আইটেম দেখানো হচ্ছে — সেই ফোল্ডারের বাকিটা লুকানো।}}"@@ -950,6 +958,11 @@ msgstr "{userName} · {tabCount, plural, one {# ট্যাব} other {# ট্msgid "{userName}, {tabCount, plural, one {# concurrent tab} other {# concurrent tabs}}"msgstr "{userName}, {tabCount, plural, one {# একযোগে ট্যাব} other {# একযোগে ট্যাব}}"+#. placeholder {0}: problemBadgeLabel(counts)+#: src/components/file-tree-problem-indicators.ts+msgid "{visibleSummary}. {0}"+msgstr "{visibleSummary}। {0}"+#: src/components/file-tree-problem-indicators.tsmsgid "{warningCount, plural, one {# warning} other {# warnings}}"msgstr "{warningCount, plural, one {# সতর্কতা} other {# সতর্কতা}}"diff --git a/packages/app/src/locales/en/messages.json b/packages/app/src/locales/en/messages.jsonindex fe4ed1288..8abe5148c 100644--- a/packages/app/src/locales/en/messages.json+++ b/packages/app/src/locales/en/messages.json@@ -1162,6 +1162,7 @@"F4_wQj": ["Search with Google"],"F4vEsL": ["Sync status: ", ["syncStateLabel"]],"F6pfE9": ["Active"],+ "F8GW_c": [["label"], " problems"],"FBknns": ["HTML"],"FCAcjR": ["Run a real terminal docked inside OpenKnowledge, starting in this project's folder."@@ -3065,6 +3066,7 @@["overflow"]," more before deleting."],+ "dibzbg": [["visibleSummary"], ". ", ["0"]],"djc1l9": ["More than ", ["0"], " requests were blocked by the preview's security policy"],"dprWmL": ["Anchor in this page"],"dr1vFs": ["Replace all matches"],@@ -3087,6 +3089,7 @@"e8zYa8": ["Could not open ", ["shareBranch"], " in a worktree. Try again."],"e9sHSO": ["Pick up where you left off"],"eBIT9h": ["Paste failed.", ["restoreSuffix"]],+ "eCDwNN": [["total", "plural", { "one": ["#", " problem"], "other": ["#", " problems"] }]],"eFJkVt": ["Clone failed: ", ["cloneError"]],"eG8Jsg": ["Toggle source tab focus mode"],"eGUbmF": ["Copy selected file or folder"],diff --git a/packages/app/src/locales/en/messages.po b/packages/app/src/locales/en/messages.poindex caf81ea25..fb20e00bb 100644--- a/packages/app/src/locales/en/messages.po+++ b/packages/app/src/locales/en/messages.po@@ -739,6 +739,10 @@ msgstr "{label} ({0})"msgid "{label} enabled"msgstr "{label} enabled"+#: src/components/file-tree-problem-indicators.ts+msgid "{label} problems"+msgstr "{label} problems"+#: src/components/ActivityPanelBurstRow.tsxmsgid "{laterEdits, plural, one {Removes # newer edit on this file.} other {Removes # newer edits on this file.}}"msgstr "{laterEdits, plural, one {Removes # newer edit on this file.} other {Removes # newer edits on this file.}}"@@ -917,6 +921,10 @@ msgstr "{templateCount, plural, one {template} other {templates}}"msgid "{tokens, plural, one {token} other {tokens}}"msgstr "{tokens, plural, one {token} other {tokens}}"+#: src/components/file-tree-problem-indicators.ts+msgid "{total, plural, one {# problem} other {# problems}}"+msgstr "{total, plural, one {# problem} other {# problems}}"+#: src/components/FileTree.tsxmsgid "{truncatedShownCount, plural, one {Showing the first item in one folder — the rest of that folder is hidden.} other {Showing the first {formattedCount} items in one folder — the rest of that folder is hidden.}}"msgstr "{truncatedShownCount, plural, one {Showing the first item in one folder — the rest of that folder is hidden.} other {Showing the first {formattedCount} items in one folder — the rest of that folder is hidden.}}"@@ -950,6 +958,11 @@ msgstr "{userName} · {tabCount, plural, one {# tab} other {# tabs}}"msgid "{userName}, {tabCount, plural, one {# concurrent tab} other {# concurrent tabs}}"msgstr "{userName}, {tabCount, plural, one {# concurrent tab} other {# concurrent tabs}}"+#. placeholder {0}: problemBadgeLabel(counts)+#: src/components/file-tree-problem-indicators.ts+msgid "{visibleSummary}. {0}"+msgstr "{visibleSummary}. {0}"+#: src/components/file-tree-problem-indicators.tsmsgid "{warningCount, plural, one {# warning} other {# warnings}}"msgstr "{warningCount, plural, one {# warning} other {# warnings}}"diff --git a/packages/app/src/locales/es/messages.json b/packages/app/src/locales/es/messages.jsonindex 9d2dcddbf..8073a56b4 100644--- a/packages/app/src/locales/es/messages.json+++ b/packages/app/src/locales/es/messages.json@@ -1347,6 +1347,7 @@"F4_wQj": ["Buscar con Google"],"F4vEsL": ["Estado de sincronización: ", ["syncStateLabel"]],"F6pfE9": ["Activo"],+ "F8GW_c": [["label"], " problemas"],"FBknns": ["HTML"],"FCAcjR": ["Ejecuta una terminal real acoplada dentro de OpenKnowledge, que arranca en la carpeta de este proyecto."@@ -3581,6 +3582,7 @@["overflow"]," más antes de eliminar."],+ "dibzbg": [["visibleSummary"], ". ", ["0"]],"djc1l9": ["La política de seguridad de la vista previa bloqueó más de ",["0"],@@ -3609,6 +3611,13 @@"e8zYa8": ["No se pudo abrir ", ["shareBranch"], " en un worktree. Inténtalo de nuevo."],"e9sHSO": ["Continúa donde lo dejaste"],"eBIT9h": ["Falló el pegado.", ["restoreSuffix"]],+ "eCDwNN": [+ [+ "total",+ "plural",+ { "one": ["#", " problema"], "many": ["#", " problemas"], "other": ["#", " problemas"] }+ ]+ ],"eFJkVt": ["No se pudo clonar: ", ["cloneError"]],"eG8Jsg": ["Activar o desactivar el modo de foco del tabulador en el código"],"eGUbmF": ["Copiar el archivo o la carpeta seleccionados"],diff --git a/packages/app/src/locales/es/messages.po b/packages/app/src/locales/es/messages.poindex 6ae448a42..89b7dee08 100644--- a/packages/app/src/locales/es/messages.po+++ b/packages/app/src/locales/es/messages.po@@ -739,6 +739,10 @@ msgstr "{label} ({0})"msgid "{label} enabled"msgstr "{label} activado"+#: src/components/file-tree-problem-indicators.ts+msgid "{label} problems"+msgstr "{label} problemas"+#: src/components/ActivityPanelBurstRow.tsxmsgid "{laterEdits, plural, one {Removes # newer edit on this file.} other {Removes # newer edits on this file.}}"msgstr "{laterEdits, plural, one {Elimina # edición más reciente de este archivo.} many {Elimina # ediciones más recientes de este archivo.} other {Elimina # ediciones más recientes de este archivo.}}"@@ -917,6 +921,10 @@ msgstr "{templateCount, plural, one {plantilla} many {plantillas} other {plantilmsgid "{tokens, plural, one {token} other {tokens}}"msgstr "{tokens, plural, one {token} many {tokens} other {tokens}}"+#: src/components/file-tree-problem-indicators.ts+msgid "{total, plural, one {# problem} other {# problems}}"+msgstr "{total, plural, one {# problema} many {# problemas} other {# problemas}}"+#: src/components/FileTree.tsxmsgid "{truncatedShownCount, plural, one {Showing the first item in one folder — the rest of that folder is hidden.} other {Showing the first {formattedCount} items in one folder — the rest of that folder is hidden.}}"msgstr "{truncatedShownCount, plural, one {Se muestra el primer elemento de una carpeta; el resto de esa carpeta está oculto.} many {Se muestran los primeros {formattedCount} elementos de una carpeta; el resto de esa carpeta está oculto.} other {Se muestran los primeros {formattedCount} elementos de una carpeta; el resto de esa carpeta está oculto.}}"@@ -950,6 +958,11 @@ msgstr "{userName} · {tabCount, plural, one {# pestaña} many {# pestañas} othmsgid "{userName}, {tabCount, plural, one {# concurrent tab} other {# concurrent tabs}}"msgstr "{userName}, {tabCount, plural, one {# pestaña simultánea} many {# pestañas simultáneas} other {# pestañas simultáneas}}"+#. placeholder {0}: problemBadgeLabel(counts)+#: src/components/file-tree-problem-indicators.ts+msgid "{visibleSummary}. {0}"+msgstr "{visibleSummary}. {0}"+#: src/components/file-tree-problem-indicators.tsmsgid "{warningCount, plural, one {# warning} other {# warnings}}"msgstr "{warningCount, plural, one {# advertencia} many {# advertencias} other {# advertencias}}"diff --git a/packages/app/src/locales/fr/messages.json b/packages/app/src/locales/fr/messages.jsonindex 1a8321391..241046d19 100644--- a/packages/app/src/locales/fr/messages.json+++ b/packages/app/src/locales/fr/messages.json@@ -1380,6 +1380,7 @@"F4_wQj": ["Rechercher avec Google"],"F4vEsL": ["État de la synchronisation : ", ["syncStateLabel"]],"F6pfE9": ["Actif"],+ "F8GW_c": [["label"], " problèmes"],"FBknns": ["HTML"],"FCAcjR": ["Exécutez un vrai terminal ancré dans OpenKnowledge, démarrant dans le dossier de ce projet."@@ -3613,6 +3614,7 @@["overflow"]," autres fichiers avant de supprimer."],+ "dibzbg": [["visibleSummary"], ". ", ["0"]],"djc1l9": ["Plus de ",["0"],@@ -3639,6 +3641,13 @@"e8zYa8": ["Impossible d'ouvrir ", ["shareBranch"], " dans un worktree. Réessayez."],"e9sHSO": ["Reprenez là où vous vous étiez arrêté"],"eBIT9h": ["Échec du collage.", ["restoreSuffix"]],+ "eCDwNN": [+ [+ "total",+ "plural",+ { "one": ["#", " problème"], "many": ["#", " problèmes"], "other": ["#", " problèmes"] }+ ]+ ],"eFJkVt": ["Échec du clonage : ", ["cloneError"]],"eG8Jsg": ["Basculer le mode focus de la touche Tab dans la source"],"eGUbmF": ["Copier le fichier ou dossier sélectionné"],diff --git a/packages/app/src/locales/fr/messages.po b/packages/app/src/locales/fr/messages.poindex 8555f3e77..8ceec4abe 100644--- a/packages/app/src/locales/fr/messages.po+++ b/packages/app/src/locales/fr/messages.po@@ -739,6 +739,10 @@ msgstr "{label} ({0})"msgid "{label} enabled"msgstr "{label} activé"+#: src/components/file-tree-problem-indicators.ts+msgid "{label} problems"+msgstr "{label} problèmes"+#: src/components/ActivityPanelBurstRow.tsxmsgid "{laterEdits, plural, one {Removes # newer edit on this file.} other {Removes # newer edits on this file.}}"msgstr "{laterEdits, plural, one {Supprime # modification plus récente de ce fichier.} many {Supprime # modifications plus récentes de ce fichier.} other {Supprime # modifications plus récentes de ce fichier.}}"@@ -917,6 +921,10 @@ msgstr "{templateCount, plural, one {modèle} many {modèles} other {modèles}}"msgid "{tokens, plural, one {token} other {tokens}}"msgstr "{tokens, plural, one {token} many {tokens} other {tokens}}"+#: src/components/file-tree-problem-indicators.ts+msgid "{total, plural, one {# problem} other {# problems}}"+msgstr "{total, plural, one {# problème} many {# problèmes} other {# problèmes}}"+#: src/components/FileTree.tsxmsgid "{truncatedShownCount, plural, one {Showing the first item in one folder — the rest of that folder is hidden.} other {Showing the first {formattedCount} items in one folder — the rest of that folder is hidden.}}"msgstr "{truncatedShownCount, plural, one {Affichage du premier élément d'un dossier — le reste de ce dossier est masqué.} many {Affichage des {formattedCount} premiers éléments d'un dossier — le reste de ce dossier est masqué.} other {Affichage des {formattedCount} premiers éléments d'un dossier — le reste de ce dossier est masqué.}}"@@ -950,6 +958,11 @@ msgstr "{userName} · {tabCount, plural, one {# onglet} many {# onglets} other {msgid "{userName}, {tabCount, plural, one {# concurrent tab} other {# concurrent tabs}}"msgstr "{userName}, {tabCount, plural, one {# onglet simultané} many {# onglets simultanés} other {# onglets simultanés}}"+#. placeholder {0}: problemBadgeLabel(counts)+#: src/components/file-tree-problem-indicators.ts+msgid "{visibleSummary}. {0}"+msgstr "{visibleSummary}. {0}"+#: src/components/file-tree-problem-indicators.tsmsgid "{warningCount, plural, one {# warning} other {# warnings}}"msgstr "{warningCount, plural, one {# avertissement} many {# avertissements} other {# avertissements}}"diff --git a/packages/app/src/locales/hi/messages.json b/packages/app/src/locales/hi/messages.jsonindex 28a88652f..e4eea0114 100644--- a/packages/app/src/locales/hi/messages.json+++ b/packages/app/src/locales/hi/messages.json@@ -1136,6 +1136,7 @@"F4_wQj": ["Google से खोजें"],"F4vEsL": ["सिंक स्थिति: ", ["syncStateLabel"]],"F6pfE9": ["सक्रिय"],+ "F8GW_c": [["label"], " समस्याएँ"],"FBknns": ["HTML"],"FCAcjR": ["OpenKnowledge के भीतर जुड़ा एक असली टर्मिनल चलाएँ, जो इस प्रोजेक्ट के फ़ोल्डर से शुरू होता है।"],"FCKppt": ["एंडपॉइंट"],@@ -2977,6 +2978,7 @@"dbhUX1": ["यह फ़ाइल छिपाएँ"],"dbtjJh": ["(नए टैब में खुलता है)"],"deD5fS": ["हटाने से पहले ", ["files"], " और ", ["overflow"], " अन्य फ़ाइलों का विरोध हल करें।"],+ "dibzbg": [["visibleSummary"], "। ", ["0"]],"djc1l9": ["पूर्वावलोकन की सुरक्षा नीति ने ", ["0"], " से ज़्यादा अनुरोध रोके"],"dprWmL": ["इस पेज में एंकर"],"dr1vFs": ["सभी मेल बदलें"],@@ -2999,6 +3001,7 @@"e8zYa8": [["shareBranch"], " को किसी वर्कट्री में नहीं खोला जा सका। फिर कोशिश करें।"],"e9sHSO": ["जहाँ छोड़ा था वहीं से शुरू करें"],"eBIT9h": ["चिपकाना विफल।", ["restoreSuffix"]],+ "eCDwNN": [["total", "plural", { "one": ["#", " समस्या"], "other": ["#", " समस्याएँ"] }]],"eFJkVt": ["क्लोन विफल: ", ["cloneError"]],"eG8Jsg": ["स्रोत टैब फ़ोकस मोड चालू या बंद करें"],"eGUbmF": ["चयनित फ़ाइल या फ़ोल्डर कॉपी करें"],diff --git a/packages/app/src/locales/hi/messages.po b/packages/app/src/locales/hi/messages.poindex 76a0c95e6..a83c072ad 100644--- a/packages/app/src/locales/hi/messages.po+++ b/packages/app/src/locales/hi/messages.po@@ -739,6 +739,10 @@ msgstr "{label} ({0})"msgid "{label} enabled"msgstr "{label} सक्षम"+#: src/components/file-tree-problem-indicators.ts+msgid "{label} problems"+msgstr "{label} समस्याएँ"+#: src/components/ActivityPanelBurstRow.tsxmsgid "{laterEdits, plural, one {Removes # newer edit on this file.} other {Removes # newer edits on this file.}}"msgstr "{laterEdits, plural, one {इस फ़ाइल पर # नया संपादन हटाता है।} other {इस फ़ाइल पर # नए संपादन हटाता है।}}"@@ -917,6 +921,10 @@ msgstr "{templateCount, plural, one {टेम्पलेट} other {टेमmsgid "{tokens, plural, one {token} other {tokens}}"msgstr "{tokens, plural, one {टोकन} other {टोकन}}"+#: src/components/file-tree-problem-indicators.ts+msgid "{total, plural, one {# problem} other {# problems}}"+msgstr "{total, plural, one {# समस्या} other {# समस्याएँ}}"+#: src/components/FileTree.tsxmsgid "{truncatedShownCount, plural, one {Showing the first item in one folder — the rest of that folder is hidden.} other {Showing the first {formattedCount} items in one folder — the rest of that folder is hidden.}}"msgstr "{truncatedShownCount, plural, one {एक फ़ोल्डर का पहला आइटम दिखाया जा रहा है — उस फ़ोल्डर का बाकी हिस्सा छिपा है।} other {एक फ़ोल्डर के पहले {formattedCount} आइटम दिखाए जा रहे हैं — उस फ़ोल्डर का बाकी हिस्सा छिपा है।}}"@@ -950,6 +958,11 @@ msgstr "{userName} · {tabCount, plural, one {# टैब} other {# टैब}}"msgid "{userName}, {tabCount, plural, one {# concurrent tab} other {# concurrent tabs}}"msgstr "{userName}, {tabCount, plural, one {# समवर्ती टैब} other {# समवर्ती टैब}}"+#. placeholder {0}: problemBadgeLabel(counts)+#: src/components/file-tree-problem-indicators.ts+msgid "{visibleSummary}. {0}"+msgstr "{visibleSummary}। {0}"+#: src/components/file-tree-problem-indicators.tsmsgid "{warningCount, plural, one {# warning} other {# warnings}}"msgstr "{warningCount, plural, one {# चेतावनी} other {# चेतावनियाँ}}"diff --git a/packages/app/src/locales/id/messages.json b/packages/app/src/locales/id/messages.jsonindex 334856be1..ec9f9e6ff 100644--- a/packages/app/src/locales/id/messages.json+++ b/packages/app/src/locales/id/messages.json@@ -1158,6 +1158,7 @@"F4_wQj": ["Cari dengan Google"],"F4vEsL": ["Status sinkronisasi: ", ["syncStateLabel"]],"F6pfE9": ["Aktif"],+ "F8GW_c": [["label"], " masalah"],"FBknns": ["HTML"],"FCAcjR": ["Jalankan terminal sungguhan yang tertambat di dalam OpenKnowledge, dimulai di folder proyek ini."@@ -3085,6 +3086,7 @@["overflow"]," berkas lainnya sebelum menghapus."],+ "dibzbg": [["visibleSummary"], ". ", ["0"]],"djc1l9": ["Lebih dari ", ["0"], " permintaan diblokir oleh kebijakan keamanan pratinjau"],"dprWmL": ["Jangkar di halaman ini"],"dr1vFs": ["Ganti semua kecocokan"],@@ -3107,6 +3109,7 @@"e8zYa8": [["shareBranch"], " tidak dapat dibuka di worktree. Coba lagi."],"e9sHSO": ["Lanjutkan dari tempat Anda berhenti"],"eBIT9h": ["Penempelan gagal.", ["restoreSuffix"]],+ "eCDwNN": [["total", "plural", { "other": ["#", " masalah"] }]],"eFJkVt": ["Kloning gagal: ", ["cloneError"]],"eG8Jsg": ["Alihkan mode fokus Tab di sumber"],"eGUbmF": ["Salin berkas atau folder terpilih"],diff --git a/packages/app/src/locales/id/messages.po b/packages/app/src/locales/id/messages.poindex 01b530208..c10de4170 100644--- a/packages/app/src/locales/id/messages.po+++ b/packages/app/src/locales/id/messages.po@@ -739,6 +739,10 @@ msgstr "{label} ({0})"msgid "{label} enabled"msgstr "{label} diaktifkan"+#: src/components/file-tree-problem-indicators.ts+msgid "{label} problems"+msgstr "{label} masalah"+#: src/components/ActivityPanelBurstRow.tsxmsgid "{laterEdits, plural, one {Removes # newer edit on this file.} other {Removes # newer edits on this file.}}"msgstr "{laterEdits, plural, other {Menghapus # suntingan yang lebih baru pada berkas ini.}}"@@ -917,6 +921,10 @@ msgstr "{templateCount, plural, other {templat}}"msgid "{tokens, plural, one {token} other {tokens}}"msgstr "{tokens, plural, other {token}}"+#: src/components/file-tree-problem-indicators.ts+msgid "{total, plural, one {# problem} other {# problems}}"+msgstr "{total, plural, other {# masalah}}"+#: src/components/FileTree.tsxmsgid "{truncatedShownCount, plural, one {Showing the first item in one folder — the rest of that folder is hidden.} other {Showing the first {formattedCount} items in one folder — the rest of that folder is hidden.}}"msgstr "{truncatedShownCount, plural, other {Menampilkan {formattedCount} item pertama dalam satu folder — sisa folder itu disembunyikan.}}"@@ -950,6 +958,11 @@ msgstr "{userName} · {tabCount, plural, other {# tab}}"msgid "{userName}, {tabCount, plural, one {# concurrent tab} other {# concurrent tabs}}"msgstr "{userName}, {tabCount, plural, other {# tab bersamaan}}"+#. placeholder {0}: problemBadgeLabel(counts)+#: src/components/file-tree-problem-indicators.ts+msgid "{visibleSummary}. {0}"+msgstr "{visibleSummary}. {0}"+#: src/components/file-tree-problem-indicators.tsmsgid "{warningCount, plural, one {# warning} other {# warnings}}"msgstr "{warningCount, plural, other {# peringatan}}"diff --git a/packages/app/src/locales/ko/messages.json b/packages/app/src/locales/ko/messages.jsonindex fc0757256..0c9e12792 100644--- a/packages/app/src/locales/ko/messages.json+++ b/packages/app/src/locales/ko/messages.json@@ -1111,6 +1111,7 @@"F4_wQj": ["Google로 검색"],"F4vEsL": ["동기화 상태: ", ["syncStateLabel"]],"F6pfE9": ["활성"],+ "F8GW_c": ["문제 ", ["label"], "개"],"FBknns": ["HTML"],"FCAcjR": ["이 프로젝트 폴더에서 시작하는 실제 터미널을 OpenKnowledge 안에 고정해 실행합니다."],"FCKppt": ["엔드포인트"],@@ -2958,6 +2959,7 @@["overflow"],"개 항목을 더 처리하세요."],+ "dibzbg": [["visibleSummary"], ". ", ["0"]],"djc1l9": [["0"], "개를 초과하는 요청이 미리보기 보안 정책으로 차단되었습니다"],"dprWmL": ["이 페이지의 앵커"],"dr1vFs": ["일치 항목 모두 바꾸기"],@@ -2980,6 +2982,7 @@"e8zYa8": ["워크트리에서 ", ["shareBranch"], " 브랜치 열기에 실패했습니다. 다시 시도하세요."],"e9sHSO": ["중단한 지점부터 계속"],"eBIT9h": ["붙여넣기에 실패했습니다.", ["restoreSuffix"]],+ "eCDwNN": [["total", "plural", { "other": ["#", "개 문제"] }]],"eFJkVt": ["클론 실패: ", ["cloneError"]],"eG8Jsg": ["소스 탭 포커스 모드 전환"],"eGUbmF": ["선택한 파일 또는 폴더 복사"],diff --git a/packages/app/src/locales/ko/messages.po b/packages/app/src/locales/ko/messages.poindex 1300031b6..e0840c6bf 100644--- a/packages/app/src/locales/ko/messages.po+++ b/packages/app/src/locales/ko/messages.po@@ -739,6 +739,10 @@ msgstr "{label} ({0})"msgid "{label} enabled"msgstr "{label} 활성화됨"+#: src/components/file-tree-problem-indicators.ts+msgid "{label} problems"+msgstr "문제 {label}개"+#: src/components/ActivityPanelBurstRow.tsxmsgid "{laterEdits, plural, one {Removes # newer edit on this file.} other {Removes # newer edits on this file.}}"msgstr "{laterEdits, plural, other {이 파일의 최신 편집 #개를 제거합니다.}}"@@ -917,6 +921,10 @@ msgstr "{templateCount, plural, other {템플릿}}"msgid "{tokens, plural, one {token} other {tokens}}"msgstr "{tokens, plural, other {토큰}}"+#: src/components/file-tree-problem-indicators.ts+msgid "{total, plural, one {# problem} other {# problems}}"+msgstr "{total, plural, other {#개 문제}}"+#: src/components/FileTree.tsxmsgid "{truncatedShownCount, plural, one {Showing the first item in one folder — the rest of that folder is hidden.} other {Showing the first {formattedCount} items in one folder — the rest of that folder is hidden.}}"msgstr "{truncatedShownCount, plural, other {한 폴더의 첫 {formattedCount}개 항목만 표시됩니다. 해당 폴더의 나머지 항목은 숨겨져 있습니다.}}"@@ -950,6 +958,11 @@ msgstr "{userName} · {tabCount, plural, other {탭 #개}}"msgid "{userName}, {tabCount, plural, one {# concurrent tab} other {# concurrent tabs}}"msgstr "{userName}, {tabCount, plural, other {동시 탭 #개}}"+#. placeholder {0}: problemBadgeLabel(counts)+#: src/components/file-tree-problem-indicators.ts+msgid "{visibleSummary}. {0}"+msgstr "{visibleSummary}. {0}"+#: src/components/file-tree-problem-indicators.tsmsgid "{warningCount, plural, one {# warning} other {# warnings}}"msgstr "{warningCount, plural, other {경고 #개}}"diff --git a/packages/app/src/locales/pseudo/messages.json b/packages/app/src/locales/pseudo/messages.jsonindex 15c1bcd94..3319ec15b 100644--- a/packages/app/src/locales/pseudo/messages.json+++ b/packages/app/src/locales/pseudo/messages.json@@ -1162,6 +1162,7 @@"F4_wQj": ["Śēàŕćĥ ŵĩţĥ Ĝōōĝĺē"],"F4vEsL": ["Śŷńć śţàţũś: ", ["syncStateLabel"]],"F6pfE9": ["Àćţĩvē"],+ "F8GW_c": [["label"], " ƥŕōƀĺēḿś"],"FBknns": ["ĤŢḾĹ"],"FCAcjR": ["Ŕũń à ŕēàĺ ţēŕḿĩńàĺ ďōćķēď ĩńśĩďē ŌƥēńĶńōŵĺēďĝē, śţàŕţĩńĝ ĩń ţĥĩś ƥŕōĴēćţ'ś ƒōĺďēŕ."@@ -3065,6 +3066,7 @@["overflow"]," ḿōŕē ƀēƒōŕē ďēĺēţĩńĝ."],+ "dibzbg": [["visibleSummary"], ". ", ["0"]],"djc1l9": ["Ḿōŕē ţĥàń ", ["0"], " ŕēǫũēśţś ŵēŕē ƀĺōćķēď ƀŷ ţĥē ƥŕēvĩēŵ'ś śēćũŕĩţŷ ƥōĺĩćŷ"],"dprWmL": ["Àńćĥōŕ ĩń ţĥĩś ƥàĝē"],"dr1vFs": ["Ŕēƥĺàćē àĺĺ ḿàţćĥēś"],@@ -3087,6 +3089,7 @@"e8zYa8": ["Ćōũĺď ńōţ ōƥēń ", ["shareBranch"], " ĩń à ŵōŕķţŕēē. Ţŕŷ àĝàĩń."],"e9sHSO": ["Ƥĩćķ ũƥ ŵĥēŕē ŷōũ ĺēƒţ ōƒƒ"],"eBIT9h": ["Ƥàśţē ƒàĩĺēď.", ["restoreSuffix"]],+ "eCDwNN": [["total", "plural", { "one": ["#", " ƥŕōƀĺēḿ"], "other": ["#", " ƥŕōƀĺēḿś"] }]],"eFJkVt": ["Ćĺōńē ƒàĩĺēď: ", ["cloneError"]],"eG8Jsg": ["Ţōĝĝĺē śōũŕćē ţàƀ ƒōćũś ḿōďē"],"eGUbmF": ["Ćōƥŷ śēĺēćţēď ƒĩĺē ōŕ ƒōĺďēŕ"],diff --git a/packages/app/src/locales/pseudo/messages.po b/packages/app/src/locales/pseudo/messages.poindex a53626a5b..d03d3d0ee 100644--- a/packages/app/src/locales/pseudo/messages.po+++ b/packages/app/src/locales/pseudo/messages.po@@ -739,6 +739,10 @@ msgstr ""msgid "{label} enabled"msgstr ""+#: src/components/file-tree-problem-indicators.ts+msgid "{label} problems"+msgstr ""+#: src/components/ActivityPanelBurstRow.tsxmsgid "{laterEdits, plural, one {Removes # newer edit on this file.} other {Removes # newer edits on this file.}}"msgstr ""@@ -917,6 +921,10 @@ msgstr ""msgid "{tokens, plural, one {token} other {tokens}}"msgstr ""+#: src/components/file-tree-problem-indicators.ts+msgid "{total, plural, one {# problem} other {# problems}}"+msgstr ""+#: src/components/FileTree.tsxmsgid "{truncatedShownCount, plural, one {Showing the first item in one folder — the rest of that folder is hidden.} other {Showing the first {formattedCount} items in one folder — the rest of that folder is hidden.}}"msgstr ""@@ -950,6 +958,11 @@ msgstr ""msgid "{userName}, {tabCount, plural, one {# concurrent tab} other {# concurrent tabs}}"msgstr ""+#. placeholder {0}: problemBadgeLabel(counts)+#: src/components/file-tree-problem-indicators.ts+msgid "{visibleSummary}. {0}"+msgstr ""+#: src/components/file-tree-problem-indicators.tsmsgid "{warningCount, plural, one {# warning} other {# warnings}}"msgstr ""diff --git a/packages/app/src/locales/pt-BR/messages.json b/packages/app/src/locales/pt-BR/messages.jsonindex 838bfb3c2..c43d3c88d 100644--- a/packages/app/src/locales/pt-BR/messages.json+++ b/packages/app/src/locales/pt-BR/messages.json@@ -1329,6 +1329,7 @@"F4_wQj": ["Pesquisar com o Google"],"F4vEsL": ["Status da sincronização: ", ["syncStateLabel"]],"F6pfE9": ["Ativo"],+ "F8GW_c": [["label"], " problemas"],"FBknns": ["HTML"],"FCAcjR": ["Rode um terminal de verdade acoplado dentro do OpenKnowledge, começando na pasta deste projeto."@@ -3505,6 +3506,7 @@["overflow"]," antes de excluir."],+ "dibzbg": [["visibleSummary"], ". ", ["0"]],"djc1l9": ["A política de segurança da pré-visualização bloqueou mais de ",["0"],@@ -3531,6 +3533,13 @@"e8zYa8": ["Não foi possível abrir ", ["shareBranch"], " em um worktree. Tente de novo."],"e9sHSO": ["Continue de onde parou"],"eBIT9h": ["Falha ao colar.", ["restoreSuffix"]],+ "eCDwNN": [+ [+ "total",+ "plural",+ { "one": ["#", " problema"], "many": ["#", " problemas"], "other": ["#", " problemas"] }+ ]+ ],"eFJkVt": ["Falha ao clonar: ", ["cloneError"]],"eG8Jsg": ["Ativar ou desativar o modo de foco do Tab no código"],"eGUbmF": ["Copiar o arquivo ou a pasta selecionados"],diff --git a/packages/app/src/locales/pt-BR/messages.po b/packages/app/src/locales/pt-BR/messages.poindex 6074d54fb..a0dad4f5f 100644--- a/packages/app/src/locales/pt-BR/messages.po+++ b/packages/app/src/locales/pt-BR/messages.po@@ -739,6 +739,10 @@ msgstr "{label} ({0})"msgid "{label} enabled"msgstr "{label} ativado"+#: src/components/file-tree-problem-indicators.ts+msgid "{label} problems"+msgstr "{label} problemas"+#: src/components/ActivityPanelBurstRow.tsxmsgid "{laterEdits, plural, one {Removes # newer edit on this file.} other {Removes # newer edits on this file.}}"msgstr "{laterEdits, plural, one {Remove # edição mais recente deste arquivo.} many {Remove # edições mais recentes deste arquivo.} other {Remove # edições mais recentes deste arquivo.}}"@@ -917,6 +921,10 @@ msgstr "{templateCount, plural, one {modelo} many {modelos} other {modelos}}"msgid "{tokens, plural, one {token} other {tokens}}"msgstr "{tokens, plural, one {token} many {tokens} other {tokens}}"+#: src/components/file-tree-problem-indicators.ts+msgid "{total, plural, one {# problem} other {# problems}}"+msgstr "{total, plural, one {# problema} many {# problemas} other {# problemas}}"+#: src/components/FileTree.tsxmsgid "{truncatedShownCount, plural, one {Showing the first item in one folder — the rest of that folder is hidden.} other {Showing the first {formattedCount} items in one folder — the rest of that folder is hidden.}}"msgstr "{truncatedShownCount, plural, one {Mostrando o primeiro item de uma pasta — o resto dessa pasta está oculto.} many {Mostrando os primeiros {formattedCount} itens de uma pasta — o resto dessa pasta está oculto.} other {Mostrando os primeiros {formattedCount} itens de uma pasta — o resto dessa pasta está oculto.}}"@@ -950,6 +958,11 @@ msgstr "{userName} · {tabCount, plural, one {# aba} many {# abas} other {# abasmsgid "{userName}, {tabCount, plural, one {# concurrent tab} other {# concurrent tabs}}"msgstr "{userName}, {tabCount, plural, one {# aba simultânea} many {# abas simultâneas} other {# abas simultâneas}}"+#. placeholder {0}: problemBadgeLabel(counts)+#: src/components/file-tree-problem-indicators.ts+msgid "{visibleSummary}. {0}"+msgstr "{visibleSummary}. {0}"+#: src/components/file-tree-problem-indicators.tsmsgid "{warningCount, plural, one {# warning} other {# warnings}}"msgstr "{warningCount, plural, one {# aviso} many {# avisos} other {# avisos}}"diff --git a/packages/app/src/locales/ur/messages.json b/packages/app/src/locales/ur/messages.jsonindex beccba41f..184164261 100644--- a/packages/app/src/locales/ur/messages.json+++ b/packages/app/src/locales/ur/messages.json@@ -1182,6 +1182,7 @@"F4_wQj": ["Google سے تلاش کریں"],"F4vEsL": ["مطابقت پذیری کی حالت: ", ["syncStateLabel"]],"F6pfE9": ["فعال"],+ "F8GW_c": [["label"], " مسائل"],"FBknns": ["HTML"],"FCAcjR": ["OpenKnowledge کے اندر لگا ہوا ایک حقیقی ٹرمینل چلائیں، جو اس پروجیکٹ کے فولڈر سے شروع ہو۔"@@ -3148,6 +3149,7 @@["overflow"]," فائلوں کا تنازع حل کریں۔"],+ "dibzbg": [["visibleSummary"], "۔ ", ["0"]],"djc1l9": ["پیش منظر کی سیکیورٹی پالیسی نے ", ["0"], " سے زائد درخواستیں روکیں"],"dprWmL": ["اس صفحے میں اینکر"],"dr1vFs": ["تمام مماثلتیں تبدیل کریں"],@@ -3170,6 +3172,7 @@"e8zYa8": [["shareBranch"], " کسی ورک ٹری میں نہیں کھل سکا۔ دوبارہ کوشش کریں۔"],"e9sHSO": ["جہاں چھوڑا تھا وہیں سے شروع کریں"],"eBIT9h": ["چسپاں کرنا ناکام رہا۔", ["restoreSuffix"]],+ "eCDwNN": [["total", "plural", { "one": ["#", " مسئلہ"], "other": ["#", " مسائل"] }]],"eFJkVt": ["کلون ناکام: ", ["cloneError"]],"eG8Jsg": ["سورس ٹیب فوکس موڈ بدلیں"],"eGUbmF": ["منتخب فائل یا فولڈر نقل کریں"],diff --git a/packages/app/src/locales/ur/messages.po b/packages/app/src/locales/ur/messages.poindex b439e04da..1ffbc87f3 100644--- a/packages/app/src/locales/ur/messages.po+++ b/packages/app/src/locales/ur/messages.po@@ -739,6 +739,10 @@ msgstr "{label} ({0})"msgid "{label} enabled"msgstr "{label} فعال"+#: src/components/file-tree-problem-indicators.ts+msgid "{label} problems"+msgstr "{label} مسائل"+#: src/components/ActivityPanelBurstRow.tsxmsgid "{laterEdits, plural, one {Removes # newer edit on this file.} other {Removes # newer edits on this file.}}"msgstr "{laterEdits, plural, one {اس فائل پر # نئی ترمیم ہٹاتا ہے۔} other {اس فائل پر # نئی ترامیم ہٹاتا ہے۔}}"@@ -917,6 +921,10 @@ msgstr "{templateCount, plural, one {ٹیمپلیٹ} other {ٹیمپلیٹس}}"msgid "{tokens, plural, one {token} other {tokens}}"msgstr "{tokens, plural, one {ٹوکن} other {ٹوکنز}}"+#: src/components/file-tree-problem-indicators.ts+msgid "{total, plural, one {# problem} other {# problems}}"+msgstr "{total, plural, one {# مسئلہ} other {# مسائل}}"+#: src/components/FileTree.tsxmsgid "{truncatedShownCount, plural, one {Showing the first item in one folder — the rest of that folder is hidden.} other {Showing the first {formattedCount} items in one folder — the rest of that folder is hidden.}}"msgstr "{truncatedShownCount, plural, one {ایک فولڈر میں پہلا آئٹم دکھایا جا رہا ہے — اس فولڈر کا باقی حصہ چھپا ہوا ہے۔} other {ایک فولڈر میں پہلے {formattedCount} آئٹمز دکھائے جا رہے ہیں — اس فولڈر کا باقی حصہ چھپا ہوا ہے۔}}"@@ -950,6 +958,11 @@ msgstr "{userName} · {tabCount, plural, one {# ٹیب} other {# ٹیبز}}"msgid "{userName}, {tabCount, plural, one {# concurrent tab} other {# concurrent tabs}}"msgstr "{userName}، {tabCount, plural, one {# بیک وقت ٹیب} other {# بیک وقت ٹیبز}}"+#. placeholder {0}: problemBadgeLabel(counts)+#: src/components/file-tree-problem-indicators.ts+msgid "{visibleSummary}. {0}"+msgstr "{visibleSummary}۔ {0}"+#: src/components/file-tree-problem-indicators.tsmsgid "{warningCount, plural, one {# warning} other {# warnings}}"msgstr "{warningCount, plural, one {# انتباہ} other {# انتباہات}}"diff --git a/packages/app/src/locales/zh-Hans/messages.json b/packages/app/src/locales/zh-Hans/messages.jsonindex 6c8ec2040..08a004249 100644--- a/packages/app/src/locales/zh-Hans/messages.json+++ b/packages/app/src/locales/zh-Hans/messages.json@@ -1035,6 +1035,7 @@"F4_wQj": ["使用 Google 搜索"],"F4vEsL": ["同步状态:", ["syncStateLabel"]],"F6pfE9": ["活跃"],+ "F8GW_c": [["label"], " 个问题"],"FBknns": ["HTML"],"FCAcjR": ["在 OpenKnowledge 内部停靠运行一个真实终端,起始目录为这个项目的文件夹。"],"FCKppt": ["端点"],@@ -2711,6 +2712,7 @@"dbhUX1": ["隐藏这个文件"],"dbtjJh": ["(在新标签页中打开)"],"deD5fS": ["删除前请先解决 ", ["files"], " 以及另外 ", ["overflow"], " 个文件上的冲突。"],+ "dibzbg": [["visibleSummary"], "。", ["0"]],"djc1l9": ["预览的安全策略拦截了超过 ", ["0"], " 个请求"],"dprWmL": ["本页中的锚点"],"dr1vFs": ["替换所有匹配项"],@@ -2733,6 +2735,7 @@"e8zYa8": ["无法在 worktree 中打开 ", ["shareBranch"], "。请重试。"],"e9sHSO": ["从上次的位置继续"],"eBIT9h": ["粘贴失败。", ["restoreSuffix"]],+ "eCDwNN": [["total", "plural", { "other": ["#", " 个问题"] }]],"eFJkVt": ["克隆失败:", ["cloneError"]],"eG8Jsg": ["切换源码 Tab 焦点模式"],"eGUbmF": ["复制选中的文件或文件夹"],diff --git a/packages/app/src/locales/zh-Hans/messages.po b/packages/app/src/locales/zh-Hans/messages.poindex fe1e0590e..14638d860 100644--- a/packages/app/src/locales/zh-Hans/messages.po+++ b/packages/app/src/locales/zh-Hans/messages.po@@ -739,6 +739,10 @@ msgstr "{label}({0})"msgid "{label} enabled"msgstr "已启用 {label}"+#: src/components/file-tree-problem-indicators.ts+msgid "{label} problems"+msgstr "{label} 个问题"+#: src/components/ActivityPanelBurstRow.tsxmsgid "{laterEdits, plural, one {Removes # newer edit on this file.} other {Removes # newer edits on this file.}}"msgstr "{laterEdits, plural, other {会移除这个文件上 # 处较新的编辑。}}"@@ -917,6 +921,10 @@ msgstr "{templateCount, plural, other {模板}}"msgid "{tokens, plural, one {token} other {tokens}}"msgstr "{tokens, plural, other {token}}"+#: src/components/file-tree-problem-indicators.ts+msgid "{total, plural, one {# problem} other {# problems}}"+msgstr "{total, plural, other {# 个问题}}"+#: src/components/FileTree.tsxmsgid "{truncatedShownCount, plural, one {Showing the first item in one folder — the rest of that folder is hidden.} other {Showing the first {formattedCount} items in one folder — the rest of that folder is hidden.}}"msgstr "{truncatedShownCount, plural, other {只显示某个文件夹里的前 {formattedCount} 个项目——该文件夹的其余内容已隐藏。}}"@@ -950,6 +958,11 @@ msgstr "{userName} · {tabCount, plural, other {# 个标签页}}"msgid "{userName}, {tabCount, plural, one {# concurrent tab} other {# concurrent tabs}}"msgstr "{userName},{tabCount, plural, other {# 个并发标签页}}"+#. placeholder {0}: problemBadgeLabel(counts)+#: src/components/file-tree-problem-indicators.ts+msgid "{visibleSummary}. {0}"+msgstr "{visibleSummary}。{0}"+#: src/components/file-tree-problem-indicators.tsmsgid "{warningCount, plural, one {# warning} other {# warnings}}"msgstr "{warningCount, plural, other {# 个警告}}"diff --git a/packages/app/src/locales/zh-Hant/messages.json b/packages/app/src/locales/zh-Hant/messages.jsonindex 30d7e7706..6a3602d8f 100644--- a/packages/app/src/locales/zh-Hant/messages.json+++ b/packages/app/src/locales/zh-Hant/messages.json@@ -1045,6 +1045,7 @@"F4_wQj": ["使用 Google 搜尋"],"F4vEsL": ["同步狀態:", ["syncStateLabel"]],"F6pfE9": ["使用中"],+ "F8GW_c": [["label"], " 個問題"],"FBknns": ["HTML"],"FCAcjR": ["在 OpenKnowledge 內部停靠執行一個真正的終端機,起始位置是這個專案的資料夾。"],"FCKppt": ["端點"],@@ -2737,6 +2738,7 @@"dbhUX1": ["隱藏這個檔案"],"dbtjJh": ["(在新分頁中開啟)"],"deD5fS": ["刪除前請先解決 ", ["files"], " 以及另外 ", ["overflow"], " 個檔案上的衝突。"],+ "dibzbg": [["visibleSummary"], "。", ["0"]],"djc1l9": ["預覽的安全性原則攔截了超過 ", ["0"], " 個要求"],"dprWmL": ["這個頁面中的錨點"],"dr1vFs": ["取代所有相符項"],@@ -2759,6 +2761,7 @@"e8zYa8": ["無法在 worktree 中開啟 ", ["shareBranch"], "。請再試一次。"],"e9sHSO": ["從上次停下的地方繼續"],"eBIT9h": ["貼上失敗。", ["restoreSuffix"]],+ "eCDwNN": [["total", "plural", { "other": ["#", " 個問題"] }]],"eFJkVt": ["複製失敗:", ["cloneError"]],"eG8Jsg": ["切換原始碼 Tab 焦點模式"],"eGUbmF": ["複製選取的檔案或資料夾"],diff --git a/packages/app/src/locales/zh-Hant/messages.po b/packages/app/src/locales/zh-Hant/messages.poindex 652a7c336..db16e6cd3 100644--- a/packages/app/src/locales/zh-Hant/messages.po+++ b/packages/app/src/locales/zh-Hant/messages.po@@ -739,6 +739,10 @@ msgstr "{label}({0})"msgid "{label} enabled"msgstr "已啟用 {label}"+#: src/components/file-tree-problem-indicators.ts+msgid "{label} problems"+msgstr "{label} 個問題"+#: src/components/ActivityPanelBurstRow.tsxmsgid "{laterEdits, plural, one {Removes # newer edit on this file.} other {Removes # newer edits on this file.}}"msgstr "{laterEdits, plural, other {會移除這個檔案上 # 處較新的編輯。}}"@@ -917,6 +921,10 @@ msgstr "{templateCount, plural, other {範本}}"msgid "{tokens, plural, one {token} other {tokens}}"msgstr "{tokens, plural, other {token}}"+#: src/components/file-tree-problem-indicators.ts+msgid "{total, plural, one {# problem} other {# problems}}"+msgstr "{total, plural, other {# 個問題}}"+#: src/components/FileTree.tsxmsgid "{truncatedShownCount, plural, one {Showing the first item in one folder — the rest of that folder is hidden.} other {Showing the first {formattedCount} items in one folder — the rest of that folder is hidden.}}"msgstr "{truncatedShownCount, plural, other {只顯示某個資料夾裡的前 {formattedCount} 個項目——該資料夾的其餘內容已隱藏。}}"@@ -950,6 +958,11 @@ msgstr "{userName} · {tabCount, plural, other {# 個分頁}}"msgid "{userName}, {tabCount, plural, one {# concurrent tab} other {# concurrent tabs}}"msgstr "{userName},{tabCount, plural, other {# 個同時開啟的分頁}}"+#. placeholder {0}: problemBadgeLabel(counts)+#: src/components/file-tree-problem-indicators.ts+msgid "{visibleSummary}. {0}"+msgstr "{visibleSummary}。{0}"+#: src/components/file-tree-problem-indicators.tsmsgid "{warningCount, plural, one {# warning} other {# warnings}}"msgstr "{warningCount, plural, other {# 個警告}}"diff --git a/packages/app/tests/stress/unified-problems.e2e.ts b/packages/app/tests/stress/unified-problems.e2e.tsindex 877b00e71..676017fa0 100644--- a/packages/app/tests/stress/unified-problems.e2e.ts+++ b/packages/app/tests/stress/unified-problems.e2e.ts@@ -188,6 +188,120 @@ test.describe('unified Problems — file-tree indicators', () => {expect(colors.problem).not.toBe(colors.clean);});+ test('the badge is a keyboard-reachable control with a real hit target', async ({ page }) => {+ // The rung nothing below can reach: jsdom implements no sequential focus+ // navigation, resolves no layout, and never matches :focus-visible, so+ // "can this badge hold focus, does it paint a ring, is it big enough to+ // hit, and does Enter open the panel" are all invisible until a real+ // browser runs it. The badge is a tabindex'd span INSIDE the host's row+ // <button>, and the host re-seats DOM focus onto that button from a layout+ // effect, so its ability to keep focus is a property of the host, not of+ // this code — pin it here or it regresses on a dependency bump.+ await openProblemsTab(page);+ await openProjectScope(page);+ await expect+ .poll(+ async () => {+ const row = await treeRowHandle(page, `${lintDocName}.md`);+ return row.evaluate((el) => el?.getAttribute('data-ok-problem') ?? null);+ },+ { timeout: 15_000 },+ )+ .toBe('warning');++ const rowSelector = `[data-type="item"][data-item-path="${lintDocName}.md"]`;+ const badge = page+ .locator('file-tree-container')+ .locator(`${rowSelector} [data-ok-problem-badge]`);++ // Focus the row the way a click would, then Tab: the badge is the next stop.+ await page.locator('file-tree-container').evaluate((host, selector) => {+ const shadow = (host as Element & { shadowRoot: ShadowRoot | null }).shadowRoot;+ (shadow?.querySelector(selector) as HTMLElement | null)?.focus();+ }, rowSelector);+ await page.keyboard.press('Tab');++ const focused = await page.locator('file-tree-container').evaluate((host) => {+ const shadow = (host as Element & { shadowRoot: ShadowRoot | null }).shadowRoot;+ const active = shadow?.activeElement as HTMLElement | null;+ if (!active?.hasAttribute('data-ok-problem-badge')) return null;+ const style = getComputedStyle(active);+ const box = active.getBoundingClientRect();+ // The painted chip stays small; the TARGET is expanded around it, so+ // probe the extremes of the required 24px box by hit-testing rather than+ // measuring the chip. Half a pixel inside each edge, so a target that is+ // exactly 24px does not fail on a rounding boundary.+ const probe = (dy: number) =>+ shadow?.elementFromPoint(box.left + box.width / 2, box.top + box.height / 2 + dy) ?? null;+ return {+ role: active.getAttribute('role'),+ chipHeight: box.height,+ outlineWidth: style.outlineWidth,+ outlineStyle: style.outlineStyle,+ outlineColor: style.outlineColor,+ hitsAbove: probe(-11.5) === active,+ hitsBelow: probe(11.5) === active,+ };+ });++ // Tab reached it and the host did not pull focus back onto the row.+ expect(focused).not.toBeNull();+ expect(focused?.role).toBe('button');+ // DOM role/name alone are insufficient here: a role nested under a native+ // button can be flattened out of the accessibility tree. Chromium must+ // expose this exact control to assistive technology, not merely focus it.+ expect(await badge.ariaSnapshot()).toContain(+ 'button "1 problem. 1 warning in this file. Open the Problems panel for details."',+ );+ // A ring that resolves to zero width or a transparent color is no ring.+ expect(focused?.outlineStyle).not.toBe('none');+ expect(focused?.outlineWidth).not.toBe('0px');+ expect(focused?.outlineColor).not.toMatch(/transparent|rgba\(0, 0, 0, 0\)/);+ // Vertically the target clears 24px, which the painted chip alone does not.+ expect(focused?.chipHeight).toBeLessThan(24);+ expect(focused?.hitsAbove).toBe(true);+ expect(focused?.hitsBelow).toBe(true);++ // Enter on the focused badge is the whole feature, from the keyboard.+ await page.keyboard.press('Enter');+ await expect(page.getByTestId('panel-scope-doc')).toHaveAttribute('data-state', 'on', {+ timeout: 10_000,+ });+ await expect(page.getByTestId('problems-panel')).toBeFocused();+ await expect(page).toHaveURL(new RegExp(`#/${lintDocName}$`), { timeout: 10_000 });+ });++ test('a modified click on the badge stays the tree multi-select gesture', async ({ page }) => {+ // The badge sits inside the row, so a gesture it swallows is a gesture the+ // tree never sees. Only a real browser resolves the host's selection model.+ await openProblemsTab(page);+ await openProjectScope(page);+ const badge = page+ .locator('file-tree-container')+ .locator(`[data-item-path="${lintDocName}.md"] [data-ok-problem-badge]`);+ await expect(badge).toBeVisible({ timeout: 15_000 });++ const selected = () =>+ page.locator('file-tree-container').evaluate((host) => {+ const shadow = (host as Element & { shadowRoot: ShadowRoot | null }).shadowRoot;+ return [...(shadow?.querySelectorAll('[data-item-selected]') ?? [])]+ .map((el) => el.getAttribute('data-item-path'))+ .sort();+ });++ await page+ .locator('file-tree-container')+ .locator(`[data-item-path="${openDocName}.md"]`)+ .click();+ await expect.poll(selected).toEqual([`${openDocName}.md`]);++ await badge.click({ modifiers: ['Meta'] });++ // Cmd-click ADDS to the selection. Activating the badge instead would+ // collapse it to one row and destroy the selection being assembled.+ await expect.poll(selected).toEqual([`${lintDocName}.md`, `${openDocName}.md`].sort());+ });+test('enabling the plugin from Settings lights up an UNOPENED doc row', async ({ page, api }) => {// The report's headline symptom: "you enable the plugin, nothing lights up."// Driven through the real Settings switch rather than an API call, because