docs(web): full UI surface inventory, illustrated manual, panel screenshots

Interface design document and manual now share one authoritative surface
inventory (333 surfaces across 9 categories, gap 0), and every chapter carries
real Playwright screenshots of the panels it documents.

- tools/fcweb: ui-surface-scan/ui-surface-inventory (deterministic --check),
  build-ui-doc renders panel catalog, workbench matrix and mapping tables;
  blank toolbar crops (<1 KB) are skipped and pruned instead of embedded
- web/tools/manual: generate-panel-index (ch16), audit-ui-gaps,
  generate-final-status, generate-gaps-doc; pager is per-chapter so the manual
  no longer overflows horizontally
- manual: 130 screenshot references / 128 PNGs, panel sections for ch02-ch13
- web/src: utility menus stop click propagation (menu reopened on item click);
  workbench shell gains an OPFS document picker so workbench.html can bind a
  real document instead of the fixed workbench-document id; Sketcher panel
  moves from the command column to the main stage

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
2026-11-23 01:30:31 +08:00
parent 3c2c623f70
commit 300c8efb01
180 changed files with 27036 additions and 4185 deletions

76
tools/fcweb/index.mjs Normal file
View File

@@ -0,0 +1,76 @@
// fcweb toolkit -- one import for part, part-design, assembly and capture work.
//
// import { openPart } from "<repo>/tools/fcweb/index.mjs";
//
// See README.md for the full surface and the contract notes that matter
// (primitive argument keys differ between the two probes; volume is null for
// sketches and datums; kernel artifacts live in MEMFS, not on the host).
export {
KernelError,
TRACE_SCHEMA,
STEM_PART,
STEM_PARTDESIGN,
STEM_ASSEMBLY,
KERNEL_DIRS,
locateProbe,
openKernel,
dispatch,
createSession,
compactArgs,
summarise,
writeTrace,
} from "./kernel.mjs";
export { openPart, PartDocument, PART_SCHEMA, PART_MODULE, hostBytes } from "./part.mjs";
export { openPartDesign, PartDesignDocument, PARTDESIGN_SCHEMA, PARTDESIGN_MODULE } from "./partdesign.mjs";
export { openAssembly, AssemblySession, ASSEMBLY_OBJECT_TYPE } from "./assembly.mjs";
export {
EXPORT_DIRECTORY,
DEFAULT_ROOT,
configureOpfs,
storeRoot,
safeName,
writeExportFile,
readExportFile,
hasExportFile,
listExportFiles,
storeBytes,
evidence,
sha256,
outRoot,
} from "./opfs.mjs";
export {
DEFAULT_CHROME,
launchBrowser,
openPage,
screenshot,
pageCheck,
projectMesh,
writeArtifact,
} from "./capture.mjs";
/**
* Adapter for scripts written against the old case-local helper
* (`web/teaching/cases/secondary-reducer-pro/parts/buildPart.mjs`).
* It returns the exact shape those scripts destructure, so migrating a case is
* an import swap rather than a rewrite.
*/
export async function openPartLegacy(document, options = {}) {
const { openPart } = await import("./part.mjs");
const part = await openPart(document, options);
return {
document,
kernel: part.kernel,
call: part.call,
timed: part.timed,
timings: part.timings,
trace: {
events: part.events,
record: () => { /* legacy callers record through `timed` */ },
finish: extra => ({ ...part.trace(), ...extra }),
},
close: () => part.dispose(),
};
}