Skip to content

test(app): make the sidebar brand geometry checks rebrand-proof and guard the compact mark against drift - #4835

Merged
yomgui merged 2 commits into
devfrom
test/sidebar-brand-invariants
Sep 11, 2026
Merged

yomgui merged 2 commits into
devfrom
test/sidebar-brand-invariants

Conversation

@yomgui

@yomgui yomgui commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

Summary

Small test-only follow-up to #4827 and its maintenance review. No artwork, production layout, enterprise branding, or derivation script changes. Keep the accepted compact sidebar asset and gap-1.5.

  • Add apps/app/tests/sidebar-brand-asset.test.ts: nonempty SVG paths with explicit d/fill, exactly one viewBox in each asset, and byte-identical SVG-root markup after removing only viewBox attributes and outer whitespace. Extracting the root excludes the existing explanatory preamble comment without a sanitization/comment-stripping regex. This preserves the path/fill bytes and catches unexpected transforms/groups/attributes too. Failures explicitly tell maintainers to sync the artwork and regenerate the compact viewBox after a rebrand.
  • Make evals/specs/sidebar-brand-geometry.e2e.test.ts assert layout invariants rather than today's brand: painted bbox centered in the rem-scaled 20px slot within ±0.5 CSS px; bbox area occupies at least 75% of the slot; label rail alignment; nonempty app label; no clipping; centered object-position and dark inversion; and unchanged custom brandLogoUrl source identity/geometry.
  • Remove the hard-coded OpenWork label, 16×20 painted size, marketing viewport, path-parity comparison, and marketing-asset fetch from the E2E spec. The new unit test owns asset parity.

Enterprise branding remains runtime-only: customers supply Den-served wordmarks/square icons, not replacements for the stock SVG.

Verification — Passed

Signed head: 58847a1f6ac60c571ebc9e032c04b9198498d13f; git log -1 '--format=%G?' returns G. Only the new wt-sidebar-brand-hardening worktree was used.

Check Lane Result
Asset unit test Local Exit 0; 1 passed, 0 failed, 0 skipped; 29 assertions
App typecheck Local Exit 0; no errors
Geometry E2E, one run on pushed head Local driver + fresh Daytona Electron Exit 0; 1 passed, 0 failed, 0 skipped

Exact requested verification commands:

mise exec [email protected] [email protected] [email protected] -- bun test apps/app/tests/sidebar-brand-asset.test.ts
mise exec [email protected] [email protected] [email protected] -- pnpm --filter @openwork/app typecheck
OPENWORK_EVAL_DAYTONA=1 OPENWORK_EVAL_REF=58847a1f6ac60c571ebc9e032c04b9198498d13f mise exec [email protected] [email protected] [email protected] -- pnpm evals:e2e sidebar-brand-geometry

The geometry run tested light/dark × 16/20px root sizes and custom branding in both themes. Measured bbox occupancy: 79.84%; largest center error: <0.011 CSS px; label x difference: 0px. Eight passing assertion records. Six screenshots are supplementary and not visual pass/fail oracles. No native Windows/macOS claim; no Den required. Task-owned Daytona sandbox was deleted.

HEAD-matching source evidence:
evals/results/test-runs/2026-09-10T19-07-57-165Z-sidebar-brand-painted-bounds-align-with-the-action-rail-without-changing-custom-/.

The first commit passed the three requested checks, but CodeQL flagged the unit test's comment-removal regex as incomplete HTML sanitization. Replaced it with SVG-root extraction (no suppression); reran the unit test, app typecheck, and geometry spec once on the new signed/pushed head so the evidence matches the final code. Earlier geometry evidence is superseded, not counted as final-head proof.

Option A — tighten the shared source viewport everywhere (not implemented)

