Skip to content

Add FlBadge, FlTag and FlAvatar - #104

Merged
pournasserian merged 11 commits into
mainfrom
67-badge-tag-avatar
Nov 28, 2026
Merged

pournasserian merged 11 commits into
mainfrom
67-badge-tag-avatar

Conversation

@pournasserian

@pournasserian pournasserian commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

Adds FlBadge, FlTag and FlAvatar for statuses, removable choices and people, using the existing badge.css, tag.css and avatar.css and FlIcon. No new library JavaScript, inline style or dependency.

Head under review: 123bd367bb697f786b7d6c3d6f763ace86bad1eb (main bb32981 merged in by the coordinator; its delta against the new base is identical to the earlier #67 delta). Hosted CI and the Firefox/WebKit nightly for this head are the coordinator's and are forthcoming; nothing below claims them. No further commits are planned.

Evidence on exactly 123bd36 (Windows 11 ARM64, .NET 10; Playwright's Chromium, Firefox and WebKit builds, not Safari; local logs in the evidence folder …\opencode\c1-ses_ddde3f47cffexqAc6zbKkGZTPF\67):

  • dotnet build -c Release -warnaserror: exit 0, 0 warnings, 0 errors (release-build-r7.log).
  • dotnet pack src/FluentCMS.Components -c Release --no-build -o package6: exit 0. python3 .github/scripts/package_size.py package6\FluentCMS.Components.1.0.0.nupkg: exit 0; gzip css 36044 B, js 2044 B, dll 46447 B (size6.txt). No gallery, png or svg entries in the nupkg; the forced-colours border-color: CanvasText rule is present.
  • Archive SHA-256 3943D603544F771171F06DD1002CCC1B1D13A8F98AAFD0DEDFFE50E5A535DE62. Isolated consumer (consumer6, own NUGET_PACKAGES, NUGET_HTTP_CACHE_PATH, NUGET_PLUGINS_CACHE_PATH, local feed plus nuget.org): dotnet run exit 0; the nupkg it restored into its pristine cache has the same SHA-256. It renders badge, tag (submit button with name/value) and avatar (img, empty alt, no style) and rejects an inert removable tag (consumer6-run.log).
  • dotnet test --project tests/FluentCMS.Components.Browser --filter-class "*Data.AvatarPolicyTests" with FLUENTCMS_BROWSER = chromium, webkit, firefox: each exit 0, 2/2 passed, 0 skipped (policy5-*.log, pixels in pixels7). Under style-src 'self'; style-src-attr 'none'; img-src 'self' with JavaScript off a loaded photo changed ~69 % of its avatar and a failed one kept 100 % of the initials. The securitypolicyviolation events show the control (style-src-attr | inline, written by script) in all three engines and, besides it, only the gallery's data: favicon (Chromium, Firefox).

Earlier evidence (heads 9755b8c and before; not repeated on 123bd36): Browser.Data 60/60 in Chromium and WebKit on 9755b8c; unit 242 passed; segmented 21/21; Chromium Layout, Forms and Button* on older integrated heads. Firefox history: local full Data runs were unstable across earlier heads (58/58, then 54/59, 58/59, 55/59, one browser crash, and 5, 1 and 4 failures on later heads; different tests each time: Tab/focus reads over the 3 s timeout, interactive takeover waits, GalleryPassesAxe hanging). After a TabStart change no full local Firefox Data pass was repeated. Firefox is unconfirmed until the hosted run.
API.

  • FlBadge: Tone, Dot, Icon, Square, ChildContent. Text only, never a focus stop. A standalone count carries what it counts in hidden text the caller passes.
  • FlTag: Text, Icon, InList, Removable, OnRemove, RemoveSubmit + RemoveAttributes, RemoveLabel, Disabled, FocusRemoveAsync(). The remove button is a native button named by FlText.Remove ("Remove {0}"). A removable tag needs OnRemove or RemoveSubmit, or it throws: no inert buttons. FocusRemoveAsync() is one @ref and FocusAsync, called by the host after it renders (the host owns focus after a removal); without an interactive mode the framework throws.
  • FlAvatar: Name, Initials, Src, Icon, Size, Category, Decorative. Standalone: one role="img" with aria-label; decorative: aria-hidden.
  • FlText keeps main's identities: Close 0, Loading 1, Clear 2, ShowPassword 3, Decrease 4, Increase 5, InvalidDate 6, InvalidDateTime 7, InvalidTime 8; Remove = 9 (English "Remove {0}") is added after them. All main routes, the button-states.js blocks (button, card, input, textarea, segmented) and the new .fl-tag twin are kept.

Avatar photo and strict policy. Src renders <img class="fl-avatar__image" alt=""> over the initials, no style attribute, no JavaScript. avatar.css sizes the image to the avatar's width, centred, with no height of its own (an img with a definite height draws the browser's broken-image glyph when it fails: a corner icon in Chromium, a box that hides the initials in WebKit). A square photo fills the avatar, a taller one is cropped, a wider one leaves a band of the avatar's fill. In forced colours .fl-avatar sets border-color: CanvasText. CONTRIBUTING.md is identical to main.

Gallery (/badge, /tag, /avatar). Tag variants and the wrapping list are real GET forms operable without script (each removal adds its key to the address and keeps earlier ones); the callback/focus example exists only on the interactive routes (the static route shows a note linking to them); the states table is inert. The avatar photos are a same-origin PNG and a missing file.

Decisions on #27 items are unchanged: outline badge, FlAvatarGroup/Max and the tag tooltip are deferred; the avatar name over a quieter line is composed from existing markup.

Not covered: Safari, a screen reader, real forced colours, a non-English provider outside bUnit, the appearance of very wide or tall photos beyond the documented fit.

Closes #67

@pournasserian pournasserian left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking review of 8e309f7: several enabled Remove buttons are wired to Ignore (including an entire list); the static callback example also exposes controls that cannot act. This contradicts the no-empty-actions contract. Please give the gallery operable interactions or an explicitly non-operable presentation. Simplify the focus helper to avoid an unresolved TaskCompletionSource if its follow-up render never occurs. The failed-image CSS is engine-dependent; verify the visible initials, not only computed styles, and bring the branch up to date from main before merge.

@pournasserian pournasserian left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6953f30 remains blocked: Src is now an inline style, so a valid same-origin photo disappears under the supported self-only style CSP. Rewriting CONTRIBUTING to permit it is not an acceptable fix. Also remove the unconditional engine-name skip in ForcedColoursKeepTheAvatarEdge; if the media query matches, test a real edge and fix its styling. Keep operable tag/focus improvements; use CSP-compatible native image markup with an honest, readable no-script fallback. A broken image need not be pixel-identical to initials so long as the consumer gets a usable fallback (but do not weaken the existing target, accessibility, or forced-colour floors).

@pournasserian pournasserian left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed integrated 9755b8c on 533540c. CSP policy exception and style attribute are gone: loaded same-origin native img and readable failed-photo initials are verified with scripting off; no engine-name forced-colour waiver. Tag examples have operable actions and focus after removal, and main API/route/text entries survive. Windows Firefox full subset had variable failures despite the passing policy check. Release/consumer confirmation, required PR CI, and hosted cross-browser investigation are in flight; no merge yet.

@pournasserian

Copy link
Copy Markdown
Member Author

Hosted PR CI (46168186944) is green: 242 component tests, 467 Chromium passes, one explicit standalone skip. The separate Linux cross-browser run 46168239715 failed 3 Firefox and 10 WebKit rows, all in existing C1 number-step focus (#70), segmented keyboard boundaries (#73), and temporal focus / second JS-disabled POST (#74). No Data row failed. Do not interpret that as a green full nightly. Running the same nightly workflow on exact base 533540c (46169433472) and investigating by owning issue before merge.

@pournasserian pournasserian left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coordinator re-review after integrating the three owner-scoped cross-browser fixes at bb32981. Compared the complete binary/full-index #67 diff against the prior reviewed diff: byte-identical. Merge-tree conflicts: none. Prior baseline-vs-candidate failures matched exactly and the combined fixes passed both Linux engines. Now require fresh PR CI, Linux Firefox/WebKit and packaged evidence on 123bd36; no check bypass.

@pournasserian
pournasserian merged commit 1ce93f6 into main Nov 28, 2026
6 checks passed
@pournasserian

Copy link
Copy Markdown
Member Author

Accepted and merged on the reviewed 123bd36 tree. Final PR CI 46173784293: 242 component and 467 Chromium tests passed. Final Linux Firefox/WebKit workflow 46173865833: 467 passed in each, zero failures, one explicit standalone skip per engine. Build, pack, and size report passed; the package hash matched the isolated consumer. No Safari or manual speech pass is claimed.

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.

C-15: Build FlBadge, FlTag and FlAvatar for labelled states and identities

1 participant