Skip to content

Release v0.46.0: simpler UI (one stylesheet, phone cards), sturdier backend - #5

Merged
sanketpatel32 merged 25 commits into
mainfrom
release/next
Oct 31, 2026
Merged

sanketpatel32 merged 25 commits into
mainfrom
release/next

Conversation

@sanketpatel32

Copy link
Copy Markdown
Owner

Blunt Code v0.46.0: simpler UI, sturdier backend

This PR merges both UI branches (ui/polish-safe-fixes → ui/playful-redesign) with a simplification pass and backend hardening, and ships them as v0.46.0.

UI: simplified

  • 15 stylesheets → 1. web/src/css/* plus the old base sheet are now one web/src/styles.css that reads tokens.css. The cascade order is the same and each section has a banner. 101 dead rules, 41 dead selectors, 124 overridden declarations, 84 unused custom properties and 1 unused keyframes were removed, plus 11 rules and 7 selectors in a second pass. Before the intentional fixes below, 60 full-page shots (15 routes × 1280/390 × light/dark) were pixel-identical. Built CSS: 270.7 kB → 251.4 kB (gzip 43.5 → 40.1 kB).
  • About 1,500 lines of dead TS removed: DataTable, StatsOverview, TableToolbar, MiniSparkline, Calendar, useStagger, filterPresets, plus unused helpers and imports. tsc --noUnusedLocals is clean.
  • Phone layouts: Search results and the scan findings table now render as labelled cards at 390 px. Before, the tables were clipped sideways.
  • Profile picker on the phone workspace page stays on one row.
  • Dark mode: the Low severity fill, text and pill border now use the same colour.

Backend: improved, with no API changes

  • Analyzer timeouts: an analyzer that hits its deadline now fails its run instead of "succeeding" on partial output.
  • bluntcode tools uninstall finds a tool by its manifest id, even when it has no artifact for this OS.
  • Forward-slash paths are now enforced in exports (JSON/HTML/MD/SARIF), ignore patterns, fingerprints and Trivy paths, whichever OS produced the scan.
  • update/apply reports offline mode (409) before the platform check (501).
  • Faster workspace list: GET /api/v1/workspaces loads latest scans in one query instead of one per workspace. 649 ms → 256 ms in the perf test.
  • CSP fix: since 0.44.0 the pinned hash didn't match the inline theme script, so browsers blocked it on every load (wrong theme at first paint, plus a console CSP error). The hash is fixed, and a new test re-hashes every inline script in the embedded index.html.
  • Windows file properties: the exe's version resource is restamped. It had read 0.16.20 since that release.
  • Dead code removed: SortedFindings, doctor.DatabasePath, tools.LoadManifest.

Verification

  • go vet ./... and GOOS=windows go vet ./... / go build ./... are clean; gofmt is clean.
  • go test ./... passes on Linux except 18 Windows-only analyzer tests (C:\ paths, DPAPI, .exe artifacts). All 18 also fail on main (19 there; this branch fixes one). -race -short passes on api, scans, process, database, tools, reports and discovery.
  • Vitest 555/555. The 7 removed tests belonged to the deleted dead components.
  • tsc -p tsconfig.app.json is clean, npm run build succeeds, the contrast audit has 0 failures, and axe finds 0 WCAG A/AA violations.
  • The Playwright smoke suite passes 19/19 against a server built from this branch, with zero console errors.
  • A manual curl pass over the API covered health, meta, workspaces CRUD, scans, findings, every report format, search, compare, cross-origin 403, invalid JSON 400 and update 501.

Before / after

  • Phone search: tables that clipped sideways are now labelled cards.
  • Phone scan findings: same change, with File / Tool / Status labels.
  • Phone workspace: the profile picker no longer wraps onto two rows.
  • Dark mode: the Low bar and pill now match the Low text.
  • Desktop at 1280 px looks the same apart from the footer version and the dark Low colour.

…olbar and table, ledger path

- Mobile shell grid gets explicit rows so the sticky bar no longer grows to 200-260px on short pages.
- Settings rows stack below 40rem (label was squeezed to one word per line, switch drawn over text).
- Findings filter toolbar wraps per group on phones and stops being sticky (Status/Tool chips were clipped).
- Findings table min-width 64rem so the Finding column keeps ~18rem instead of 16-40px.
- Toolbar rows wrap (Tools tabs split mid-control on phones).
- Home ledger path is one truncated line instead of breaking every few characters.
…ast on muted labels

- Switch knob uses the surface colour when on (it vanished into the ink track).
- Low/Info severity badges and history counts use the --color-sev-* ramp instead of the coral accent, matching bars and legends.
- Zero-count legend labels, +N language tail and outline state tags move from ink-ghost (3.96:1) to ink-faint.
- Search facet hint drops opacity .7 (3.21:1).
- --color-accent-strong 54% -> 51% so pressed chips clear 4.5:1 on the coral wash (was 4.39:1).
…ots, rail list items, verdict sentence

- Column resize separators expose aria-valuenow/min/max (axe aria-required-attr, critical).
- Language coverage dots get role=img so their aria-label is valid (205 aria-prohibited-attr on Tools/About); the scrollable coverage table is a focusable, labelled region.
- Rail footer links are wrapped in <li> (axe list).
- Home verdict sentence moves from aria-label on a <p> to a visually hidden span.
The backend reports some analyzer errors as '<id>: <id>: message'; humanizeAnalyzerError now strips the echoed id after swapping in the display name. Adds a unit test.
Bright white surfaces, coral primary with a teal second voice, a 13/14/16
type floor with 32px page titles, softer modern shadows, and one-hue-per-grade
tokens. css/playful.css is imported last and states the shared rules once:
type floor, a single card surface (no card-in-card), one primary button,
grade tiles, squared tags, and phone table cards.
GradeTile renders every letter grade (home verdict, ledger rows, scan hero,
workspace risk card, workspaces table) as one chunky key-cap tile. Hero
tiles flip the letter in with Kokonut UI's split-flap-text (MIT, adapted to
Tailwind 3 and app tokens; reduced motion shows it instantly).

Also: stat cards drop the icon-in-a-tinted-square, and the first-run home
keeps one primary CTA (the empty card) instead of repeating it in the header.
Sun/moon morph with a View Transitions circle reveal, adapted to the app's
data-theme + useTheme (controlled), Tailwind 3 (part styles in plain CSS),
and jsdom/old-browser guards. Reduced motion switches instantly.
The shadcn default and legacy .button.primary share coral fill, dark ink and
a 2px pressed lip; hover brightens instead of darkening below AA. Secondary
is a white outline. Pentest's red 'Run Pentest Scan' becomes the standard
primary at the standard size.
Workspaces, scan history and tools tables opt in with .rtable and per-cell
data-label, so at 40rem and below each row is a card with its key columns
as label/value lines instead of a sideways scroll.
PreScanSummary leads with 'N of M analyzers ready' and groups engines by
readiness. The report's Incomplete analysis banner merges analyzers that
failed for the same reason into one line.
… the home board

design-system.css restated 12/13/14/17px sizes after every token; its layout
rules move into css/playful.css on the type tokens and the file is deleted.
The home board columns become one surface with no inner frames, severity
bars take a brighter fill ramp (text keeps the AA tones), and the pre-scan
inventory gets its own compact styling.

scripts/contrast-audit.mjs read hex tokens from design-system.css and had
been failing ('Missing design token accent'); it now reads the oklch tokens
from tokens.css and also checks the primary button and every grade tile.
npm run smoke adds a throwaway workspace through the UI, scans it, checks
findings filters, history, tools, rules, language + dark mode, command
palette, pentest, 404, every route at 1280/390 with no console errors,
phone table cards, and dark-mode axe; then removes the workspace.
…eeding'

process.Run returned a killed child as an ordinary non-zero exit with a nil
error, so a timed-out analyzer's truncated output went to Normalize and could
persist as a clean run with fewer findings, marking the rest fixed. Run now
wraps the context error when cancellation/deadline ended the child, and
executeAnalyzer records 'X timed out after 10m0s and was stopped' for any
adapter whose own deadline expired. Tests pin both layers.
Uninstall rejected every tool on a platform without a manifest entry (the
failing TestToolsUninstallCommand off Windows): removing a tool directory is
a question of identity. Manifest.Knows checks every platform.
…ints

filepath.ToSlash is a no-op off Windows, so reports exported, .bluntcodeignore
patterns read, and fingerprints computed on another OS kept backslashes
(different SARIF/JSON/GitHub paths and sort order, unmatched ignores,
fingerprints that drift between machines). Replace backslashes directly;
output on Windows is byte-identical.
Same gate order as update/check, so the user-actionable 409 UPDATE_OFFLINE
holds everywhere; the case-variant workspace test only asserts reuse where
the file system is case-insensitive.
GET /workspaces loaded every column (plus metadata JSON decode and a sort) of
the latest and previous scan's findings per workspace just to count new and
fixed; FindingIdentities reads the three columns the comparison uses
(20 workspaces x 2 x 2000 findings: 649ms -> 256ms, guarded by a test).
GET /workspaces/{id} no longer ranks every workspace's history to read one
row (WorkspaceLatestScans); the three latest-scan queries share one builder,
and createWorkspace's duplicated canonical-root lookup is one helper.
deadcode -test ./... (GOOS=windows) finds no caller in product or tests.
…; drop dead code; phone cards for Search and findings

- styles.css + 14 override/page sheets -> one styles.css reading tokens.css,
  kept in the exact bundle cascade order. Removed 101 dead rules, 41 dead
  selectors, 124 always-overridden declarations, 84 unused custom
  properties, 1 unused keyframe set; colour literals now only in tokens.css.
  Verified pixel-identical on 60 reference shots before the fixes below.
- Removed unused DataTable, StatsOverview, TableToolbar, MiniSparkline,
  Calendar, useStagger, filterPresets, mock chart data, notify helpers and
  unused imports (tsc --noUnusedLocals clean).
- Phone: Search results and scan findings render as labelled cards
  (.rtable + data-label; detail rows share .rtable-sub); the workspace
  profile picker keeps its four options on one row.
- Dark Low: bar fill shares the Low text hue; Low pill border no longer
  drifts blue.
- smoke: phone cards (search, findings) and profile picker checks.
…ped index.html

Since 0.44.0 the pinned sha256 no longer matched the inline script in the
embedded index.html, so the browser blocked the theme bootstrap (wrong
theme at first paint + a CSP violation in the console on every load).
Pin the current hash and add TestStaticCSPPinsEveryInlineScript, which
hashes every inline <script> in the embedded index.html and fails until
staticCSP allows it.

Also: trivy relative() normalizes backslashes explicitly (same as the
reports/fingerprint fix), so Windows-style report paths stay forward-slashed
on any host.
Bump version strings (internal/build, web/package.json, package.ps1, agent
docs), write the 0.46.0 changelog and rebuild the embedded UI from web/dist.
The committed .syso still carried 0.16.20, so Windows Explorer's Properties
sheet showed the wrong version for every release since. Regenerated with
go-winres from the committed assets/bluntcode.ico (same icon frames; only
the version fields change), mirroring scripts/embed-windows-resources.ps1.
@sanketpatel32
sanketpatel32 merged commit edd70f2 into main Oct 31, 2026
@sanketpatel32
sanketpatel32 deleted the release/next branch November 22, 2026 04:41
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.

1 participant