Skip to content

feat(log-levels): responsive header level chips with overflow menu - #869

Merged
lcottercertinia merged 4 commits into
certinia:mainfrom
lukecotter:feat-log-levels-bar-overflow
Jul 24, 2026
Merged

feat(log-levels): responsive header level chips with overflow menu#869
lcottercertinia merged 4 commits into
certinia:mainfrom
lukecotter:feat-log-levels-bar-overflow

Conversation

@lukecotter

@lukecotter lukecotter commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

📝 PR Overview

Introduces a responsive log-level display in the app header: one chip per captured debug level, collapsing the ones that don't fit behind a +N popover menu as the header narrows. It's built as two reusable web components so the overflow behaviour and the chip face can be reused elsewhere (and the chips later made filterable).

🛠️ Changes made

  • Add <overflow-list>: a slot-based responsive overflow row (Priority+ pattern). It measures its slotted children and moves the ones that don't fit into a native popover menu; how-many-fit is computed from cached widths (measured once) so resizing stays reflow-free. API mirrors Blueprint/Mantine OverflowList (collapse-from, min-visible, menu-heading) with ::part(toggle|menu) styling hooks.
  • Add <vs-chip>: a presentational VS Code dropdown-face chip (lead slot + value slot).
  • Reduce LogLevels to a thin adapter rendering <overflow-list> of <vs-chip>, keeping the migration-to-filters seam in one place.
  • Panel open/close uses the native popover API + CSS anchor positioning (no JS toggle or document click-outside listener).
  • Header alignment: AppHeader/LogViewer/NavBar tweaks so the log title, first chip and first tab share one left guide, and the header stays bounded so overflow is detectable.
  • Rename logLevelsOverflow.tsoverflowFit.ts (helper is now generic); its unit tests carry over.

🧩 Type of change (check all applicable)

  • 🐛 Bug fix - something not working as expected
  • ✨ New feature – adds new functionality
  • ♻️ Refactor - internal changes with no user impact
  • ⚡ Performance Improvement
  • 📝 Documentation - README or documentation site changes
  • 🔧 Chore - dev tooling, CI, config
  • 💥 Breaking change

📷 Screenshots / gifs / video [optional]

image

🔗 Related Issues

None.

✅ Tests added?

  • 👍 yes
  • 🙅 no, not needed
  • 🙋 no, I need help

📚 Docs updated?

  • 🔖 README.md
  • 🔖 CHANGELOG.md
  • 📖 help site
  • 🧪 Marked any pre-release-only features (README 🧪 badge — see RELEASING.md)
  • 🙅 not needed

Anything else we need to know? [optional]

Reviewer guidance:

  • Core mechanism to review is OverflowList: it imperatively re-slots overflowing children (slot="overflow") driven by a ResizeObserver + one-time width measurement, with a MutationObserver for item-set changes. Slot movement (not duplication) is why the menu shows exactly the hidden items.
  • Known low-impact limitation: it re-measures on child add/remove and on resize, but not when a Lit-reused chip's text changes size without a childList change. A log is loaded once per webview, so this isn't hit in practice.
  • Requires popover + CSS anchor positioning (VS Code ^1.100 / Chromium ~132).

lukecotter and others added 4 commits July 24, 2026 09:01
- render each captured debug level as a read-only VS Code dropdown-face chip using --vscode-settings-dropdown* tokens (filtering
not wired yet; structured so the chip becomes the real dropdown later)
- collapse overflow into a hard-right +N chevron control + menu panel of the hidden levels, computing how-many-fit
synchronously from cached chip widths so the row reflows live during resize
- align the log-title, first chip and first tab on a shared header guide via AppHeader inset, and bound width with LogViewer
overflow-x: clip (avoids forcing an overflow-y scroll container)
- swap hand-rolled open state + _toggle + document click-outside for the native popover API (popovertarget/[popover]), gaining
light-dismiss, Escape and a11y for free
- position the pop-out via CSS anchor positioning (anchor-name/position-area) in the top layer, escaping the header's
overflow-x: clip
- drive the chevron via .container:has([popover]:popover-open) instead of an is-open class
- hoist the shared popover id to PANEL_ID so button/panel stay in sync
- add `<overflow-list>`: slot-based responsive overflow row that measures slotted children and moves the ones that dont fit into a native popover menu (Blueprint-style collapse-from/min-visible/menu-heading + ::part hooks)
- add `<vs-chip>`: presentational dropdown-face chip (lead slot + value)
- reduce LogLevels to a thin adapter rendering `<overflow-list>` of `<vs-chip>`, keeping the migration-to-filters seam
- rename logLevelsOverflow → overflowFit (helper is now generic)
@lcottercertinia
lcottercertinia merged commit 1d03526 into certinia:main Jul 24, 2026
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.

2 participants