Repository navigation
Conversation
… inactive tabs A host turns it on per panel with `DockContent::tab_close`; only closable panels get one. The active tab always shows its ×, an inactive tab while the pointer is over it, so an inactive tab closes without being activated first. The tab keeps the ×'s room either way and so keeps its width. `Hit::TabClose` names the button. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Caution Review failedThe pull request is closed. Walkthrough
Merge Risk:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Panel tabs in
craft_ui::dockinghad no close button; a tab closed only with a middle click or from its menu. This adds an opt-in × after a tab's label:DockContent::tab_close(panel)(defaultfalse): the host picks the panels whose tab has a ×. Only closable panels get one, so a locked layout shows none.Hit::TabClose(P)names the button for automation and tests.docs/ui-docking.mddescribes it.Motivation: EffectCraft's viewer tabs (Composition, Layer, Footage) close from their tab, as in After Effects. EffectCraft's own tab strip had this before it moved to
craft_ui::docking(storytold/effectcraft#2432); see storytold/effectcraft#822.Testing
tab_close_shows_on_the_active_tab_and_on_a_hovered_inactive_tab(group_tests.rs): the × shows on the active tab, on a hovered inactive tab only, never on a panel the host gives none; tabs keep their width; a click on an inactive tab's × closes only that panel; a locked layout shows none.cargo fmt --check,cargo clippy -p craft-ui --all-features --all-targets -- -D warningsandcargo test -p craft-ui --all-featurespass.🤖 Generated with Claude Code
Summary by CodeRabbit