feat: label floats inside the overlay when space allows (#120)#122
Conversation
…ge (#120) The float-label draw branch ignored `active`, always painting white and bolding on `focused` alone. Since a hidden tab's floating layer can still render (`FloatSpec` is built per-tab regardless of which is on screen), this let an inactive tab's large/focused float label draw white and bold — the badge/close/chip/tiled-label treatment `active` already gates. Now the label follows the same rule: white + bold only when `active && focused`, muted toward the fill otherwise. Also de-duplicate the two local `triple` test closures added alongside the module-level helper in the previous commit.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
📝 WalkthroughWalkthroughChangesFloat label rendering
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant render
participant float_grid
participant float_overlay
participant paint_loop
render->>float_grid: check float ownership for covered cells
render->>float_overlay: place centered summarized title glyphs
render->>paint_loop: provide overlay glyph or continuation cells
paint_loop->>paint_loop: paint glyph styling above float fill
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adds size-gated pane-title labels to visible floating-pane overlays in the minimap renderer, reusing the existing tiled-label vocabulary and respecting the existing LabelMode degradation ladder—so large floats can be identified from the bar without cluttering small overlays.
Changes:
- Introduces a dedicated
float_overlayinminimap::render()to place centered, width-aware summarized titles inside sufficiently large visible float overlays. - Paints float labels as the topmost layer over the float’s own fill, with inactive-tab muting and bold only for
(active && focused)to match tiled label styling. - Updates the floating render example and adds regression tests covering gating, overlap ownership, inactive-tab styling, and wide-glyph width preservation.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/minimap.rs | Implements float-label placement + paint path (size-gated, LabelMode-gated, overlap-safe) and adds focused regression tests. |
| examples/render_floating.rs | Adjusts the demo float geometry and documentation so the example reliably shows one labeled and one unlabeled float. |
| docs/superpowers/specs/2026-07-16-float-labels-design.md | Adds the design spec describing gating, placement, styling, and overlap/ownership rules. |
| docs/superpowers/plans/2026-07-16-float-labels.md | Adds an implementation plan detailing steps, invariants, and verification checklist. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Closes #120.
Label a visible floating pane with its summarized title inside its overlay,
mirroring the tiled-pane label treatment — but only when the overlay box is big
enough to hold a legible label. Small floats stay color + ring only, exactly as
before.
In the demo above, the active tab (⌘2) overlays two floats: the focused
htopis tall enough to clear the size gate, so it shows its title white and bold
inside the overlay; the shorter
logsstays under the gate and rendersunlabeled — a side-by-side contrast between a labeled and an unlabeled float.
What changed
src/minimap.rs(render) — a dedicatedfloat_overlayreuses the tiledlabel vocabulary (
title::summarize+ display-width scan +OverlayCell) inits own index space, gated by:
LabelMode(the L0–L4 degradation ladder):Alllabelsevery fitting float,
Focusedonly the focused one,Nonenone;fw − 2 ≥ 4) andheight ≥ 6 px (3 text rows), the smallest box with a fully-interior row.
centered interior row, foreground
ACTIVE_FGon the active tab and recededvia
mixed(…, INACTIVE_LABEL_BLEND)on inactive tabs, bold only whenactive && focused— identical to the tiled-label styling.float_gridmeans only the topmostfloat's label shows where floats overlap; a wide/CJK glyph's
Continuationcells emit nothing, so the row width never breaks.
FLOAT_LABEL_MIN_INNER_WIDTH,FLOAT_LABEL_MIN_HEIGHT_PX.examples/render_floating.rs— the focusedhtopfloat is enlarged toclear the gate so the demo shows a labeled float next to an unlabeled one.
Testing
CARGO_BUILD_TARGET=aarch64-apple-darwin cargo test --lib→ 324 passed,including 8 new
f_*regression tests: large-float labeled, small-floatunlabeled, focused-bold, inactive-tab muting (never bold / never pure
white),
LabelModegating (Focused/None), wide-glyph row-widthpreservation, and overlap (only the topmost float labeled — verified
load-bearing against the ownership check).
cargo clippy --target wasm32-wasip1 --all-features --lib→ clean.cargo build --target wasm32-wasip1andcargo build --examples→ build.Notes
existing grant, so no feat(title): pane-title summarization module (icon table + width-aware truncation) #15 permission-freeze risk for existing users.
the label foreground follows the
activeflag like tiled labels; the spec docis corrected to match this shipped behavior.
Spec:
docs/superpowers/specs/2026-07-16-float-labels-design.md·Plan:
docs/superpowers/plans/2026-07-16-float-labels.mdSummary by CodeRabbit