Skip to content

Normalize colors to semantic theme tokens (#5494), plus schema-form JSON view and endpoint card fixes - #5496

Merged
norman-abramovitz merged 4 commits into
cloudfoundry:developfrom
nabramovitz:feat/5494-theme-token-color-sweep
Jun 25, 2026
Merged

Normalize colors to semantic theme tokens (#5494), plus schema-form JSON view and endpoint card fixes#5496
norman-abramovitz merged 4 commits into
cloudfoundry:developfrom
nabramovitz:feat/5494-theme-token-color-sweep

Conversation

@nabramovitz

Copy link
Copy Markdown
Contributor

Three related changes, one per commit.

  1. Normalize hard-coded colors to semantic theme tokens (Closes Normalize remaining hard-coded / light-only colors to semantic theme tokens (light/dark) #5494)
    Replace raw Tailwind palette utilities and hard-coded hex/rgb across the
    frontend with the app's semantic tokens (content-*, bg-content-bg,
    ring-primary, text-danger/-success/-warning/-info, accent-primary, the
    *-50/-900 accent scales, bg-tentative). Neutrals and accent foregrounds
    resolve via .dark-theme and adapt to dark mode with no dark: variant;
    tinted surfaces keep paired dark: variants; chart series resolve theme
    CSS vars at runtime. Groundwork for the theming/branding work.

  2. Show schema parameter keys in the Form/JSON view (follow-up to Use the Monaco editor for raw-JSON service parameters #5488)
    The service-instance parameter editor's JSON view now always shows the
    full schema skeleton with current values overlaid, so every parameter is
    visible (set values filled, the rest as empty placeholders). Placeholders
    are stripped from the submitted params, so an untouched field is shown
    but not sent. Also drops a duplicate description-as-placeholder on scalar
    inputs and mutes the enum select's placeholder until a value is chosen.

  3. Keep endpoint card address icons inside the card
    Long endpoint URLs pushed the copy/warning icons past the card edge in
    card view; the address now truncates (full URL on hover).

Testing

  • Unit: schema-resolve util + schema-form component specs; updated specs
    that asserted prior raw class names.
  • Production build clean.
  • Live-verified in light and dark mode (home, marketplace, applications,
    endpoints, create-service form + JSON view).

Replace raw Tailwind palette utilities (gray/blue/red/etc.) and hard-coded
hex/rgb values with the app's semantic theme tokens across the frontend, so
colors adapt to dark mode and follow the theming/branding work.

- Neutral/structural colors -> content-text/-muted/-border, bg-content-bg,
  ring-primary. These resolve via .dark-theme, so the redundant dark:
  variants are dropped.
- Semantic accent foreground -> text-danger/-success/-warning/-info.
- Tinted surfaces (alerts, badges) -> semantic *-50/-900 scale with paired
  dark: variants, since the scale tokens are static.
- Checkbox/radio accents -> accent-primary/ring-primary; neutral status
  dots -> bg-tentative; chart series resolve theme CSS vars at runtime.
- SCSS/@apply hex -> var(--...). The snackbar keeps a deliberate inverse
  (dark) overlay in both themes.

Also tidies two schema-renderer nits surfaced while reviewing: scalar
inputs no longer duplicate the description as a placeholder (it already
shows as help text), and the enum select's placeholder option is muted
until a value is chosen.

Specs updated where they asserted the previous raw class names.

Refs cloudfoundry#5494
The JSON view previously seeded only the parameters the user had entered,
so an empty or partly-filled form showed an empty (or partial) editor and
the available parameters were not discoverable.

Always overlay the current values onto a full schema-derived skeleton when
switching to the JSON view, so every field is visible: set values appear
filled in, untouched ones as empty placeholders. The placeholders are
stripped from the data that is actually submitted, so an untouched field
is shown but not sent, and falsy-but-set values (false / 0) are preserved.

- schemaToSkeleton(): build the full key skeleton from a (resolved) schema.
- mergeSkeleton(): overlay current values onto the skeleton.
- stripEmpty(): drop unset values (null / "" / [] / empty objects) from the
  submitted params and from advisory validation, so warnings stay relevant.
- JSON output is pretty-printed for readability.

Pure helpers are unit-tested; component specs cover the empty-skeleton and
value-overlay cases.
On the endpoints card view, a long endpoint URL pushed the copy and
duplicate-warning icons past the right edge of the card, because the
address text did not truncate. Constrain the address with min-w-0 +
truncate (full URL still available via tooltip) and size the warning
icon to match, so the icons stay within the card on long URLs.

@norman-abramovitz norman-abramovitz 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.

LGTM

@norman-abramovitz
norman-abramovitz merged commit 9d54514 into cloudfoundry:develop Jun 25, 2026
12 checks passed
@nabramovitz
nabramovitz deleted the feat/5494-theme-token-color-sweep branch June 25, 2026 13:19
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.

Normalize remaining hard-coded / light-only colors to semantic theme tokens (light/dark)

2 participants