Skip to content

Commit 62e0d4f

Browse files
authored
refactor(multiple): Clean up aria TODO remnants (#33126)
* build(multiple): remove unused aria examples targets * refactor(multiple): remove obsoleted w/o for aria signallike computed.toString * docs(multiple): clean up obsoleted comments across aria * refactor(aria/listbox): remove defaulting of label using non-reactive textContent
1 parent e4abb46 commit 62e0d4f

7 files changed

Lines changed: 5 additions & 28 deletions

File tree

goldens/aria/listbox/index.api.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ class Option_2<V> {
4242
readonly id: _angular_core.InputSignal<string>;
4343
readonly label: _angular_core.InputSignal<string | undefined>;
4444
readonly _pattern: OptionPattern<V>;
45-
protected readonly searchTerm: _angular_core.Signal<string>;
4645
readonly selected: _angular_core.Signal<boolean | undefined>;
4746
readonly value: _angular_core.InputSignal<V>;
4847
// (undocumented)

src/aria/BUILD.bazel

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
load("@bazel_lib//lib:copy_to_directory.bzl", "copy_to_directory")
22
load("@npm//:defs.bzl", "npm_link_all_packages")
33
load("//src/aria:config.bzl", "ARIA_TARGETS")
4-
load("//tools:defaults.bzl", "ng_examples_db", "ng_package", "ts_project")
4+
load("//tools:defaults.bzl", "ng_package", "ts_project")
55

66
package(default_visibility = ["//visibility:public"])
77

@@ -16,25 +16,11 @@ ts_project(
1616
deps = ["//:node_modules/@angular/core"],
1717
)
1818

19-
ng_examples_db(
20-
name = "aria_example_database",
21-
srcs = glob(
22-
include = [
23-
"examples/**/*.md",
24-
],
25-
# TODO: Remove this once examples are created. It should never be empty at that point.
26-
allow_empty = True,
27-
),
28-
out = "resources/code-examples.db",
29-
path = "src/aria/examples",
30-
)
31-
3219
ng_package(
3320
name = "npm_package",
3421
package_name = "@angular/aria",
3522
srcs = [
3623
"package.json",
37-
"resources/code-examples.db",
3824
],
3925
nested_packages = select({
4026
"//:snapshot_adev_assets": [":adev_assets"],

src/aria/accordion/accordion-group.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ export class AccordionGroup {
116116
element: () => this.element,
117117
activeItem: signal(undefined),
118118
items: this._triggerPatterns,
119-
// TODO(ok7sai): Investigate whether an accordion should support horizontal mode.
120119
orientation: () => 'vertical',
121120
});
122121

src/aria/listbox/option.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,6 @@ export class Option<V> {
5656
/** A unique identifier for the option. */
5757
readonly id = input(inject(_IdGenerator).getId('ng-option-', true));
5858

59-
// TODO(wagnermaciel): See if we want to change how we handle this since textContent is not
60-
// reactive. See https://github.com/angular/components/pull/30495#discussion_r1961260216.
61-
/** The text used by the typeahead search. */
62-
protected readonly searchTerm = computed(() => this.label() ?? this.element.textContent);
63-
6459
/** The parent Listbox UIPattern. */
6560
private readonly _listboxPattern = computed(() => this._listbox._pattern);
6661

@@ -83,6 +78,6 @@ export class Option<V> {
8378
value: this.value,
8479
listbox: this._listboxPattern,
8580
element: () => this.element,
86-
searchTerm: () => this.searchTerm() ?? '',
81+
searchTerm: () => this.label() ?? '',
8782
});
8883
}

src/aria/menu/menu-item.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ export class MenuItem<V> {
6262
/** Whether the menu item is disabled. */
6363
readonly disabled = input<boolean>(false);
6464

65-
// TODO(wagnermaciel): Discuss whether all inputs should be models.
66-
6765
/** The search term associated with the menu item. */
6866
readonly searchTerm = model<string>('');
6967

src/aria/private/behaviors/signal-like/signal-like.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ export function convertGetterSetterToWritableSignalLike<T>(
4141

4242
export function computed<T>(computation: () => T): SignalLike<T> {
4343
const computed = createComputed(computation);
44-
// TODO: Remove the `toString` after https://github.com/angular/angular/pull/65948 is merged.
45-
computed.toString = () => `[Computed: ${computed()}]`;
4644
computed[SIGNAL].debugName = '';
4745
return computed;
4846
}

src/aria/private/behaviors/tree/tree.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,11 @@ export class Tree<T extends TreeItem<V, T>, V> {
260260
item ??= this.inputs.activeItem();
261261
if (!item) return;
262262

263+
// If the item has a parent, get all of the parent's children.
264+
// Otherwise, it is a root item, and get all other root items.
263265
const parent = item.parent?.();
264-
// TODO: This assumes that items without a parent are root items.
265266
const siblings = parent ? parent.children?.() : this.inputs.items().filter(i => !i.parent?.());
267+
266268
siblings?.forEach(s => this.expand(s));
267269
}
268270

0 commit comments

Comments
 (0)