Skip to content

feat(list, select, tree, tree-select): unify Ctrl/Cmd+A select-all across (#DS-3102)#1690

Open
lskramarov wants to merge 3 commits into
mainfrom
feat/DS-3102
Open

feat(list, select, tree, tree-select): unify Ctrl/Cmd+A select-all across (#DS-3102)#1690
lskramarov wants to merge 3 commits into
mainfrom
feat/DS-3102

Conversation

@lskramarov

Copy link
Copy Markdown
Contributor

No description provided.

@lskramarov lskramarov requested review from NikGurev and artembelik July 2, 2026 14:48
@lskramarov lskramarov self-assigned this Jul 2, 2026
@lskramarov lskramarov added the enhancement New feature or request label Jul 2, 2026
@artembelik artembelik requested a review from Copilot July 2, 2026 14:51
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit f515957):

https://koobiq-next--prs-1690-91ljdm76.web.app

(expires Tue, 07 Jul 2026 16:36:07 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: c9e37e518febda70d0317d07e8ceb35ac43c534c

}

/** Event emitted by the `onSelectAll` outputs when the select-all toggle runs. */
export class KbqSelectAllEvent<T> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

возможно будет полезно указать source

Suggested change
export class KbqSelectAllEvent<T> {
export class KbqSelectAllEvent<T = unknown, S = unknown> {

private _noUnselectLast: boolean = true;

/** When `true`, a repeated Ctrl/Cmd+A deselects all options. Off by default (Ctrl+A only selects). */
@Input({ transform: booleanAttribute }) selectAllToggle: boolean = false;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

почему не сигнал?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR standardizes the Ctrl/Cmd+A “select all” keyboard behavior across list, select, tree-selection, and tree-select by centralizing the toggling logic in core utilities and aligning component APIs/events around it.

Changes:

  • Added shared core utilities for select-all behavior: toggleSelectAll, shouldSelectSearchText, plus KbqSelectAllEvent/adapter types.
  • Introduced selectAllToggle input to opt into “second press deselects all” (default is “select-only” to match the unified behavior).
  • Updated select/tree-select to emit a new onSelectAll output event and to prioritize selecting search input text when appropriate; expanded unit test coverage accordingly.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tools/public_api_guard/components/tree.api.md Updates TreeSelection public API (select-all handler/toggle + signature change).
tools/public_api_guard/components/tree-select.api.md Updates TreeSelect public API (selectAllToggle + onSelectAll + handler).
tools/public_api_guard/components/select.api.md Updates Select public API (selectAllToggle + onSelectAll).
tools/public_api_guard/components/list.api.md Updates ListSelection public API (selectAllToggle + handler).
tools/public_api_guard/components/core.api.md Exposes new core select-all utilities + types in public API snapshot.
packages/components/core/selection/select-all.ts Introduces shared select-all logic + event/type helpers.
packages/components/core/selection/select-all.spec.ts Adds unit tests for the new core select-all helpers.
packages/components/core/selection/index.ts Re-exports the new core select-all utilities.
packages/components/select/select.component.ts Switches Ctrl/Cmd+A handling to shared logic; adds onSelectAll + search-text selection behavior.
packages/components/select/select.component.spec.ts Adds tests for Cmd+A (macOS), search input behavior, and selectAllToggle default behavior.
packages/components/tree-select/tree-select.component.ts Aligns Ctrl/Cmd+A handling with search-input selection + emits onSelectAll.
packages/components/tree-select/tree-select.component.spec.ts Adds coverage for Ctrl+A behavior when search is focused and for selectAllToggle default behavior.
packages/components/tree/tree-selection.component.ts Uses shared toggle logic; adds selectAllToggle + selectAllHandler input; changes selectAllOptions signature.
packages/components/tree/tree-selection.component.spec.ts Adds coverage for selectAllToggle default and custom handler invocation.
packages/components/list/list-selection.component.ts Uses shared toggle logic; adds selectAllToggle + selectAllHandler input.
packages/components/list/list-selection.component.spec.ts Adds coverage for selectAllToggle default behavior + custom handler behavior + form value update.
packages/docs-examples/components/select/select-search/select-search-example.ts Updates docs example to showcase selectAllToggle usage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/components/tree/tree-selection.component.ts Outdated
Comment thread packages/components/select/select.component.ts Outdated
Comment on lines +567 to +570
const options = tree.renderedOptions.filter((option) => !option.disabled && option.selectable());
const selected = options.some((option) => tree.selectionModel.isSelected(option.data));

select.onSelectAll.emit(new KbqSelectAllEvent(select, options, selected));
@artembelik

Copy link
Copy Markdown
Contributor

@rmnturov в стандартном поведении os ctrl+a при "выделено всё" ничего не делает, в данной реализации выделение снимается, это ок?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants