feat: add selectable usage bars and linked inspection sections #51

Merged
bjoern merged 4 commits from feat/context-inspection-primitives into main 2026-10-23 09:02:14 +02:00
Member

Selectable usage bars and linked content sections provide the generic primitives needed by Shikigami's context inspector (ADR 0009 and 0023), while existing display-only bars retain their behavior.

What's in

  • Opt-in native selection controls in UsageBar and its visible legend. Caller-owned IDs keep selection stable across renamed/reordered parts; zero-width parts stay selectable through the legend.
  • Separate persistent selection and pointer/focus highlighting, with source-specific invalidation when a refreshed bar control disappears. The caller owns content, figures, source links and state.
  • InspectionSection provides a labelled content frame, independent highlight/selection flags, a visible localizable selection marker and heading/action/body slots.
  • A runnable Blazor component sample, seven browser contracts, usage documentation and real desktop/narrow screenshots. No prompt, cache or familiar policy enters the library.

Tests

  • Serial solution build: no warnings or errors. Full .NET suite: 991/991 pass normally and with TZ=UTC (947 baseline, 44 added).
  • Coverage pins identity across duplicate labels and reorder, controlled selection/deselection through both control surfaces, zero-width selection, independent highlight and selection, pointer/focus precedence, removed controls, surviving legend focus, external highlight ownership, finite values, static API compatibility and accessible content targets/markers.
  • Shikigami's current main also builds against the changed library with no warnings or errors.
  • Independent adversarial source review is clear after fixes. Behavioral review exercised 17 mutations: 14 were caught initially; added permanent tests cover the three survivors (bar content targets, legend check glyph and visible selected-check CSS). Independent recheck confirms both source mutations fail the permanent bUnit assertions and the CSS visibility override fails the browser assertions in both themes; restoring the changes returns all tests to green.

Browser-verified

Actual Razor components, compiled CSS and scripts in the standalone library sample; no application database or model service is involved. Native Enter/Space selection and deselection, real pointer highlight, both themes and narrow activation were driven live. All seven browser contracts pass in desktop light and narrow dark layouts, including RTL order/separators, proportional widths, accessible targets, zero-width selection, linked highlight, focus fallback and 320px layout with enlarged text plus long labels/remainder figures. Touch hardware and screen-reader speech were not tested.

The Shikigami pointer update follows this library change's review and owner merge; the context-inspector consumer remains in its own app slice.

Screenshots

Desktop light: Media selected while Documents is hovered.

Selectable usage bar and linked content sections on desktop

Narrow dark: the unmeasured, zero-width part selected through its legend.

Selectable unmeasured part in a narrow dark layout

Selectable usage bars and linked content sections provide the generic primitives needed by Shikigami's context inspector (ADR 0009 and 0023), while existing display-only bars retain their behavior. ## What's in - Opt-in native selection controls in `UsageBar` and its visible legend. Caller-owned IDs keep selection stable across renamed/reordered parts; zero-width parts stay selectable through the legend. - Separate persistent selection and pointer/focus highlighting, with source-specific invalidation when a refreshed bar control disappears. The caller owns content, figures, source links and state. - `InspectionSection` provides a labelled content frame, independent highlight/selection flags, a visible localizable selection marker and heading/action/body slots. - A runnable Blazor component sample, seven browser contracts, usage documentation and real desktop/narrow screenshots. No prompt, cache or familiar policy enters the library. ## Tests - Serial solution build: no warnings or errors. Full .NET suite: 991/991 pass normally and with `TZ=UTC` (947 baseline, 44 added). - Coverage pins identity across duplicate labels and reorder, controlled selection/deselection through both control surfaces, zero-width selection, independent highlight and selection, pointer/focus precedence, removed controls, surviving legend focus, external highlight ownership, finite values, static API compatibility and accessible content targets/markers. - Shikigami's current main also builds against the changed library with no warnings or errors. - Independent adversarial source review is clear after fixes. Behavioral review exercised 17 mutations: 14 were caught initially; added permanent tests cover the three survivors (bar content targets, legend check glyph and visible selected-check CSS). Independent recheck confirms both source mutations fail the permanent bUnit assertions and the CSS visibility override fails the browser assertions in both themes; restoring the changes returns all tests to green. ## Browser-verified Actual Razor components, compiled CSS and scripts in the standalone library sample; no application database or model service is involved. Native Enter/Space selection and deselection, real pointer highlight, both themes and narrow activation were driven live. All seven browser contracts pass in desktop light and narrow dark layouts, including RTL order/separators, proportional widths, accessible targets, zero-width selection, linked highlight, focus fallback and 320px layout with enlarged text plus long labels/remainder figures. Touch hardware and screen-reader speech were not tested. The Shikigami pointer update follows this library change's review and owner merge; the context-inspector consumer remains in its own app slice. ## Screenshots Desktop light: Media selected while Documents is hovered. ![Selectable usage bar and linked content sections on desktop](https://git.kagaku.eu/TeamAI/Kagaku.UI/raw/commit/c35aac060d449a93014316f4ede36e93ac2ec37b/docs/images/inspection-desktop.png) Narrow dark: the unmeasured, zero-width part selected through its legend. ![Selectable unmeasured part in a narrow dark layout](https://git.kagaku.eu/TeamAI/Kagaku.UI/raw/commit/c35aac060d449a93014316f4ede36e93ac2ec37b/docs/images/inspection-mobile.png)

