Skip to content

fix(web): read approval-package decks with the slidedeck schema - #168

Merged
TheGreatAxios merged 3 commits into
cl-12110-remove-swallowed-errors-unchecked-casts-and-iifes-from-thefrom
cl-12110-read-approval-package-decks-with-the-slidedeck-schema
Nov 4, 2026
Merged

TheGreatAxios merged 3 commits into
cl-12110-remove-swallowed-errors-unchecked-casts-and-iifes-from-thefrom
cl-12110-read-approval-package-decks-with-the-slidedeck-schema

Conversation

@TheGreatAxios

@TheGreatAxios TheGreatAxios commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Part of CL-12110: the approval-package deck casts from the Findings document (approval-package-preview.tsx theme, slides and blocks cast after only an isRecord check). Stacked on #167.

The hub builds each deck with slidedeck's validateDeck, but the preview read it through its own hand-written interfaces. This change makes the preview use the same definition.

Changes

  • @corbits/slidedeck gains a ./deck subpath export (the schema file imports only arktype), and apps/web depends on it. A production build of the web app contains none of the PDF or PPTX writers.
  • The preview validates bundle.deck with validateDeck and renders from slidedeck's types. The local deck interfaces, isRecord, the casts and branches the schema rules out are removed.
  • A deck that fails validation shows the existing "could not be read" line in the Slides tab and the PDF page area, instead of drawing partial slides. The PDF download and the Sources tab keep working from the bundle, since the hub's general write path checks a deck only as an object.
  • The drawing code moved to approval-package-slides.tsx, the only module that imports the deck schema, and loads with React.lazy behind a "Loading slides…" line. Building the schema costs about 150 ms (measured in Bun), so only pages that show slides pay it. In a production build the schema's strings appear only in the slides chunk.
  • Nested lists are numbered like their parent unless they say otherwise, matching the PPTX and PDF writers.
  • Approval rounds show "could not be read" for an unparseable bundle; the now-unused noSlides wording is removed. Validation is memoised.
  • Comparison column headings are now always drawn, because the schema requires them.
  • ApprovalPackageBundle.deck in packages/schemas stays Record<string, unknown>: the hub parses it on every write and stored-package read, so tightening it there would change hub behaviour.

Verification

  • New tests: a deck with a partial theme shows the unreadable line with no slide text in Slides and PDF, while the download and Sources still work; a free slide draws text inside groups, and nested lists follow their parent's numbering.
  • Not changed: the schema's link check uses URL.canParse, which sets a browser floor (Safari 17, Chrome 120, Firefox 115).
  • Test decks that had no theme or theme.fonts were given a full theme, since the schema requires one.
  • bun run lint, format:check, typecheck, test, pins:verify and vendor:verify pass.

@linear-code

linear-code Bot commented Nov 4, 2026

Copy link
Copy Markdown

CL-12110

@TheGreatAxios
TheGreatAxios force-pushed the cl-12110-read-approval-package-decks-with-the-slidedeck-schema branch from 4821003 to 9283fed Compare November 4, 2026 21:26
@TheGreatAxios
TheGreatAxios marked this pull request as ready for review November 4, 2026 21:39
@corbits-triage

corbits-triage Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Triage: Pass

No changes needed from you. A maintainer will review this pull request.

Stacked on #167: only this pull request's own changes were checked.

Notes:

  • changes sensitive paths: locks: bun.lock

@corbits-triage corbits-triage Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No defects reported.

@TheGreatAxios
TheGreatAxios merged commit 9c0a069 into cl-12110-remove-swallowed-errors-unchecked-casts-and-iifes-from-the Nov 4, 2026
9 checks passed
TheGreatAxios added a commit that referenced this pull request Nov 4, 2026
* fix(web): read approval-package decks with the slidedeck schema

* fix(web): load approval slides lazily and keep packages readable

* fix(web): show a line when the slides fail to load, not a crash
TheGreatAxios added a commit that referenced this pull request Nov 4, 2026
* fix(web): read approval-package decks with the slidedeck schema

* fix(web): load approval slides lazily and keep packages readable

* fix(web): show a line when the slides fail to load, not a crash
TheGreatAxios added a commit that referenced this pull request Nov 4, 2026
#167)

* fix(web): surface swallowed errors and close the microphone on failure

* fix(web): keep courtesy reads and damaged imports from failing loudly

* refactor(web): name the invitation load instead of an IIFE

* fix(web): toast every failed copy of a project's failure detail

* fix(web): read approval-package decks with the slidedeck schema (#168)

* fix(web): read approval-package decks with the slidedeck schema

* fix(web): load approval slides lazily and keep packages readable

* fix(web): show a line when the slides fail to load, not a crash

* fix(web): handle missing room data instead of inventing it (#171)

* fix(web): handle missing room data instead of inventing it

* fix(web): start room reads early and keep unread decisions unknown

* fix(web): name an approval without concepts instead of defaulting

* fix(web): ask about a blank-named document by its tool

* refactor(web): replace promise chains and IIFEs with named functions

* fix(web): rethrow failures other than unreadable JSON or cache

* refactor(web): replace promise chains and an IIFE with named functions

* refactor(web): poll a subscription login with a query observer

* fix(web): treat an unreadable refusal body as one without a code

* fix(web): never hold the first paint on a failed cache restore

* fix(web): keep a login poll running offline and out of the cache

* refactor(web): share one version read between view and compare

* fix(web): check untrusted JSON and hub values against their schemas

* fix(web): check untrusted JSON and hub values against their schemas

* fix(web): treat an unreadable session as an error, not a sign-out

* fix(web): read a frame's missing text without inventing one

* fix: refuse unreadable custom models and unknown login URLs (#170)

* fix(client): read login base URLs from a map keyed by login plugin

* fix(web): refuse unreadable custom models instead of sending null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant