Skip to content

Show a flag's state as a circle at the top of its card, and wrap long names - #79

Merged
readingdancer merged 4 commits into
developfrom
feature/card-view-large-circle
Nov 25, 2026
Merged

readingdancer merged 4 commits into
developfrom
feature/card-view-large-circle

Conversation

@readingdancer

@readingdancer readingdancer commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Summary

Long flag names have no spaces, so in the card view they ran out of the card and pushed against the switch. This reworks the card, chosen from the layout mockups (option C with the large circle).

┌──────────────────────────────────────┐
│ ◐ On for an audience                 │  state: circle + words + note
│   3 members and 1 member group       │
├──────────────────────────────────────┤
│ SubscriptionRenewalReminder      [⋯] │  name wraps between words;
│ EmailsWithDiscountCodes              │  actions only when registered
│ Email members a week before …        │  description takes full width
│ ● Changed here  ● Differs from default│ markers as text, not pills
│ 🏷 email, compliance                  │  tags as text
│                                      │
├──────────────────────────────────────┤
│ Demo Admin · Nov 25, 2026     [on ]  │  footer pinned to the bottom
└──────────────────────────────────────┘
  • State circle: empty when off, half for an audience, conditions or Custom, full for everyone. Coloured with Umbraco's tokens: grey, default blue, amber for Custom, green for everyone.

  • Names wrap between PascalCase words and after . _ - (nameParts() in display.ts). flagName() uses it, so long names in the table view wrap at sensible points too. The table's name column also falls back to overflow-wrap: anywhere.

  • Fewer pills: markers become coloured text with a dot, and tags a plain list after a tag icon.

  • Footer holds the last change and the switch, pinned to the bottom so switches line up across a row.

  • The card is a plain element styled like a uui-box, because that's what lets the footer be pinned. The actions button only takes space when an entity action is registered for flags, as in the table view.

  • Filter dropdowns: uui-select pads its native select by only 6px a side, which left the browser's arrow against the right edge. The filters set --uui-select-padding-x to --uui-size-3 (9px).

Evidence

  • npm test: 126 tests pass, including new ones for nameParts() and stateFill(). npm run build succeeds.
  • Checked in the demo backoffice on Umbraco 17 with a rebuilt database, plus extra flags passed on the command line:
    • a 57-character PascalCase name and a dotted snake_case name;
    • a time-window condition;
    • a long audience ("1 member, 1 member group, 1 other group and 25% of everyone else, except 1 member");
    • a Custom state.
  • Every state's circle was right, names and descriptions wrapped inside the card, and footers lined up. Switching a flag off showed the markers as text and the footer as "Demo Admin · Nov 25, 2026, 12:07 AM".
  • Not checked: dark mode in the backoffice, Umbraco 18 and 19, and narrow screens below one card per row.

Merge danger

Two-way door. It only changes how the built-in card and table views look. Element tag names, the collection views and their styles aren't part of the promised public surface (docs/backoffice.md), and there are no API or settings changes. docs/design.md now describes the card as a plain element styled like a uui-box, and the card view's state circle and text markers.

There's no issue for this change. It came from installing the package on a site and finding that long flag names broke the card layout.

… names

Long flag names have no spaces, so they ran out of their card and pushed
against the switch. Names now wrap between PascalCase words and after
. _ -, in the card and the table.

Each card now reads top to bottom:
- the state as a circle (empty when off, half for some, full for
  everyone, coloured by kind) with the state and its note in words;
- the name, beside the actions button only when one is registered, and
  the description across the full width;
- markers and tags as text rather than pills;
- the last change and the switch in a footer pinned to the bottom, so
  switches line up across a row.
@readingdancer
readingdancer force-pushed the feature/card-view-large-circle branch from bbd8675 to 0bbcc6d Compare November 25, 2026 05:12
@readingdancer

Copy link
Copy Markdown
Member Author

Review: two small points, then fine to merge

Reviewed at 0bbcc6d against develop. Nothing is broken. It only changes how the built-in card and table views look, with no API, settings or server changes, so the risk is low.

Before merging

  1. docs/design.md:264 and :266 are now more out of date.

    • The "Built from Umbraco's own parts" table still lists the card view as uui-card and the state and markers as uui-tag.
    • With this change, the card is a plain <article> styled with UUI tokens so its footer can be pinned to the bottom. The card view's state and markers are a circle and text, not uui-tag.
    • The section also opens with "nothing is drawn by hand that Umbraco already has", and the card is now a deliberate exception to that.

    Suggested rows:

    Part Umbraco component
    Card view a plain element styled with UUI tokens like uui-box, so the footer can be pinned to the bottom of the card
    State and markers uui-tag in the list view; a state circle and text in the card view

    Plus one sentence after the table saying why the card doesn't use uui-card.

  2. The description has no Closes #N. CONTRIBUTING.md asks a PR to link the issue it closes. Add it, or say there is no issue for this change.

What I checked

  • stateTag and markerTags are still used by the table view, so nothing is left unused.
  • flagName() gives the same text as before for undeclared flags and in "updated" order. <wbr> adds no characters when a name is copied, and the full name stays in title.
  • The row-actions button follows the same observeFlagEntityActions pattern as the table and the editor.
  • stateFill() covers all five FlagState values, and every marker color markers() returns has a matching style.
  • The new tests for nameParts() and stateFill() check real output and would fail if it changed.

Built and tested

  • Client: npm ci && npm test: 126 passed.
  • npm run build: succeeded with no type errors.
  • Unit tests (dotnet test tests/Umbricians.FeatureFlags.Tests): 376 passed.
  • Not checked, as the PR also says: dark mode, Umbraco 18 and 19, and narrow screens.

@readingdancer

Copy link
Copy Markdown
Member Author

Re-review at 55bedf4: one small point left, then fine to merge

Both earlier points are fixed:

  • docs/design.md now describes the card view as a plain element, with the state circle and text markers. It also gives the reason the card is the one exception to "nothing drawn by hand".
  • The description explains that there's no issue for this change.

One small point

docs/design.md:264 (and the comment at flags-card-view.element.ts:89) say the card is styled like a uui-box, but its CSS doesn't match one:

border-radius: var(--uui-border-radius);
box-shadow: var(--uui-shadow-depth-1);

In UUI 2.2.1, uui-box has a 1px border in --uui-color-divider-standalone, --uui-border-radius-3 corners and no shadow. So the cards come out shadowed and with smaller corners, unlike the boxes in the editor.

Either:

  • make the card match the box:

    border: var(--uui-box-border-width, 1px) solid var(--uui-box-border-color, var(--uui-color-divider-standalone));
    border-radius: var(--uui-box-border-radius, var(--uui-border-radius-3));

    and drop the box-shadow; or

  • keep the shadow and change the doc row and the comment to say the card is a plain element styled with UUI tokens.

If you keep the doc row, "styled with UUI tokens to match a uui-box" reads one way only. "Styled with UUI tokens like uui-box" can be read as uui-box being one of the tokens.

Checked

  • The other doc claims match the code: uui-tag in the list view; the state circle, state text and text markers in the card view; and the footer with the switch pinned by margin-top: auto in a flex column.
  • The reason given for the exception holds: uui-box puts its content in an unnamed slot with padding and no part, so the content can't be stretched to push a footer to the bottom.
  • The PR merges cleanly with the current develop, which now includes Give the startup checks a scope of their own #80. On the merge result:
    • Client: npm ci && npm test: 126 passed.
    • npm run build: succeeded.
    • Unit tests: 377 passed.
  • Not checked, as the PR also says: dark mode, Umbraco 18 and 19, and narrow screens.

@readingdancer
readingdancer merged commit d3b7d8e into develop Nov 25, 2026
7 checks passed
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