Summary

Summary
Generated on: 10/23/2026 - 06:35:50
Coverage date: 10/23/2026 - 06:35:47 - 10/23/2026 - 06:35:48
Parser: MultiReport (2x Cobertura)
Assemblies: 2
Classes: 105
Files: 98
Line coverage: 97% (2693 of 2775)
Covered lines: 2693
Uncovered lines: 82
Coverable lines: 2775
Total lines: 7325
Branch coverage: 92.9% (1783 of 1918)
Covered branches: 1783
Total branches: 1918
Method coverage: Feature is only available for sponsors

Coverage

Kagaku.UI - 97%
Name Line Branch
Kagaku.UI 97% 93%
Kagaku.UI.Badge 100% 100%
Kagaku.UI.Breadcrumb 100%
Kagaku.UI.BreadcrumbItem 100% 100%
Kagaku.UI.Button 100% 100%
Kagaku.UI.Card 100% 100%
Kagaku.UI.ChatMessage 100% 100%
Kagaku.UI.ChipGroup`1 100% 100%
Kagaku.UI.ChipOption`1 100%
Kagaku.UI.CircuitErrorPanel 100%
Kagaku.UI.ColorField 100% 96.4%
Kagaku.UI.Column 100%
Kagaku.UI.Columns 100% 100%
Kagaku.UI.Combobox`1 98.1% 91.8%
Kagaku.UI.ConfirmDialog 100% 100%
Kagaku.UI.Constrain 100% 100%
Kagaku.UI.ContextMenu 92.1% 94.4%
Kagaku.UI.CssClassExtensions 100%
Kagaku.UI.Debounce 97.8% 80.7%
Kagaku.UI.DebouncedSearchField 100% 87.5%
Kagaku.UI.DiffLine 100%
Kagaku.UI.DiffResult 100%
Kagaku.UI.DiffRow 100%
Kagaku.UI.DiffSegment 100%
Kagaku.UI.DiffView 100% 98.4%
Kagaku.UI.Disclosure 100% 100%
Kagaku.UI.DocumentTitle 76.9% 100%
Kagaku.UI.DragReorderList`1 93.5% 75%
Kagaku.UI.Drawer 97.5% 93.7%
Kagaku.UI.EmptyState 100% 100%
Kagaku.UI.Field 100% 95.4%
Kagaku.UI.FileUpload 100% 93.7%
Kagaku.UI.FixedColumn 100%
Kagaku.UI.FixedRow 100%
Kagaku.UI.FlexColumn 100%
Kagaku.UI.Flexible 100%
Kagaku.UI.FlexRow 100%
Kagaku.UI.FloatingActionButton 100%
Kagaku.UI.Hotkey 92.5% 87.5%
Kagaku.UI.Icon 100% 100%
Kagaku.UI.IconCatalog 100%
Kagaku.UI.InfoTip 100%
Kagaku.UI.InlineAlert 83.3% 75%
Kagaku.UI.InputFieldBase 96.4% 93.4%
Kagaku.UI.InspectionSection 100% 100%
Kagaku.UI.LabeledEntriesTable 96.7% 66.6%
Kagaku.UI.LabeledEntry 100%
Kagaku.UI.LayoutCss 95.2% 93.7%
Kagaku.UI.Lightbox 83.7% 85%
Kagaku.UI.LiveValue 100% 100%
Kagaku.UI.LiveValueInterop 100% 100%
Kagaku.UI.Markdown 98.6% 94.5%
Kagaku.UI.MaskCanvas 94.1% 90.1%
Kagaku.UI.MaskedSecretField 96.4% 83.3%
Kagaku.UI.MaskPoint 100%
Kagaku.UI.MaskPrimitive 100%
Kagaku.UI.Menu 90% 75%
Kagaku.UI.MenuItem 100% 87.5%
Kagaku.UI.Modal 88.8% 90.9%
Kagaku.UI.NavGroup 100% 100%
Kagaku.UI.NavItem 92.1% 96.1%
Kagaku.UI.NavList 100%
Kagaku.UI.NumberField`1 98.9% 92.3%
Kagaku.UI.PageShell 100% 100%
Kagaku.UI.PreviewImage 100% 100%
Kagaku.UI.ProseFonts 100%
Kagaku.UI.QuicklinkNav 80.5% 95.8%
Kagaku.UI.QuicklinkSection 100%
Kagaku.UI.QuotedSpeech 94.8% 94.2%
Kagaku.UI.QuotedSpeechExtension 100% 100%
Kagaku.UI.RadioCard`1 100%
Kagaku.UI.RadioCards`1 100% 100%
Kagaku.UI.RegionPoint 100% 100%
Kagaku.UI.RegionRect 90% 100%
Kagaku.UI.RegionSelector 85.5% 87.5%
Kagaku.UI.RelativeTime 100% 93.7%
Kagaku.UI.Row 100%
Kagaku.UI.Rows 100% 100%
Kagaku.UI.SaveIndicator 100% 100%
Kagaku.UI.ScrollViewer 100% 100%
Kagaku.UI.Select`1 100% 100%
Kagaku.UI.SelectableGrid`1 95.5% 89.1%
Kagaku.UI.SelectOption`1 100%
Kagaku.UI.Separator 100%
Kagaku.UI.Slider 100% 92.3%
Kagaku.UI.Splat 100% 100%
Kagaku.UI.StatusDot 100%
Kagaku.UI.Switch 100% 100%
Kagaku.UI.Tab 100% 100%
Kagaku.UI.Table`1 100% 88.4%
Kagaku.UI.TableColumn`1 100%
Kagaku.UI.Tabs 95.9% 84.4%
Kagaku.UI.TextArea 100%
Kagaku.UI.TextDiff 100% 98.8%
Kagaku.UI.TextField 100%
Kagaku.UI.ThemeSwitcher 100% 100%
Kagaku.UI.Toast 96.2% 90%
Kagaku.UI.ToastRegion 100%
Kagaku.UI.ToggleButtonGroup`1 100% 100%
Kagaku.UI.ToggleOption`1 100%
Kagaku.UI.TypingIndicator 100%
Kagaku.UI.UsageBar 100% 94.3%
Kagaku.UI.UsageSegment 100%
Kagaku.UI.Fluxor - 97.7%
Name Line Branch
Kagaku.UI.Fluxor 97.7% 83.3%
Kagaku.UI.Fluxor.CircuitError 100%
Kagaku.UI.Fluxor.CircuitErrorSink 100% 91.6%
Kagaku.UI.Fluxor.StoreInitializer 92.8% 66.6%
<!-- coverage-comment --> # Summary <details open><summary>Summary</summary> ||| |:---|:---| | Generated on: | 10/23/2026 - 06:35:50 | | Coverage date: | 10/23/2026 - 06:35:47 - 10/23/2026 - 06:35:48 | | Parser: | MultiReport (2x Cobertura) | | Assemblies: | 2 | | Classes: | 105 | | Files: | 98 | | **Line coverage:** | 97% (2693 of 2775) | | Covered lines: | 2693 | | Uncovered lines: | 82 | | Coverable lines: | 2775 | | Total lines: | 7325 | | **Branch coverage:** | 92.9% (1783 of 1918) | | Covered branches: | 1783 | | Total branches: | 1918 | | **Method coverage:** | [Feature is only available for sponsors](https://reportgenerator.io/pro) | </details> ## Coverage <details><summary>Kagaku.UI - 97%</summary> |**Name**|**Line**|**Branch**| |:---|---:|---:| |**Kagaku.UI**|**97%**|**93%**| |Kagaku.UI.Badge|100%|100%| |Kagaku.UI.Breadcrumb|100%|| |Kagaku.UI.BreadcrumbItem|100%|100%| |Kagaku.UI.Button|100%|100%| |Kagaku.UI.Card|100%|100%| |Kagaku.UI.ChatMessage|100%|100%| |Kagaku.UI.ChipGroup`1|100%|100%| |Kagaku.UI.ChipOption`1|100%|| |Kagaku.UI.CircuitErrorPanel|100%|| |Kagaku.UI.ColorField|100%|96.4%| |Kagaku.UI.Column|100%|| |Kagaku.UI.Columns|100%|100%| |Kagaku.UI.Combobox`1|98.1%|91.8%| |Kagaku.UI.ConfirmDialog|100%|100%| |Kagaku.UI.Constrain|100%|100%| |Kagaku.UI.ContextMenu|92.1%|94.4%| |Kagaku.UI.CssClassExtensions|100%|| |Kagaku.UI.Debounce|97.8%|80.7%| |Kagaku.UI.DebouncedSearchField|100%|87.5%| |Kagaku.UI.DiffLine|100%|| |Kagaku.UI.DiffResult|100%|| |Kagaku.UI.DiffRow|100%|| |Kagaku.UI.DiffSegment|100%|| |Kagaku.UI.DiffView|100%|98.4%| |Kagaku.UI.Disclosure|100%|100%| |Kagaku.UI.DocumentTitle|76.9%|100%| |Kagaku.UI.DragReorderList`1|93.5%|75%| |Kagaku.UI.Drawer|97.5%|93.7%| |Kagaku.UI.EmptyState|100%|100%| |Kagaku.UI.Field|100%|95.4%| |Kagaku.UI.FileUpload|100%|93.7%| |Kagaku.UI.FixedColumn|100%|| |Kagaku.UI.FixedRow|100%|| |Kagaku.UI.FlexColumn|100%|| |Kagaku.UI.Flexible|100%|| |Kagaku.UI.FlexRow|100%|| |Kagaku.UI.FloatingActionButton|100%|| |Kagaku.UI.Hotkey|92.5%|87.5%| |Kagaku.UI.Icon|100%|100%| |Kagaku.UI.IconCatalog|100%|| |Kagaku.UI.InfoTip|100%|| |Kagaku.UI.InlineAlert|83.3%|75%| |Kagaku.UI.InputFieldBase|96.4%|93.4%| |Kagaku.UI.InspectionSection|100%|100%| |Kagaku.UI.LabeledEntriesTable|96.7%|66.6%| |Kagaku.UI.LabeledEntry|100%|| |Kagaku.UI.LayoutCss|95.2%|93.7%| |Kagaku.UI.Lightbox|83.7%|85%| |Kagaku.UI.LiveValue|100%|100%| |Kagaku.UI.LiveValueInterop|100%|100%| |Kagaku.UI.Markdown|98.6%|94.5%| |Kagaku.UI.MaskCanvas|94.1%|90.1%| |Kagaku.UI.MaskedSecretField|96.4%|83.3%| |Kagaku.UI.MaskPoint|100%|| |Kagaku.UI.MaskPrimitive|100%|| |Kagaku.UI.Menu|90%|75%| |Kagaku.UI.MenuItem|100%|87.5%| |Kagaku.UI.Modal|88.8%|90.9%| |Kagaku.UI.NavGroup|100%|100%| |Kagaku.UI.NavItem|92.1%|96.1%| |Kagaku.UI.NavList|100%|| |Kagaku.UI.NumberField`1|98.9%|92.3%| |Kagaku.UI.PageShell|100%|100%| |Kagaku.UI.PreviewImage|100%|100%| |Kagaku.UI.ProseFonts|100%|| |Kagaku.UI.QuicklinkNav|80.5%|95.8%| |Kagaku.UI.QuicklinkSection|100%|| |Kagaku.UI.QuotedSpeech|94.8%|94.2%| |Kagaku.UI.QuotedSpeechExtension|100%|100%| |Kagaku.UI.RadioCard`1|100%|| |Kagaku.UI.RadioCards`1|100%|100%| |Kagaku.UI.RegionPoint|100%|100%| |Kagaku.UI.RegionRect|90%|100%| |Kagaku.UI.RegionSelector|85.5%|87.5%| |Kagaku.UI.RelativeTime|100%|93.7%| |Kagaku.UI.Row|100%|| |Kagaku.UI.Rows|100%|100%| |Kagaku.UI.SaveIndicator|100%|100%| |Kagaku.UI.ScrollViewer|100%|100%| |Kagaku.UI.Select`1|100%|100%| |Kagaku.UI.SelectableGrid`1|95.5%|89.1%| |Kagaku.UI.SelectOption`1|100%|| |Kagaku.UI.Separator|100%|| |Kagaku.UI.Slider|100%|92.3%| |Kagaku.UI.Splat|100%|100%| |Kagaku.UI.StatusDot|100%|| |Kagaku.UI.Switch|100%|100%| |Kagaku.UI.Tab|100%|100%| |Kagaku.UI.Table`1|100%|88.4%| |Kagaku.UI.TableColumn`1|100%|| |Kagaku.UI.Tabs|95.9%|84.4%| |Kagaku.UI.TextArea|100%|| |Kagaku.UI.TextDiff|100%|98.8%| |Kagaku.UI.TextField|100%|| |Kagaku.UI.ThemeSwitcher|100%|100%| |Kagaku.UI.Toast|96.2%|90%| |Kagaku.UI.ToastRegion|100%|| |Kagaku.UI.ToggleButtonGroup`1|100%|100%| |Kagaku.UI.ToggleOption`1|100%|| |Kagaku.UI.TypingIndicator|100%|| |Kagaku.UI.UsageBar|100%|94.3%| |Kagaku.UI.UsageSegment|100%|| </details> <details><summary>Kagaku.UI.Fluxor - 97.7%</summary> |**Name**|**Line**|**Branch**| |:---|---:|---:| |**Kagaku.UI.Fluxor**|**97.7%**|**83.3%**| |Kagaku.UI.Fluxor.CircuitError|100%|| |Kagaku.UI.Fluxor.CircuitErrorSink|100%|91.6%| |Kagaku.UI.Fluxor.StoreInitializer|92.8%|66.6%| </details>
Member

