Skip to content

docs(du): close the document viewer README's gaps for app builders - #222

Merged
sergiubologa merged 1 commit into
developfrom
docs/document-viewer-readme-gaps
Nov 26, 2026
Merged

sergiubologa merged 1 commit into
developfrom
docs/document-viewer-readme-gaps

Conversation

@sergiubologa

@sergiubologa sergiubologa commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

What

Fills the gaps a coding agent hit when building a coded app from the document-viewer README alone. We ran it as a test: an agent built from the docs, wrote down every guess it had to make, then checked each one against the source.

  • Quick start is now three steps:

    1. Host the files, with a copy-paste stage-dv-wc script and a .gitignore entry.
    2. Call configureDocumentViewerWc({ includeFonts: true }).catch(...).
    3. Render.

    The default deploymentUrl already resolves for both Vite and deployed Coded Apps, and the Quick start now says so.

  • Data sources

    • A table of data fields, marking which are required.
    • Pass data as a stable reference: every new object triggers a refetch.
    • The hook returns { artifacts, error }.
  • Loading and errors

    • What renders while loading and when a fetch fails.
    • A failed web component load leaves the viewer on Loading... and surfaces only on the configureDocumentViewerWc promise.
  • Supported formats (corrects docs(du): list the document viewer's supported formats #221)

    • An unsupported original leaves the page view blank and onReady never fires; no error message appears.
    • There is no automatic text-view fallback. A snippet shows how to drop original by MIME type.
    • Moved to its own section.
  • Linking it to a form

    • The old example read artifacts.extractionResult from the Validation Station package, so it fails type-checking with this package's own useDvDocumentArtifacts.
    • The new example uses only this package and DuFramework types, and gives their import paths.

Source of truth

  • useResolvedArtifacts.ts (fetch key, data identity dependency, error strings) and bucketArtifactsUtil.ts (required fields, folderScope).
  • renderWc.ts (loadingFallback) and useWcReady.ts (a failed load stays not-ready).
  • DU-App ui-pdf-viewer.component.ts: a loadDocument error is filtered out, so no page definitions are created and ready never fires. The template only hides the progress bar.

Docs only, no code change.

🤖 Generated with Claude Code

Base automatically changed from docs/document-viewer-supported-formats to develop November 26, 2026 06:06
- Quick start: host, load (includeFonts, .catch) and render as three steps,
  with a copy-paste staging script.
- Data sources: required/optional data fields, stable `data` reference,
  the hook's { artifacts, error } shape, and the loading/error states.
- Supported formats: an unsupported original leaves the page blank and
  onReady never fires; no automatic text-view fallback, with a snippet.
- Linking: a self-contained example using only this package and the
  SDK's DuFramework types.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sergiubologa
sergiubologa force-pushed the docs/document-viewer-readme-gaps branch from 503a804 to b59cf87 Compare November 26, 2026 06:10
@github-actions

Copy link
Copy Markdown
Contributor

📊 Coverage Report

Package Line Coverage
datatable 88.29%
multi-file-upload 87.27%
conversational-agent-chat 91.63%
validation-station 99.33%
classification-station 91.66%
document-viewer 89.38%
external-auth 97.26%
pdf-viewer 96.26%
decisions-and-reasons 98.50%

@sergiubologa
sergiubologa merged commit 0eef755 into develop Nov 26, 2026
5 checks passed
@sergiubologa
sergiubologa deleted the docs/document-viewer-readme-gaps branch November 26, 2026 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants