Skip to content

Watercolor FE redesign: tokens, screens, drawer, bookmark wiring#5

Merged
cmitchell8 merged 1 commit into
mural-mainfrom
watercolor/redesign-screens
May 14, 2026
Merged

Watercolor FE redesign: tokens, screens, drawer, bookmark wiring#5
cmitchell8 merged 1 commit into
mural-mainfrom
watercolor/redesign-screens

Conversation

@cmitchell8
Copy link
Copy Markdown
Collaborator

Summary

Implements the FE Watercolor Redesign PRD against this fork — adds a new dojo.watercolor Django app exposing the five PRD screens (Home, Browse, Queue, Reports, Drawer partial) under an additive /watercolor/ URL namespace. No upstream templates or static assets were modified; the existing /dashboard route is untouched.

PRD: https://github.com/tactivos/security_pipeline/blob/main/docs/agent-work/prd-fe-watercolor-redesign.md

New routes

Path View Name
/watercolor/ views.home watercolor_home
/watercolor/browse/ views.browse watercolor_browse
/watercolor/queue/ views.queue watercolor_queue
/watercolor/reports/ views.reports watercolor_reports
/watercolor/finding/<int:finding_id>/drawer/ views.drawer watercolor_drawer

Locked decisions honored

  • Additive namespace. All routes live under /watercolor/; no upstream URL is replaced or shadowed.
  • Scoped theme. Every token (palette, severity washes, six category gradients, radii, shadows, motion) lives under body.theme-watercolor in watercolor.css. The class is applied via a tiny JS shim in _base.html only on the five new screens, so the redesign cannot bleed into existing DefectDojo surfaces.
  • Fallback fonts. Per the PRD's font-licensing risk note, the display font is Georgia, serif and the UI font is system-ui — no bundled STKBureau/ABCSocial.
  • Pre-baked covers. 25 SVG covers under dojo/static/dojo/img/watercolor/covers/ (5 per severity), selected deterministically via finding.id % 5 in the cover_svg template tag. 6 category icons under dojo/static/dojo/img/watercolor/category/.
  • Reports = discoverability shell. Four cards link to the existing fork report engine via the report_builder named URL.
  • SSR-first. Counters, card lists, and Drawer HTML are server-rendered. JS handles only progressive behaviors: count-up animation, bookmark toggle, drawer fetch/slide, the Cmd-K palette, and card stagger.

Re-use of backend helpers

Views import _user_findings and _open_findings from dojo.api_v2.dashboard.views and call categorize_queryset() directly — no aggregation logic is duplicated. The Queue union (bookmarked OR assigned) mirrors the existing MeQueueViewSet.list logic.

Deviations / notes for reviewer

  • The upstream base.html bakes class="{% dojo_body_class %}" onto <body> with no overrideable block, so _base.html applies the theme-watercolor class via a tiny inline script on DOMContentLoaded rather than at render time. The class is not removed when leaving a watercolor screen because navigation triggers a full page reload.
  • The watercolor JS posts/deletes against the existing /api/v2/bookmarks/ ViewSet using the CSRF cookie + same-origin credentials. No new endpoints are introduced.

Test plan

Backend unit tests in unittests/test_watercolor_views.py:

  • test_anonymous_redirects_to_login — each of the four screen routes returns 302/301/403 for anonymous users.
  • test_authenticated_user_gets_200 — Home / Browse / Queue / Reports all return 200 for a superuser.
  • test_queue_empty_state_copy — wipes findings; asserts the verbatim PRD empty-state string is in the response.
  • test_queue_union — bookmarked finding + assigned finding both appear exactly once on /watercolor/queue/.
  • test_browse_querystring_filters?severity=High&category=web excludes a Low-severity finding.
  • test_drawer_accessible_finding_returns_partial — drawer for an accessible finding returns 200 with the drawer head markup.
  • test_drawer_inaccessible_finding_returns_404 — drawer for a finding in another product returns 404 (not 403) so existence does not leak.
  • test_permission_isolation — two analysts in disjoint products see disjoint Queue card lists.

Manual browser walk-through (reviewer with running stack):

  • /watercolor/ shows hero counters animating from 0, six category tiles, three card rails.
  • Clicking a category tile lands on /watercolor/browse/?category=<id> with the chip pre-filtered.
  • Clicking a card opens the right-side drawer; Esc closes it; Tab cycles inside.
  • Heart toggle on a card hits /api/v2/bookmarks/, updates the nav badge, fires a toast.
  • /watercolor/queue/ shows saved + assigned findings; with all findings removed shows the verbatim PRD empty copy.
  • /watercolor/reports/ shows four wash-tinted cards; Generate CTA deep-links to the existing report builder.
  • Cmd-K / Ctrl-K opens the command palette; Esc closes it.
  • Existing /dashboard route still renders unchanged.

🤖 Generated with Claude Code

Adds a new dojo.watercolor app providing the five PRD screens (Home, Browse,
Queue, Reports, finding Drawer partial) under the additive /watercolor/
URL namespace. All visual tokens (palette, severity washes, six category
gradients, radii, shadows, motion) are scoped under body.theme-watercolor
so the redesign cannot leak into existing DefectDojo surfaces.

Views re-use the queryset helpers (_user_findings, _open_findings) backing
the existing dashboard ViewSets and the shared categorize_queryset helper
so no aggregation logic is duplicated. Per-view scoping uses
get_authorized_findings(Permissions.Finding_View). Bookmarks round-trip
through the existing /api/v2/bookmarks/ endpoints; the drawer is fetched
as an HTML partial from /watercolor/finding/<id>/drawer/.

Includes 25 pre-baked SVG covers (5 per severity, picked by finding.id % 5)
and 6 category icons. Fonts fall back to Georgia + system-ui per the PRD's
font-licensing risk decision. Reports cards are a discoverability shell
linking to the existing report builder.

Tests cover anon redirects, authenticated 200s, the verbatim Queue empty
copy, the bookmarked-OR-assigned Queue union, permission isolation across
two analysts, drawer 200/404 contract, and Browse querystring filters.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cmitchell8 cmitchell8 merged commit f1a0654 into mural-main May 14, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant