Conversation
When the card chooser's baseFilter already constrains the card type
(e.g. a linksTo field), the Type picker is redundant — the type is
pinned and the user can't change it. Wrap <TypePicker> in
{{#unless @typeFilter.skipTypeFiltering}} so it doesn't render in
that situation.
Picker (boxel-ui) polish driven by the ticket's component-level notes:
- Accept @searchEnabled (default true); hide the search input section
when the picker is disabled or @searchEnabled is false.
- Trigger gets an is-disabled visual state (not-allowed cursor + muted
colour) when the picker is disabled.
- Replace the opacity:0.7 hover hack on selected-item remove buttons
with a --boxel-200 background hover.
Closes CS-11322
Contributor
Preview deploymentsHost Test Results 1 files ± 0 1 suites ±0 1h 38m 1s ⏱️ +57s Results for commit 1337cf7. ± Comparison against earlier commit 0d00675c. Realm Server Test Results 1 files ±0 1 suites ±0 11m 11s ⏱️ +48s Results for commit 1337cf7. ± Comparison against earlier commit 0d00675c. |
The keydown handler that owns ArrowUp/Down, Enter, Escape, and Tab
navigation was bound to the search input. When @searchEnabled is false
the input does not render, so without an input there was no listener
and the dropdown could not be navigated by keyboard.
Move the handler to the .picker-before-options wrapper (tabindex=-1)
so keydown events bubble from either the search input or, when search
is hidden, a small focus-target div that the autoFocus modifier
focuses on open. The existing keyboard-nav tests keep passing because
events still bubble from the input; a new test exercises ArrowDown
with @searchEnabled={{false}}.
Drop the now-redundant select.disabled branch in showSearch — EPS
never mounts before-options when the picker is disabled.
Drop the .picker-selected-item__remove:hover override so the
ContextButton highlight variant's own hover takes effect, matching
the design system rather than overriding it.
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.
Background and Goal
CS-11322 — when the card chooser's
baseFilteralready constrains card type (e.g. alinksTofield), the Type picker in the search bar is redundant: the type is pinned and the user can't change it. This PR hides the picker entirely in that situation, and polishes the underlying boxel-uiPickerso disabled state is reflected in the trigger, the search input, and selected-item remove buttons via the component API (no opacity hacks).Where to start
packages/host/app/components/card-search/search-bar.gts—<TypePicker>wrapped in{{#unless @typeFilter.skipTypeFiltering}}. That's the user-visible behavior change.packages/boxel-ui/addon/src/components/picker/index.gts+before-options-with-search.gts— new@searchEnabledarg (defaulttrue) and ashowSearchgetter that hides the search input section when the picker is disabled or@searchEnabledis false.packages/boxel-ui/addon/src/components/picker/trigger-labeled.gts—is-disabledmodifier on the trigger (not-allowed cursor + muted colour) when disabled.packages/boxel-ui/addon/src/components/picker/selected-item.gts— replaced the:hover { opacity: 0.7 }hack on the remove button with a--boxel-200background hover.Key decisions and non-obvious mechanics
typeFilter.skipTypeFiltering, which is true iffgetTypeSummaries.hasNonRootBaseFilter— i.e. thebaseFilterpins a non-root type. AI assistant card-catalog (CardDefroot baseFilter) → still shows the picker. Pet linksTo (non-root) → hides it.displayRemoveButtonalready returnedfalsewhen the picker was disabled. The remove-button test in this PR pins that behavior; the visible changes are the trigger and search-input states the ticket called out.