Verification note confirming the crate was already scaffolded
in commit 6365d3f4. Bead is being closed.
2.3 KiB
2.3 KiB
bf-3fka4: Scaffold pdftract-inspector-ui crate
Status
COMPLETE — Work already done in commit 6365d3f4.
What was implemented
The crates/pdftract-inspector-ui crate was created with the following structure:
Files created
-
Cargo.toml— Workspace member configuration- Library crate:
pdftract_inspector_ui - Build dependency:
flate2for gzip compression
- Library crate:
-
build.rs— Bundling and size validation- Reads
static/index.html,static/style.css,static/app.js - Concatenates into a single bundle
- Computes gzipped size and enforces 80 KB limit (Phase 7.9.3)
- Fails build if bundle exceeds limit
- Reads
-
src/lib.rs— Rust APIINDEX_HTML: &[u8]— Bundled HTML viainclude_bytes!STYLE_CSS: &[u8]— Bundled CSS viainclude_bytes!APP_JS: &[u8]— Bundled JS viainclude_bytes!- Tests verify files are non-empty
-
static/index.html— HTML stub- Basic HTML5 structure
- Links to
style.cssandapp.js - Placeholder for PDF viewer
-
static/app.js— JavaScript stub- Basic IIFE pattern
- Placeholder for Phase 7.9 implementation
-
static/style.css— CSS stub- Minimal styling for header, viewer, footer
- Placeholder for Phase 7.9 implementation
Build verification
$ cargo check -p pdftract-inspector-ui
Compiling pdftract-inspector-ui v0.1.0 (...)
warning: pdftract-inspector-ui@0.1.0: Inspector frontend bundle size:
warning: pdftract-inspector-ui@0.1.0: Raw: 1.95 KB
warning: pdftract-inspector-ui@0.1.0: Gzipped: 0.87 KB / 80 KB limit
Finished `dev` profile [unoptimized + debuginfo] target(s) in 30.80s
- Bundle size: 0.87 KB gzipped (well under 80 KB limit)
- Compiles successfully
Acceptance criteria
| Criterion | Status |
|---|---|
| Create workspace member | PASS — Added to Cargo.toml members |
| Minimal build.rs | PASS — Bundles HTML/CSS/JS with gzip validation |
| include_bytes! frontend stub | PASS — All three assets in src/lib.rs |
| Crate compiles | PASS — cargo check succeeds |
| Bundle size enforced | PASS — 80 KB limit in build.rs |
References
- Plan Phase 7.9: Inspector mode
- Related beads: Phase 7.9 Inspector coordinator (needs this crate)
Commit
6365d3f4— feat(bf-3fka4): scaffold pdftract-inspector-ui crate