Skip to content

Refine MAPLE visual system and shared surfaces#51

Open
tripledoublev wants to merge 28 commits intofeat/ballot-questionsfrom
visual-system-refinement
Open

Refine MAPLE visual system and shared surfaces#51
tripledoublev wants to merge 28 commits intofeat/ballot-questionsfrom
visual-system-refinement

Conversation

@tripledoublev
Copy link
Copy Markdown
Member

Summary

This PR is a visual-system refactor, not a redesign. It introduces an app-wide token layer and applies it through shared primitives, buttons, shell components, and key detail-page surfaces to make MAPLE feel more consistent and intentional without changing page structure or core flows.

The goal is to establish a maintainable styling foundation first, then use that foundation to improve the look and feel across high-visibility parts of the app.

What changed

  • Tokens: add semantic --maple-* design tokens in globals.css, with compatibility aliases for existing ballot-question tokens to avoid breaking current BQ styling
  • Typography and buttons: tighten the type scale and standardize shared button spacing, radius, focus, and interaction states around the new token system
  • Shell: refresh the navbar and footer with explicit MAPLE brand styling and cleaner token-based desktop/mobile shell behavior
  • Cards and surfaces: unify card, titled-section, and search/filter surface treatments around shared border, radius, shadow, and background tokens
  • Page adoption: apply the shared token system to bill and ballot-question detail surfaces without restructuring those pages
  • Polish: replace remaining low-risk hardcoded visual values in shared/BQ helper states and detail surfaces with existing tokens

What was explicitly kept out of scope

  • Homepage redesign
  • Publish flow redesign
  • Search/InstantSearch re-skinning
  • MUI/Emotion cleanup

Testing

  • Storybook smoke-test passed after each phase
  • Manual route sweep: /, /bills, /testimony, /ballotQuestions, representative bill detail, representative ballot question detail
  • No visual regressions observed on shared primitive consumers

Provisional decisions to follow up

  • --maple-surface-page: #eae7e7 preserves the current body background for now and is intentionally marked provisional for later retuning once page/base/muted surface relationships can be adjusted together
  • The accent token family based on rgba(94, 114, 228, ...) was carried forward from the ballot-question work; whether that becomes app-wide accent language or remains BQ-specific should be confirmed in a later pass

@tripledoublev tripledoublev changed the base branch from main to feat/ballot-questions April 14, 2026 19:02
@tripledoublev tripledoublev force-pushed the visual-system-refinement branch from 68c6a09 to 41873e7 Compare April 14, 2026 21:44
tripledoublev and others added 23 commits April 15, 2026 13:10
The firestore mock wrappers call mockDoc(...args) / mockGetDoc(...args),
but the jest.fn signatures were zero-arg, failing typecheck with TS2556.
Type the mocks as (..._args: unknown[]) so the rest spread matches.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Maple tokens were previously duplicated: SCSS variables in bootstrap.scss
(compile-time, consumed by Bootstrap overrides) and CSS custom properties
in globals.css (runtime, consumed by components). The two layers had no
structural link — notably, Bootstrap's input focus ring was never wired
to --maple-focus-ring, so inputs rendered a pink $primary-derived ring.

Define tokens as SCSS variables in bootstrap.scss, wire them into
Bootstrap overrides ($input-btn-focus-box-shadow now uses $maple-focus-ring),
and emit them as CSS custom properties from the same :root block.
Remove the duplicate :root block from globals.css.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace all $bq-* / --bq-* tokens and ballot-question-* class names
with app-wide maple primitives. Add shared utility classes for
surfaces, eyebrows, icon chips, nav links, and pill links.

Made-with: Cursor
Tokenize ballot status colors, add inverse overlay tokens,
fix legacy our-team CSS, prune unused :root emissions,
scope .btn padding/weight to primary/secondary variants,
and remove dead code in CommitteeHearing.

Made-with: Cursor
Remove the old 7-state model (legislature, qualifying, certified, ballot,
enacted, failed, withdrawn) and finalize the new 4 states: expectedOnBallot,
failedToAppear, rejected, accepted.

Updates the runtype union, status helpers, and STATUS_STYLES map to match.
- Emit --maple-focus-border to :root (was SCSS-only, unavailable at runtime)
- Rename --mobile-nav-link-* to --maple-nav-link-* for naming consistency
- Add semantic color palette tokens (--maple-color-{blue,green,red,gray}-subtle-*)
- Wire status tokens as aliases of the palette layer instead of raw hex values
- Update globals.css comment and nav link token references to match rename
Migrate all remaining instances of raw brand and surface colors to CSS
custom property references:

- #1a3185 → var(--maple-brand-primary)
- #12266f → var(--maple-brand-primary-strong)
- #c71e32 / #902323 → var(--maple-brand-danger)
- #ffffff → var(--maple-surface-base) or var(--maple-text-inverse)
- #f1f1f1 → var(--maple-surface-muted)

Files: BillStatusCard, StyledEditProfileComponents, HeroHeader.module.css,
StyledNewsfeedComponents, PolicyPage.module.css, Tabs, UserFilterDropdown,
SponsorsAndCommittees, ResourcesCard, Transcriptions, PaginationButtons
Replace stale status values ("ballot", "certified") with valid ones from
the new 4-state model ("expectedOnBallot").
Define font-weight (normal/medium/semibold/bold) and line-height
(tight/base/loose) as SCSS variables and emit them to :root as CSS custom
properties, making them available to styled-components at runtime.
…mponents

Replace hardcoded font-weight and line-height values with
var(--maple-font-weight-*) and var(--maple-line-height-*) tokens.
Replace ad-hoc values (0.35rem, 0.375rem, 0.4rem, 0.62rem, 0.8rem, 0.9rem,
9px) in BrowseBallotQuestions and HearingSidebar with the nearest
var(--maple-space-*) token.
Cover three previously undocumented component areas:
- BrowseBallotQuestions: Default, Empty, and SingleStatus variants
- ResourcesCard: Default
- HearingSidebar: Default, NoDate, and Empty variants
@tripledoublev tripledoublev force-pushed the visual-system-refinement branch from 5121b24 to 3b8ba36 Compare April 15, 2026 17:11
Use the current 4-state ballot question lifecycle in the integration fixture so syncBallotQuestions passes validation and CI can seed the test document again.

Made-with: Cursor
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