From 9854afce111c347068a20c41b331d50912e1a5e7 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 15 Nov 2026 18:14:55 +0000 Subject: [PATCH 1/3] feat(console): list the candidate packages when a doc read is refused as ambiguous A doc name two enabled packages ship is refused by a read that names no package (409 RESOURCE_CONFLICT, holders in details.candidates). The docs reader now lists those packages, each linking to its package address, and a flat permalink under a package container opens that package's own copy in that package's book. Claude-Session: https://claude.ai/code/session_01ADHkmP4uQusF8yrKtRnvqJ Co-authored-by: Claude --- ui/apps/console/src/pages/DocPage.tsx | 82 ++++++++++- ui/apps/console/src/pages/DocsSlug.tsx | 8 +- ui/apps/console/src/pages/book-nav.ts | 8 +- .../console/src/pages/docs-portal.test.tsx | 136 +++++++++++++++++- ui/packages/i18n/src/locales/ar.ts | 3 + ui/packages/i18n/src/locales/de.ts | 3 + ui/packages/i18n/src/locales/en.ts | 3 + ui/packages/i18n/src/locales/es.ts | 3 + ui/packages/i18n/src/locales/fr.ts | 3 + ui/packages/i18n/src/locales/ja.ts | 3 + ui/packages/i18n/src/locales/ko.ts | 3 + ui/packages/i18n/src/locales/pt-BR.ts | 3 + ui/packages/i18n/src/locales/ru.ts | 3 + ui/packages/i18n/src/locales/zh-Hans.ts | 3 + ui/packages/i18n/src/locales/zh-Hant.ts | 3 + 15 files changed, 253 insertions(+), 14 deletions(-) diff --git a/ui/apps/console/src/pages/DocPage.tsx b/ui/apps/console/src/pages/DocPage.tsx index 37f0ada33f1..217c8533173 100644 --- a/ui/apps/console/src/pages/DocPage.tsx +++ b/ui/apps/console/src/pages/DocPage.tsx @@ -7,8 +7,8 @@ */ import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; -import { Navigate, useHref, useLocation, useNavigate, useParams } from 'react-router-dom'; -import { AlertCircle, ChevronDown, FileQuestion, Loader2, Menu } from 'lucide-react'; +import { Link, Navigate, useHref, useLocation, useNavigate, useParams } from 'react-router-dom'; +import { AlertCircle, ChevronDown, FileQuestion, Layers, Loader2, Menu } from 'lucide-react'; import { useAdapter } from '@object-ui/app-shell'; import { MarkdownRenderer, extractToc } from '@object-ui/plugin-markdown'; import { useObjectTranslation } from '@object-ui/i18n'; @@ -17,7 +17,7 @@ import { DocShell } from './DocShell'; import { BookSidebar } from './BookSidebar'; import { DocRefusal } from './BookPage'; import { useBookData } from './use-book-data'; -import { resolveBookTree, bookSlug, bookNamedBy, labelUncategorized, type ResolvedBook } from './book-nav'; +import { resolveBookTree, bookSlug, bookNamedBy, homeBook, labelUncategorized, type ResolvedBook } from './book-nav'; interface DocItem { name: string; @@ -32,6 +32,24 @@ function scrollHeadingIntoView(id: string): boolean { return target !== null; } +/** + * The packages a `409 RESOURCE_CONFLICT` doc read names as holders of the + * name: `@objectstack/client` carries the refusal's `details.candidates` on the + * rejection (`{ kind: 'package', packageId }` per package). Null for any other + * failure, and for a refusal that names no package, so those keep their state. + */ +function conflictCandidates(err: unknown): string[] | null { + const e = err as { httpStatus?: unknown; code?: unknown; details?: { candidates?: unknown } } | null; + if (e?.httpStatus !== 409 || e.code !== 'RESOURCE_CONFLICT') return null; + const candidates = e.details?.candidates; + if (!Array.isArray(candidates)) return null; + const packageIds = candidates + .filter((c): c is { kind: 'package'; packageId: string } => + c?.kind === 'package' && typeof c.packageId === 'string' && c.packageId !== '') + .map((c) => c.packageId); + return packageIds.length > 0 ? packageIds : null; +} + /** * `/docs/:name` — render one package-doc metadata item (ADR-0046). * @@ -48,6 +66,12 @@ function scrollHeadingIntoView(id: string): boolean { * A doc the member may not read is a different answer: the server refuses it * with 401 / 403 (ADR-0046 §6.7), and the page shows that refusal, with the * server's reason, rather than "not found" or a load failure (objectui#10188). + * + * A name two or more enabled packages ship is refused by a read that names no + * package, `409 RESOURCE_CONFLICT` with the holders as candidates (ADR-0150 + * D3). Nothing picks one: the page lists the candidates, each opening that + * package's copy at its package address `/apps//docs/`, where + * the read names the package. */ export default function DocPage() { // Route is `/docs/:slug/:name` (`:slug` = book, `:name` = doc). `appName` is @@ -72,8 +96,9 @@ export default function DocPage() { const adapter = useAdapter(); const { t } = useObjectTranslation(); const [doc, setDoc] = useState(null); - const [state, setState] = useState<'loading' | 'ready' | 'missing' | 'refused' | 'error'>('loading'); + const [state, setState] = useState<'loading' | 'ready' | 'missing' | 'refused' | 'conflict' | 'error'>('loading'); const [errorMessage, setErrorMessage] = useState(''); + const [candidates, setCandidates] = useState([]); useEffect(() => { let cancelled = false; @@ -104,6 +129,14 @@ export default function DocPage() { setState('refused'); return; } + // Two or more packages ship this name and the read named none of + // them: the server names the holders, and the reader picks one. + const holders = conflictCandidates(err); + if (holders) { + setCandidates(holders); + setState('conflict'); + return; + } // The metadata API answers 404 for unknown names — that is the // ADR-mandated soft-degrade path, not an error. if (status === 404 || /not found/i.test(err?.message ?? '')) { @@ -249,6 +282,47 @@ export default function DocPage() { return ; } + if (state === 'conflict') { + return ( + +
+ +

+ {t('help.docConflictTitle', { defaultValue: 'Choose a package' })} +

+

+ {t('help.docConflictDescription', { + defaultValue: 'More than one installed package provides a document named {{name}}. Open the one you want to read.', + name, + })} +

+
    + {candidates.map((packageId) => { + // The package as the portal names it: its home book for this doc. + const label = (name ? homeBook(name, books, allDocs, packageId)?.label : undefined) ?? packageId; + return ( +
  • + + {label} + {label !== packageId ? ( + {packageId} + ) : null} + +
  • + ); + })} +
+
+
+ ); + } + if (state === 'error') { return ( diff --git a/ui/apps/console/src/pages/DocsSlug.tsx b/ui/apps/console/src/pages/DocsSlug.tsx index 66fb17ee9be..6164bc8b01b 100644 --- a/ui/apps/console/src/pages/DocsSlug.tsx +++ b/ui/apps/console/src/pages/DocsSlug.tsx @@ -14,7 +14,7 @@ import { useAdapter } from '@object-ui/app-shell'; import { DocShell } from './DocShell'; import BookPage, { DocRefusal } from './BookPage'; import { useBookData } from './use-book-data'; -import { bookNamedBy, bookSlug, homeBook } from './book-nav'; +import { bookNamedBy, bookSlug, homeBook, pkgOf } from './book-nav'; /** What the server says about one segment the member's lists do not answer. */ type SegmentAnswer = { slug: string; refusal: string | null }; @@ -114,7 +114,11 @@ export default function DocsSlug() { // Otherwise a flat doc permalink → redirect to its canonical in-book URL. const base = appName ? `/apps/${appName}/docs` : '/docs'; - const hb = slug ? homeBook(slug, books, docs) : null; + // Under a package container that ships this name, its own copy decides the + // home book: two packages may ship one doc name, and the doc read there names + // the container's package (objectstack#34070), so the book must be its too. + const ownCopy = !!appName && docs.some((d) => d.name === slug && pkgOf(d) === appName); + const hb = slug ? homeBook(slug, books, docs, ownCopy ? appName : undefined) : null; if (hb && slug && docs.some((d) => d.name === slug)) { return ; } diff --git a/ui/apps/console/src/pages/book-nav.ts b/ui/apps/console/src/pages/book-nav.ts index 1a5ea0b6743..1c8fd75720b 100644 --- a/ui/apps/console/src/pages/book-nav.ts +++ b/ui/apps/console/src/pages/book-nav.ts @@ -453,10 +453,14 @@ function humanizePackageId(pkg: string): string { * navigation entry opens the page in its book's context (objectui#10188, the * card's addendum). Only a doc no book of its package claims falls back to the * package's first book in display order, as before. + * + * Two packages may ship one doc name (objectstack#34070). `packageId` then + * names whose copy is meant, so the home book is that package's; without it + * the package is the first listed doc of the name's, as before. */ -export function homeBook(docName: string, portalBooks: Book[], docs: ResolverDoc[]): Book | null { +export function homeBook(docName: string, portalBooks: Book[], docs: ResolverDoc[], packageId?: string): Book | null { const doc = docs.find((d) => d.name === docName); - const pkg = doc ? pkgOf(doc) : namePrefix(docName); + const pkg = packageId ?? (doc ? pkgOf(doc) : namePrefix(docName)); const ownBooks = sortBooks(portalBooks).filter((b) => pkgOfBook(b) === pkg); return findBookContainingDoc(ownBooks, docs, docName)?.book ?? ownBooks[0] ?? null; } diff --git a/ui/apps/console/src/pages/docs-portal.test.tsx b/ui/apps/console/src/pages/docs-portal.test.tsx index cc549aaed8f..a0413e7774f 100644 --- a/ui/apps/console/src/pages/docs-portal.test.tsx +++ b/ui/apps/console/src/pages/docs-portal.test.tsx @@ -18,7 +18,7 @@ */ import { describe, it, expect, vi, afterEach, beforeEach } from 'vitest'; -import { render, screen, cleanup, fireEvent, waitFor } from '@testing-library/react'; +import { render, screen, cleanup, fireEvent, waitFor, within } from '@testing-library/react'; import { MemoryRouter, Routes, Route, useLocation } from 'react-router-dom'; // ── Sample metadata the mocked adapter serves (two packages, no books) ────── @@ -72,17 +72,48 @@ const { ADAPTER, WORLD } = vi.hoisted(() => { acme_intro: 'ACME BODY', ops_setup: 'OPS BODY', }; - const WORLD = { authored: false }; + // objectstack#34070 — a third world, switched on only by the "two packages + // ship one doc name" block: `shared_guide` is shipped by alpha AND beta (beta + // listed first), and a read of it that names no package is refused the way + // the server refuses it, `409 RESOURCE_CONFLICT` naming both holders. + const CONFLICT_DOCS = [ + { name: 'shared_guide', label: 'Shared Guide', _packageId: 'com.example.beta' }, + { name: 'beta_start', label: 'Beta Start', _packageId: 'com.example.beta' }, + { name: 'shared_guide', label: 'Shared Guide', _packageId: 'com.example.alpha' }, + { name: 'alpha_welcome', label: 'Alpha Welcome', _packageId: 'com.example.alpha' }, + ]; + const CONFLICT_CONTENT: Record> = { + 'com.example.alpha': { shared_guide: 'ALPHA SHARED BODY', alpha_welcome: 'ALPHA BODY' }, + 'com.example.beta': { shared_guide: 'BETA SHARED BODY', beta_start: 'BETA BODY' }, + }; + /** A rejection shaped like `@objectstack/client`'s on a non-2xx response. */ + const failure = (httpStatus: number, code: string, message: string, details?: unknown) => + Object.assign(new Error(message), { httpStatus, code, details }); + const conflictRead = (name: string, packageId: string | undefined) => { + if (name === 'broken_doc') throw failure(500, 'INTERNAL_ERROR', 'The metadata service is unavailable'); + const holders = Object.keys(CONFLICT_CONTENT).filter((p) => name in CONFLICT_CONTENT[p]); + if (packageId) return { item: { name, content: CONFLICT_CONTENT[packageId]?.[name] } }; + if (holders.length > 1) { + throw failure(409, 'RESOURCE_CONFLICT', `doc "${name}" is held by ${holders.length} packages`, { + candidates: holders.map((p) => ({ kind: 'package', packageId: p })), + }); + } + return { item: { name, content: holders.length ? CONFLICT_CONTENT[holders[0]][name] : undefined } }; + }; + const WORLD = { authored: false, conflict: false }; const ADAPTER = { getClient: () => ({ meta: { getItems: async (type: string) => - WORLD.authored + WORLD.conflict + ? (type === 'doc' ? CONFLICT_DOCS : []) // implicit books only + : WORLD.authored ? (type === 'doc' ? AUTHORED_DOCS : type === 'book' ? AUTHORED_BOOKS : []) : (type === 'doc' ? DOCS : []), // no authored books - getItem: async (_type: string, name: string) => ({ - item: { name, content: (WORLD.authored ? AUTHORED_CONTENT : CONTENT)[name] }, - }), + getItem: async (_type: string, name: string, options?: { packageId?: string }) => + WORLD.conflict + ? conflictRead(name, options?.packageId) + : { item: { name, content: (WORLD.authored ? AUTHORED_CONTENT : CONTENT)[name] } }, }, }), }; @@ -436,3 +467,96 @@ describe('objectstack#33055 — the #section survives the flat → canonical red await waitFor(() => expect(scrolled).toEqual(['lead-scoring'])); }); }); + + +// ───────────────────────────────────────────────────────────────────────────── +// objectstack#34070 — a doc name two packages ship: the reader picks the package +// ───────────────────────────────────────────────────────────────────────────── + +/** + * Two enabled packages may ship one doc name. A read of it that names no + * package is refused, `409 RESOURCE_CONFLICT`, with the holders in the + * refusal's `details.candidates` (ADR-0150 D3; the `/meta` 409 section of + * `content/docs/api/client-sdk.mdx`). The portal lists those candidates, each + * linking to its package address `/apps/PACKAGE/docs/NAME`, where the read names + * the package and the doc opens in that package's own book. One holder, and + * any other failure, answer as they did. + */ +describe('objectstack#34070 — a doc name two packages ship lists its candidate packages', () => { + function Where() { + return
{useLocation().pathname}
; + } + function Portal({ entry }: { entry: string }) { + const children = ( + <> + } /> + } /> + + ); + return ( + + + + }> + } /> + {children} + + }> + {children} + + + + ); + } + const candidateList = () => screen.findByRole('list', { name: 'Packages that provide this document' }); + + beforeEach(() => { + WORLD.conflict = true; + }); + afterEach(() => { + WORLD.conflict = false; + }); + + it('a 409 with two candidates lists both, each linking to its package address', async () => { + render(); + const list = await candidateList(); + expect(screen.getByRole('heading', { name: 'Choose a package' })).toBeInTheDocument(); + const links = within(list).getAllByRole('link'); + expect(links.map((l) => l.getAttribute('href'))).toEqual([ + '/apps/com.example.alpha/docs/shared_guide', + '/apps/com.example.beta/docs/shared_guide', + ]); + // The package as the portal names it (its book), with its id beside it. + expect(links.map((l) => l.textContent)).toEqual(['Alphacom.example.alpha', 'Betacom.example.beta']); + expect(screen.queryByTestId('doc-content')).toBeNull(); + expect(screen.queryByText('Failed to load documentation')).toBeNull(); + }); + + it('each candidate opens that package\'s doc, in that package\'s book', async () => { + render(); + fireEvent.click(within(await candidateList()).getByRole('link', { name: /com\.example\.alpha/ })); + expect(await screen.findByTestId('doc-content')).toHaveTextContent('ALPHA SHARED BODY'); + // Beta is listed first by the server; the package container decides the book. + expect(screen.getByTestId('where').textContent).toBe('/apps/com.example.alpha/docs/com.example.alpha/shared_guide'); + cleanup(); + + render(); + fireEvent.click(within(await candidateList()).getByRole('link', { name: /com\.example\.beta/ })); + expect(await screen.findByTestId('doc-content')).toHaveTextContent('BETA SHARED BODY'); + expect(screen.getByTestId('where').textContent).toBe('/apps/com.example.beta/docs/com.example.beta/shared_guide'); + }); + + it('CONTROL: a doc one package ships renders as today, with no candidate list', async () => { + render(); + expect(await screen.findByTestId('doc-content')).toHaveTextContent('ALPHA BODY'); + expect(screen.getByTestId('where').textContent).toBe('/docs/com.example.alpha/alpha_welcome'); + expect(screen.queryByRole('list', { name: 'Packages that provide this document' })).toBeNull(); + }); + + it('CONTROL: a failure that is not the 409 keeps today\'s error state', async () => { + render(); + expect(await screen.findByText('Failed to load documentation')).toBeInTheDocument(); + expect(screen.getByText('The metadata service is unavailable')).toBeInTheDocument(); + expect(screen.queryByRole('list', { name: 'Packages that provide this document' })).toBeNull(); + }); +}); diff --git a/ui/packages/i18n/src/locales/ar.ts b/ui/packages/i18n/src/locales/ar.ts index 1a1edcdecdd..f8a4d3cea7c 100644 --- a/ui/packages/i18n/src/locales/ar.ts +++ b/ui/packages/i18n/src/locales/ar.ts @@ -3409,6 +3409,9 @@ const ar = { allDocs: 'كل الوثائق', onlineDocs: 'الوثائق عبر الإنترنت', loadingDocumentation: 'جارٍ تحميل الوثائق', + docConflictTitle: 'اختر حزمة', + docConflictDescription: 'توفّر أكثر من حزمة مثبّتة مستندًا باسم {{name}}. افتح المستند الذي تريد قراءته.', + docConflictCandidates: 'الحزم التي توفّر هذا المستند', documentation: 'الوثائق', uncategorized: 'غير مصنف', about: 'حول', diff --git a/ui/packages/i18n/src/locales/de.ts b/ui/packages/i18n/src/locales/de.ts index fb5d0156b7f..5f2a3369d71 100644 --- a/ui/packages/i18n/src/locales/de.ts +++ b/ui/packages/i18n/src/locales/de.ts @@ -3135,6 +3135,9 @@ const de = { allDocs: 'Gesamte Dokumentation', onlineDocs: 'Online-Dokumentation', loadingDocumentation: 'Dokumentation wird geladen', + docConflictTitle: 'Paket auswählen', + docConflictDescription: 'Mehr als ein installiertes Paket stellt ein Dokument namens {{name}} bereit. Öffnen Sie das gewünschte.', + docConflictCandidates: 'Pakete, die dieses Dokument bereitstellen', documentation: 'Dokumentation', uncategorized: 'Nicht kategorisiert', about: 'Über', diff --git a/ui/packages/i18n/src/locales/en.ts b/ui/packages/i18n/src/locales/en.ts index 5af7c5ae8ef..38d44ccad62 100644 --- a/ui/packages/i18n/src/locales/en.ts +++ b/ui/packages/i18n/src/locales/en.ts @@ -3794,6 +3794,9 @@ const en = { keyboardShortcuts: 'Keyboard shortcuts', onlineDocs: 'Online documentation', loadingDocumentation: 'Loading documentation', + docConflictTitle: 'Choose a package', + docConflictDescription: 'More than one installed package provides a document named {{name}}. Open the one you want to read.', + docConflictCandidates: 'Packages that provide this document', documentation: 'Documentation', uncategorized: 'Uncategorized', about: 'About', diff --git a/ui/packages/i18n/src/locales/es.ts b/ui/packages/i18n/src/locales/es.ts index c687727dbce..e7f43fda5f5 100644 --- a/ui/packages/i18n/src/locales/es.ts +++ b/ui/packages/i18n/src/locales/es.ts @@ -3205,6 +3205,9 @@ const es = { allDocs: 'Toda la documentación', onlineDocs: 'Documentación en línea', loadingDocumentation: 'Cargando documentación', + docConflictTitle: 'Elija un paquete', + docConflictDescription: 'Más de un paquete instalado proporciona un documento llamado {{name}}. Abra el que quiera leer.', + docConflictCandidates: 'Paquetes que proporcionan este documento', documentation: 'Documentación', uncategorized: 'Sin categoría', about: 'Acerca de', diff --git a/ui/packages/i18n/src/locales/fr.ts b/ui/packages/i18n/src/locales/fr.ts index 7ae83c77f77..78783ed4870 100644 --- a/ui/packages/i18n/src/locales/fr.ts +++ b/ui/packages/i18n/src/locales/fr.ts @@ -3201,6 +3201,9 @@ const fr = { allDocs: 'Toute la documentation', onlineDocs: 'Documentation en ligne', loadingDocumentation: 'Chargement de la documentation', + docConflictTitle: 'Choisissez un package', + docConflictDescription: 'Plusieurs packages installés fournissent un document nommé {{name}}. Ouvrez celui que vous voulez lire.', + docConflictCandidates: 'Packages qui fournissent ce document', documentation: 'Documentation', uncategorized: 'Non classé', about: 'À propos', diff --git a/ui/packages/i18n/src/locales/ja.ts b/ui/packages/i18n/src/locales/ja.ts index ce4b83d19a1..2bbdcf1d902 100644 --- a/ui/packages/i18n/src/locales/ja.ts +++ b/ui/packages/i18n/src/locales/ja.ts @@ -3137,6 +3137,9 @@ const ja = { allDocs: 'すべてのドキュメント', onlineDocs: 'オンラインドキュメント', loadingDocumentation: 'ドキュメントを読み込み中', + docConflictTitle: 'パッケージを選択', + docConflictDescription: '{{name}} という名前のドキュメントを提供するパッケージが複数インストールされています。読みたいものを開いてください。', + docConflictCandidates: 'このドキュメントを提供するパッケージ', documentation: 'ドキュメント', uncategorized: '未分類', about: 'バージョン情報', diff --git a/ui/packages/i18n/src/locales/ko.ts b/ui/packages/i18n/src/locales/ko.ts index 03b807cc385..85e340a1cee 100644 --- a/ui/packages/i18n/src/locales/ko.ts +++ b/ui/packages/i18n/src/locales/ko.ts @@ -3135,6 +3135,9 @@ const ko = { allDocs: '전체 문서', onlineDocs: '온라인 문서', loadingDocumentation: '문서 로딩 중', + docConflictTitle: '패키지 선택', + docConflictDescription: '{{name}} 문서를 제공하는 설치된 패키지가 둘 이상 있습니다. 읽을 문서를 여세요.', + docConflictCandidates: '이 문서를 제공하는 패키지', documentation: '문서', uncategorized: '미분류', about: '정보', diff --git a/ui/packages/i18n/src/locales/pt-BR.ts b/ui/packages/i18n/src/locales/pt-BR.ts index 33eaece28e0..fb06f2e6b8b 100644 --- a/ui/packages/i18n/src/locales/pt-BR.ts +++ b/ui/packages/i18n/src/locales/pt-BR.ts @@ -3200,6 +3200,9 @@ const pt = { allDocs: 'Toda a documentação', onlineDocs: 'Documentação online', loadingDocumentation: 'Carregando documentação', + docConflictTitle: 'Escolha um pacote', + docConflictDescription: 'Mais de um pacote instalado fornece um documento chamado {{name}}. Abra o que você quer ler.', + docConflictCandidates: 'Pacotes que fornecem este documento', documentation: 'Documentação', uncategorized: 'Sem categoria', about: 'Sobre', diff --git a/ui/packages/i18n/src/locales/ru.ts b/ui/packages/i18n/src/locales/ru.ts index 65b946360b6..709edafa4a5 100644 --- a/ui/packages/i18n/src/locales/ru.ts +++ b/ui/packages/i18n/src/locales/ru.ts @@ -3280,6 +3280,9 @@ const ru = { allDocs: 'Вся документация', onlineDocs: 'Онлайн-документация', loadingDocumentation: 'Загрузка документации', + docConflictTitle: 'Выберите пакет', + docConflictDescription: 'Документ с именем {{name}} есть в нескольких установленных пакетах. Откройте нужный.', + docConflictCandidates: 'Пакеты, в которых есть этот документ', documentation: 'Документация', uncategorized: 'Без категории', about: 'О программе', diff --git a/ui/packages/i18n/src/locales/zh-Hans.ts b/ui/packages/i18n/src/locales/zh-Hans.ts index ac7bfe94693..dfa8db59aa2 100644 --- a/ui/packages/i18n/src/locales/zh-Hans.ts +++ b/ui/packages/i18n/src/locales/zh-Hans.ts @@ -3216,6 +3216,9 @@ const zh = { allDocs: '全部文档', onlineDocs: '在线文档', loadingDocumentation: '正在加载文档', + docConflictTitle: '选择一个包', + docConflictDescription: '已安装的多个包都提供名为 {{name}} 的文档。请打开你要阅读的那一份。', + docConflictCandidates: '提供此文档的包', documentation: '文档', uncategorized: '未分类', about: '关于', diff --git a/ui/packages/i18n/src/locales/zh-Hant.ts b/ui/packages/i18n/src/locales/zh-Hant.ts index bf31c0bb579..cb5dc701b6e 100644 --- a/ui/packages/i18n/src/locales/zh-Hant.ts +++ b/ui/packages/i18n/src/locales/zh-Hant.ts @@ -3216,6 +3216,9 @@ const zhHant = { allDocs: '全部文件', onlineDocs: '線上文件', loadingDocumentation: '正在載入文件', + docConflictTitle: '選擇一個套件', + docConflictDescription: '已安裝的多個套件都提供名為 {{name}} 的文件。請開啟你要閱讀的那一份。', + docConflictCandidates: '提供此文件的套件', documentation: '文件', uncategorized: '未分類', about: '關於', From c8c59e32712b19af25cdcbac4791349d7ff384fd Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 15 Nov 2026 18:22:10 +0000 Subject: [PATCH 2/3] chore(changeset): docs reader lists the candidate packages of an ambiguous doc read Claude-Session: https://claude.ai/code/session_01ADHkmP4uQusF8yrKtRnvqJ Co-authored-by: Claude --- .changeset/34070-docs-conflict-candidates.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .changeset/34070-docs-conflict-candidates.md diff --git a/.changeset/34070-docs-conflict-candidates.md b/.changeset/34070-docs-conflict-candidates.md new file mode 100644 index 00000000000..ef4839b3848 --- /dev/null +++ b/.changeset/34070-docs-conflict-candidates.md @@ -0,0 +1,11 @@ +--- +'@object-ui/console': patch +'@object-ui/i18n': patch +--- + +feat(console): the docs reader lists the candidate packages when a doc name two packages ship is refused + +Clause-②: yes (widening) — widened: where a doc read that names no package answers `409 RESOURCE_CONFLICT` naming its holders (`details.candidates`), the Console docs reader (`/docs/BOOK/NAME`, reached from the flat `/docs/NAME` permalink) lists those packages, each linking to that package's address `/apps/PACKAGE/docs/NAME`, where it showed "Failed to load documentation"; a flat permalink under a package container (`/apps/PACKAGE/docs/NAME`) of a name that package ships opens the doc in that package's own book; the `@object-ui/i18n` keys `help.docConflictTitle`, `help.docConflictDescription` and `help.docConflictCandidates`, in all 11 shipped locales (no key renamed or removed). A doc one package ships, and every other failure, render as before. +Metadata-protocol: none + +Two enabled packages may ship one doc name. A read of it that names no package is refused with `409 RESOURCE_CONFLICT` and the holders as `details.candidates`; nothing picks one for the reader. The docs reader now shows a "Choose a package" list in place of the generic load error: each entry is the package as the portal names it (its book) with the package id beside it, and opens that package's copy, read with the package named. From be6b38f64117cbfd6a94d4cbab5125e99ec354a9 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 15 Nov 2026 18:23:59 +0000 Subject: [PATCH 3/3] chore(i18n): regenerate zh-Hant from its zh-Hans source Claude-Session: https://claude.ai/code/session_01ADHkmP4uQusF8yrKtRnvqJ Co-authored-by: Claude --- ui/packages/i18n/src/locales/zh-Hant.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/packages/i18n/src/locales/zh-Hant.ts b/ui/packages/i18n/src/locales/zh-Hant.ts index cb5dc701b6e..f6245ff3d7e 100644 --- a/ui/packages/i18n/src/locales/zh-Hant.ts +++ b/ui/packages/i18n/src/locales/zh-Hant.ts @@ -3216,9 +3216,9 @@ const zhHant = { allDocs: '全部文件', onlineDocs: '線上文件', loadingDocumentation: '正在載入文件', - docConflictTitle: '選擇一個套件', - docConflictDescription: '已安裝的多個套件都提供名為 {{name}} 的文件。請開啟你要閱讀的那一份。', - docConflictCandidates: '提供此文件的套件', + docConflictTitle: '選擇一個包', + docConflictDescription: '已安裝的多個包都提供名為 {{name}} 的文件。請開啟你要閱讀的那一份。', + docConflictCandidates: '提供此文件的包', documentation: '文件', uncategorized: '未分類', about: '關於',