Potentially preferable long-term: one tight source asset removes the duplicate and its synchronization burden. No requirement for the padded canvas was found; the manifest uses purpose: "any", not a maskable safe area. However, global tightening changes the apparent scale/framing outside the sidebar, so it should follow visual review of these nine other production references, rather than land in this test-hardening PR:

  1. SVG browser favicon — apps/app/index.html:14.
  2. Web-app manifest SVG icon — apps/app/public/manifest.webmanifest:16–19.
  3. OpenWork Cloud quick-connect/catalog icon — apps/app/src/app/constants.ts:175 (default-hidden entry).
  4. OpenWork UI quick-connect/catalog icon — apps/app/src/app/constants.ts:190 (default-hidden entry).
  5. OpenWork Browser built-in extension icon — apps/app/src/app/extensions.ts:162.
  6. Computer Use built-in extension icon — apps/app/src/app/extensions.ts:194.
  7. Welcome/onboarding card mark — apps/app/src/react-app/domains/onboarding/welcome-page.tsx:69.
  8. Enterprise activation card mark — apps/app/src/react-app/domains/cloud/enterprise-activation-gate.tsx:179.
  9. Fullscreen Den sign-in fallback mark, when no custom logo exists — apps/app/src/react-app/domains/cloud/den-signin-surface.tsx:234.

These are nine references, not necessarily nine independent screens. The SVG favicon does use this source; the separate PNG/touch favicons and packaged OS icons do not. Den Web and the landing site have separate copies of the SVG and would not automatically change from editing the app's source asset alone. Den API also returns this path as extension/marketplace metadata; which asset is served depends on the rendering client's origin.

Leave this PR ready for the user's review and merge. Do not auto-merge.

@vercel

vercel Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openwork-app Ready Ready Preview Sep 10, 2026 7:08pm UTC
3 Skipped Deployments
Project Deployment Actions Updated
openwork-den Skipped Skipped Sep 10, 2026 7:08pm UTC
openwork-diagnostics Skipped Skipped Sep 10, 2026 7:08pm UTC
openwork-landing Skipped Skipped Sep 10, 2026 7:08pm UTC

@github-actions

github-actions Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Warden review summary — Clear

Native findings: 0. Blocking policy matches before consolidation: 0. Full finding text remains in Warden's native checks and review threads. This comment retains only native IDs, severity, skill attribution, and safe locations. Analysis run

Reported trigger coverage (not proof of complete repository or context coverage): diff-security-review (6696 ms), confidentiality-review (2566 ms), spec-provenance-review (34768 ms), desktop-den-sync-review (4682 ms).

Blockers

  • None.

Advisories

  • None.

Needs recheck

  • None.

Observed review-thread metrics

  • Unique observed run attempts in retained window: 2
  • Distinct heads in retained window: 2
  • Current unresolved Warden threads: 0 of 0 observed
  • Observed resolved/unresolved transitions in retained snapshots: 0 / 0
  • First observed resolved/unresolved (state at first collection, not event time): 0 / 0
  • Precision: unavailable (no adjudications; no TP/FP values are inferred)
  • Observation window: 2/20 run attempts retained; truncated: false
  • Transition snapshot: 0/0 current attributed threads retained (limit 500); truncated: false

Thread states are read-only collection snapshots. These metrics are neither lifetime totals nor exact resolution times, and this summary is not clearance authority.

diff-warden[bot]
diff-warden Bot previously approved these changes Sep 10, 2026

@diff-warden diff-warden Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (55eeb97ae87fa4f02dea7caa3fb638f8b9844d33). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

@diff-warden diff-warden Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (58847a1f6ac60c571ebc9e032c04b9198498d13f). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

@yomgui

yomgui commented Sep 10, 2026 •

Copy link
Copy Markdown
Member Author

Passed · 12/12 tests · 18/18 assertions · 8 images

Commit 58847a1f6ac60c571ebc9e032c04b9198498d13f · selected evidence

Open review report

@yomgui
yomgui merged commit c1fbb0e into dev Sep 11, 2026
28 checks passed
@yomgui
yomgui deleted the test/sidebar-brand-invariants branch September 11, 2026 02:41

This branch was successfully deployed

1 active and 3 inactive deployments
Preview – openwork-app — 58847a1f Deployed Sep 10, 2026 by vercel[bot]
Preview – openwork-landing — 58847a1f Deployed Sep 10, 2026 by vercel[bot]
Preview – openwork-diagnostics — 58847a1f Deployed Sep 10, 2026 by vercel[bot]
Preview – openwork-den — 58847a1f Deployed Sep 10, 2026 by vercel[bot]
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