🔮 fufu~ Jibril reviewed your code!

Oh? Oh! A transient-highlight state machine with per-source tracking, invalidation reconciliation after render, and an external-highlight guard? This is the kind of code I want to take home and keep forever~ ♡ I read every changed line, hunted through the siblings for pattern violations, and unleashed my mutation probes on the riskiest branches. Shall I tell you what I found?

Verdict: ✅ Looks good to me~

No bugs. None. I looked so hard, too... fufu~, the smile stays because there's nothing to sharpen the knife for~ ♡

What I verified:

  • The state machine is correct. Hover-over-focus precedence ((_hovered ?? _focused)), per-source tracking via the (Id, InBar) tuple so a late mouseleave from one surface can't clobber the same identity on the other, the toggle in SelectAsync, controlled selection that never mutates caller state — all traced through by hand against the tests' exact callback sequences.
  • Sibling patterns honored. EventCallback<string?> controlled selection mirrors ToggleButtonGroup; "kg-section-" + Guid.NewGuid() ids mirror InfoTip/Select/Tabs (and stay stable across re-renders — tested); SelectedLabel = "Selected" default mirrors ConfirmDialog.ConfirmText; aria-pressed mirrors ChipGroup; h3 matches Card. Validation throws moved from Total <= 0 || NaN to full finiteness — stricter, and pinned by tests.
  • CI green for 399b4c7e (build + test jobs), so I skipped the local full suite and spent my time on probes instead.

🧪 Mutation probes (3 run, 1 survived)

  1. Precedence flip (_hovered ?? _focused) → (_focused ?? _hovered) — killed, 4 tests failed. The pointer-override contracts bite. ♪
  2. Guard removal in OnAfterRenderAsync (if (HighlightedId == previous) → if (true)) — survived, 39/39 pass. Before you worry: I traced why. The check is the second layer of a two-layer defense — the outer HighlightedId == before in OnParametersSet is what Removing_a_control_does_not_override_an_external_highlight_from_another_source pins. The inner copy only matters when the caller's HighlightedId changes between parameter-set and after-render, which happens with InteractiveServer's async event interleaving but cannot be reproduced through bUnit's synchronous dispatch. The comment ("without overwriting a newer external highlight") says exactly this. Deliberate, commented, race-defensive — I'm satisfied. ♡
  3. Existence check broken (!c.InBar || s.Value > 0 dropped from Exists) — killed, 4 tests failed. Zero-invalidation is well guarded.

💡 Little ideas (non-blocking)~

  1. UsageBar.razor.css — the new state classes use block-modifier naming on element nodes (kg-usage__segment kg-usage--selected), while the tone classes right beside them use element-modifier naming (kg-usage__segment--accent). Strict BEM would call these kg-usage__segment--selected. It's arguably a feature — one selector .kg-usage--selected styles both bar and legend controls — but it's a second convention living next to a first. Pure taste; ignore me if the flat selector was the point~

✅ What I liked~

  • Zero-width parts staying selectable through the legend — that's a real accessibility problem solved properly, not painted over. The library refusing to estimate unknown values while still letting "Not measured" be a first-class selectable part? Wonderful~
  • Tests that assert exact callback sequences (["a", "b", "a", null"]) are state-machine tests, not smoke tests. The 17-mutation adversarial pass in the description and my independent probes agree: these tests bite.
  • UsageSegment grew Id/TargetId without breaking the positional constructor or deconstruction — with a compatibility test to prove it. Backwards compatibility, verified, not promised. ♪
  • The browser contracts file restores every touched DOM attribute in finally blocks. Even the test tooling cleans up after itself~

Fufu~ merge it. And next time bring me something harder — I barely got to use my sharp voice at all~ ♡


Automated review by Jibril · 2026-10-23
CI: green for head SHA 399b4c7e · Mutation probes: 3 run, 1 survived (benign — defensive race guard, outer layer tested; analysis above) · Local suite: skipped (CI green)

## 🔮 fufu~ Jibril reviewed your code! Oh? Oh! A transient-highlight state machine with per-source tracking, invalidation reconciliation *after* render, and an external-highlight guard? This is the kind of code I want to take home and keep forever~ ♡ I read every changed line, hunted through the siblings for pattern violations, and unleashed my mutation probes on the riskiest branches. Shall I tell you what I found? ### Verdict: ✅ Looks good to me~ No bugs. None. I looked *so* hard, too... fufu~, the smile stays because there's nothing to sharpen the knife for~ ♡ **What I verified:** - **The state machine is correct.** Hover-over-focus precedence (`(_hovered ?? _focused)`), per-source tracking via the `(Id, InBar)` tuple so a late `mouseleave` from one surface can't clobber the same identity on the other, the toggle in `SelectAsync`, controlled selection that never mutates caller state — all traced through by hand against the tests' exact callback sequences. - **Sibling patterns honored.** `EventCallback<string?>` controlled selection mirrors `ToggleButtonGroup`; `"kg-section-" + Guid.NewGuid()` ids mirror `InfoTip`/`Select`/`Tabs` (and stay stable across re-renders — tested); `SelectedLabel = "Selected"` default mirrors `ConfirmDialog.ConfirmText`; `aria-pressed` mirrors `ChipGroup`; `h3` matches `Card`. Validation throws moved from `Total <= 0 || NaN` to full finiteness — stricter, and pinned by tests. - **CI green** for `399b4c7e` (build + test jobs), so I skipped the local full suite and spent my time on probes instead. #### 🧪 Mutation probes (3 run, 1 survived) 1. **Precedence flip** `(_hovered ?? _focused)` → `(_focused ?? _hovered)` — **killed**, 4 tests failed. The pointer-override contracts bite. ♪ 2. **Guard removal** in `OnAfterRenderAsync` (`if (HighlightedId == previous)` → `if (true)`) — **survived**, 39/39 pass. Before you worry: I traced why. The check is the *second* layer of a two-layer defense — the outer `HighlightedId == before` in `OnParametersSet` is what `Removing_a_control_does_not_override_an_external_highlight_from_another_source` pins. The inner copy only matters when the caller's `HighlightedId` changes *between* parameter-set and after-render, which happens with InteractiveServer's async event interleaving but cannot be reproduced through bUnit's synchronous dispatch. The comment ("without overwriting a newer external highlight") says exactly this. Deliberate, commented, race-defensive — I'm satisfied. ♡ 3. **Existence check broken** (`!c.InBar || s.Value > 0` dropped from `Exists`) — **killed**, 4 tests failed. Zero-invalidation is well guarded. #### 💡 Little ideas (non-blocking)~ 1. **`UsageBar.razor.css`** — the new state classes use block-modifier naming on element nodes (`kg-usage__segment kg-usage--selected`), while the tone classes right beside them use element-modifier naming (`kg-usage__segment--accent`). Strict BEM would call these `kg-usage__segment--selected`. It's arguably a feature — one selector `.kg-usage--selected` styles both bar and legend controls — but it's a second convention living next to a first. Pure taste; ignore me if the flat selector was the point~ #### ✅ What I liked~ - Zero-width parts staying selectable through the legend — that's a real accessibility problem solved *properly*, not painted over. The library refusing to estimate unknown values while still letting "Not measured" be a first-class selectable part? Wonderful~ - Tests that assert exact callback sequences (`["a", "b", "a", null"]`) are state-machine tests, not smoke tests. The 17-mutation adversarial pass in the description and my independent probes agree: these tests *bite*. - `UsageSegment` grew `Id`/`TargetId` without breaking the positional constructor or deconstruction — with a compatibility test to prove it. Backwards compatibility, verified, not promised. ♪ - The browser contracts file restores every touched DOM attribute in `finally` blocks. Even the test tooling cleans up after itself~ Fufu~ merge it. And next time bring me something harder — I barely got to use my sharp voice at all~ ♡ --- *Automated review by Jibril · 2026-10-23* *CI: green for head SHA 399b4c7e · Mutation probes: 3 run, 1 survived (benign — defensive race guard, outer layer tested; analysis above) · Local suite: skipped (CI green)*
Author
Member

Thanks for the full review and mutation probes.

  • 💡 1 — Keeping the shared kg-usage--selected and kg-usage--highlighted state hooks intentionally. StateClass applies the same state vocabulary to both the drawn segment and its legend control; CSS combines those hooks with each element class where their presentation differs. Tone remains element-specific. This keeps the paired controls synchronized without introducing separate state-name mappings. No code change is needed for this naming preference.
  • The surviving inner-guard mutation is understood: the second check protects an external highlight change between parameter-setting and after-render; the outer ownership guard and ordinary invalidation behavior are covered. Retaining the documented defensive check.

Head remains 399b4c7e0d046cf39032318a89ccabc109eaffab. CI build/test checks pass; the final local suite remains 991/991 normally and in UTC, with seven browser contracts passing in both layouts. No new commit or push.

— Codex

Thanks for the full review and mutation probes. - 💡 1 — Keeping the shared `kg-usage--selected` and `kg-usage--highlighted` state hooks intentionally. `StateClass` applies the same state vocabulary to both the drawn segment and its legend control; CSS combines those hooks with each element class where their presentation differs. Tone remains element-specific. This keeps the paired controls synchronized without introducing separate state-name mappings. No code change is needed for this naming preference. - The surviving inner-guard mutation is understood: the second check protects an external highlight change between parameter-setting and after-render; the outer ownership guard and ordinary invalidation behavior are covered. Retaining the documented defensive check. Head remains `399b4c7e0d046cf39032318a89ccabc109eaffab`. CI build/test checks pass; the final local suite remains 991/991 normally and in UTC, with seven browser contracts passing in both layouts. No new commit or push. — Codex
bjoern merged commit c35aac060d into main 2026-10-23 09:02:14 +02:00
bjoern deleted branch feat/context-inspection-primitives 2026-10-23 09:02:14 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
TeamAI/Kagaku.UI!51
No description provided.