chore: clear release build warnings - #62
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to make the v0.0.1 release build “warning-free” by tightening Rust cfg reachability, addressing CSS specificity/lint warnings, and reducing production bundle size by ensuring demo surfaces are code-split and only loaded when explicitly requested.
Changes:
- Lazy-load demo entry points (
?demo=chat/?demo=minimal) to keep demo-only JS/CSS out of the production bundle. - Extract orphaned Familiars/Settings CSS into a dedicated stylesheet imported only by the pages that own it, and fix a modifier/base ordering issue.
- Gate Rust items with
#[cfg(...)]so dead-code warnings match actual feature/test reachability.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/main.tsx | Replaces static demo imports with React.lazy + Suspense to avoid shipping demo code in prod bundle. |
| src/demo/chat-demo.tsx | Moves demo CSS import into the demo module so it loads only when the demo loads. |
| src/demo/chat-demo.css | Removes Familiars/Settings CSS block from the shared demo stylesheet. |
| src/demo/minimal-macos.tsx | Imports demo-specific CSS from the module so it loads only when that demo chunk loads. |
| src/demo/minimal-macos.css | No functional change shown in diff; referenced by the updated module import pattern. |
| src/demo/familiars-page.tsx | Imports extracted Familiars/Settings CSS locally. |
| src/demo/settings-page.tsx | Imports extracted Familiars/Settings CSS locally. |
| src/demo/familiars-settings.css | New extracted stylesheet for Familiars/Settings pages to avoid global demo CSS bloat/warnings. |
| src-tauri/src/lib.rs | Gates conformance-only helper methods behind feature = "phase1-conformance". |
| src-tauri/src/operation.rs | Gates conformance/test-only APIs (new, cancel_all) behind appropriate cfg. |
| src-tauri/src/keyring.rs | Gates backend-identification helpers behind conformance feature + target OS to match actual reachability. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Independent verification of
The chunk-size warning is genuinely fixed, not suppressedBefore, one 541.83 kB chunk tripped Rollup's 500 kB advisory. After: No On the CSS splitMoving the Signature statusBoth commits report One caveat
|
49b9944 to
b77641a
Compare
37a7f0a to
3f0596f
Compare
|
Rebased onto current |
3f0596f to
31a1777
Compare
|
Rebased onto current `main` (was 11 commits behind) and resolved the conflict in `src/main.tsx`. Everything else — the CSS extraction, the Rust dead-code gating, the other demo files — merged cleanly with no changes needed. The conflict existed because this branch predates the `?demo=chat` swap to `FamiliarsShell` and the "scope suspense to demo surfaces" fix that both landed on `main` since. Resolved by keeping current `main`'s routing (`chat` → `FamiliarsShell`, `messages` → `DemoShell`) and applying this PR's lazy-loading pattern to `FamiliarsShell` too, which didn't exist as a demo target when the PR was written — otherwise it would silently reintroduce the exact bundle-size regression this PR fixes, just via a different surface. Moved `familiars-shell.css` into `familiars-shell.tsx` itself, matching how `chat-demo.css`/`minimal-macos.css` already moved into their own modules. Verified locally: `cargo check/clippy/fmt/test` (default and `--all-features`) clean, `pnpm typecheck`/`lint`/`format:check` clean (0 warnings, confirming the CSS specificity and dead-code fixes both still hold), full unit suite 472/472 real tests (1 known unrelated environment flake in `phase1-schema-v2-evidence.test.ts`, reproduces identically on a clean `main` checkout), full e2e suite 10/10, and a production `vite build` — no chunk-size warning, `FamiliarsShell` now correctly split into its own lazy chunk (86 kB JS + 58 kB CSS) alongside the original `chat-demo`/`minimal-macos` chunks. Same CI-outage caveat as elsewhere: can't get a fresh recorded green run right now (org-wide GitHub Actions billing lockout), so this is verified locally, not yet re-verified in CI. 🤖 Generated with Claude Code |
31a1777 to
0c09688
Compare
|
Rebased once more onto current |
Three classes of warning stood between v0.0.1 and a clean release build. Rust dead code (4 warnings): the affected items are reachable only under `feature = "phase1-conformance"` or from tests, but were defined unconditionally. Gated them with `#[cfg(...)]` to match their real reachability instead of suppressing with `#[allow(dead_code)]`, so the compiler keeps telling the truth about what is live. CSS descending specificity (7 warnings): six were cross-scope false positives pairing `.fam-*`/`.set-*` selectors against unrelated earlier `.chat-demo .*` rules; one (`.fam-check-mark`) was a genuine ordering bug. The `.fam-*`/`.set-*` block styles FamiliarsPage and SettingsPage, neither of which is rendered from the demo shell, so it was 778 lines of orphaned rules sitting in the shared stylesheet. Extracted it to `src/demo/familiars-settings.css`, imported from the two pages it belongs to, and moved the `.fam-check-mark` base rule above its `.is-pass` modifier. Oversized chunk (541.83 kB > 500 kB): `main.tsx` statically imported both demo surfaces, so demo-only code and CSS shipped in the production bundle. Made them `React.lazy` and moved each stylesheet into the module that owns it. The production entry drops to 315.09 kB and production CSS to 12.08 kB; the demo code splits into chunks that only load under `?demo=chat` / `?demo=minimal`. Verified: `cargo check` and `cargo clippy --all-targets --all-features -- -D warnings` both clean, `pnpm lint` and `pnpm typecheck` clean, `vite build` emits no chunk warning, and the 59 demo tests pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: BunsDev <68980965+BunsDev@users.noreply.github.com>
Give the detail-pane and analytics empty states distinct selectors so their spacing is intentional. Keep settings fixtures in a side-effect-free module so extracting page CSS does not pull it into the chat demo chunk. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
de7a4b7 to
5f4b99a
Compare
Clears every warning the v0.0.1 release build emits, so a clean build is the baseline rather than something to be read past.
Rust dead code — 4 warnings
The flagged items are reachable only under
feature = "phase1-conformance"or from tests, but were defined unconditionally. Gated them with#[cfg(...)]matching their real reachability rather than papering over them with#[allow(dead_code)]— the compiler keeps telling the truth about what is live.keyring.rs— 4native_keyring_backenddefinitionsall(feature = "phase1-conformance", target_os = ...)lib.rs—cancel_all_operations,operation_registry,mutation_queuefeature = "phase1-conformance"operation.rs—cancel_allfeature = "phase1-conformance"operation.rs—NativeOperationInput::newany(test, feature = "phase1-conformance")CSS descending specificity — 7 warnings
Six were cross-scope false positives: a
.fam-*/.set-*selector paired against an unrelated earlier.chat-demo .*rule that can never match the same element. One (.fam-check-mark) was a genuine ordering bug — the base rule sat after its own.is-passmodifier.The
.fam-*/.set-*block stylesFamiliarsPageandSettingsPage, neither of which is rendered anywhere, so 778 lines of orphaned rules were living in the shared demo stylesheet. Extracted them tosrc/demo/familiars-settings.css, imported from the two pages that own them, and moved the.fam-check-markbase rule above its modifier.Oversized chunk — 541.83 kB > 500 kB
main.tsxstatically imported both demo surfaces, so demo-only code and CSS shipped inside the production bundle. Made themReact.lazybehind aSuspenseboundary and moved each stylesheet into the module that owns it.chat-demochunkminimal-macoschunkDemo code now loads only under
?demo=chat/?demo=minimal. No Rollup chunk-size warning.Verification
cargo check— cleancargo clippy --all-targets --all-features -- -D warnings— cleanpnpm lint— clean (was 7 warnings)pnpm typecheck— cleanvite build— no chunk-size warningchat-shell.test.tsx's assertions that readchat-demo.cssfrom diskTouches no
harnessAuthorityorchatAuthorityfile, so no conformance repin is required.