feat(field): add grouping support for data page sourced options in autocomplete - #578
Merged
Merged
Conversation
| // Present only when at least one secondary column resolves to a non-empty value (research.md §4a/§4b) | ||
| secondaryComponents?: any[]; | ||
| secondarySearchText?: string; | ||
| // Present only when a group-by field is configured for this (datapage-sourced) field (data-model.md) |
Collaborator
There was a problem hiding this comment.
delete speckit reference (data-model.md)
| group?: string; | ||
| } | ||
|
|
||
| // Internal, render-time-only view-model — never part of the PConnect contract (data-model.md) |
Collaborator
There was a problem hiding this comment.
delete speckit reference (data-model.md)
| columns: any[] = []; | ||
| parameters: {}; | ||
| filteredOptions: Observable<AutoCompleteOption[]>; | ||
| // Grouped view of filteredOptions, only rendered when hasGroupBy is true (research.md §4) |
Collaborator
There was a problem hiding this comment.
delete speckit reference (research.md §4)
| this.fieldControl.setValue(this.value$); | ||
| } | ||
|
|
||
| // Matches only primary text and secondary search text — group value is never used for search (FR-007) |
Collaborator
There was a problem hiding this comment.
delete speckit reference (FR-007)
| return this.options$?.filter(option => option.value?.toLowerCase().includes(filterVal) || option.secondarySearchText?.includes(filterVal)); | ||
| } | ||
|
|
||
| // Buckets the already-sorted option list into contiguous groups by exact group value (research.md §7) |
Collaborator
There was a problem hiding this comment.
delete speckit reference (research.md §7)
| } | ||
|
|
||
| // Secondary text is out of scope for associated/local list options (FR-012) | ||
| // Secondary text and grouping are both out of scope for associated/local list options (FR-012/FR-013) |
Collaborator
There was a problem hiding this comment.
delete speckit reference (FR-012/FR-013)
| // Read from raw metadata, not resolved config, because config.value must stay an unresolved | ||
| // property reference (e.g. "@P .propName") for use as a column value (research.md §1). | ||
| // Reads unresolved groupsFields metadata to derive group-by column descriptor(s); not a | ||
| // display/search column, so grouping stays independent of primary/secondary text (FR-001/FR-007) |
Collaborator
There was a problem hiding this comment.
delete speckit reference (FR-001/FR-007)
| this.setOptions(optionsData); | ||
| } | ||
|
|
||
| // Null/undefined/whitespace-only source values normalize to '' — the shared blank group (FR-011) |
Collaborator
There was a problem hiding this comment.
delete speckit reference (FR-011)
| return stringValue.trim() ? stringValue : ''; | ||
| } | ||
|
|
||
| // Ascending, case-sensitive, stable sort so same-group options keep their original relative order (FR-005/FR-012) |
Collaborator
There was a problem hiding this comment.
delete speckit reference (FR-005/FR-012)
tumms2021389
approved these changes
Sep 22, 2026
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.
ENHANCEMENT-14802: Autocomplete supports grouping
Adds optional grouping to
AutoCompleteComponentfor datapage-sourced options, driven bypConn$.getRawMetadata().config.groupsFieldsmetadata. Groups are sorted case-sensitively and rendered via Angular Material's nativemat-optgroup, reusing its built-in non-selectable headers and keyboard-navigation skipping. Behavior, props, and DOM output remain byte-for-byte unchanged when no group-by field is configured or for associated/local-list sourced options.