chore(ui): remove remaining series chart template casts

- Series progress chart:
  - replace the remaining `$any($event.target)` template casts with typed input and select handlers
  - keep the search, filter, and sort behavior unchanged while removing leftover template conversion debt
- Validation:
  - `just ui check`
  - `just ui typecheck`
  - `just ui test`
This commit is contained in:
James Cox
2026-04-22 17:26:51 -04:00
committed by Zach Yale
parent 43389c8dc4
commit 3fdb63f00d
2 changed files with 30 additions and 3 deletions
@@ -72,19 +72,19 @@
type="text" type="text"
[placeholder]="t('searchSeries')" [placeholder]="t('searchSeries')"
[value]="searchTerm" [value]="searchTerm"
(input)="onSearchChange($any($event.target).value)" (input)="onSearchInput($event)"
/> />
</div> </div>
<div class="filter-controls"> <div class="filter-controls">
<select class="filter-select" [value]="filterStatus" (change)="onFilterChange($any($event.target).value)"> <select class="filter-select" [value]="filterStatus" (change)="onFilterSelect($event)">
<option value="all">{{ t('allStatus') }}</option> <option value="all">{{ t('allStatus') }}</option>
<option value="in-progress">{{ t('inProgress') }}</option> <option value="in-progress">{{ t('inProgress') }}</option>
<option value="completed">{{ t('completed') }}</option> <option value="completed">{{ t('completed') }}</option>
<option value="not-started">{{ t('notStarted') }}</option> <option value="not-started">{{ t('notStarted') }}</option>
</select> </select>
<select class="sort-select" [value]="sortBy" (change)="onSortChange($any($event.target).value)"> <select class="sort-select" [value]="sortBy" (change)="onSortSelect($event)">
<option value="progress">{{ t('sortByProgress') }}</option> <option value="progress">{{ t('sortByProgress') }}</option>
<option value="rating">{{ t('sortByRating') }}</option> <option value="rating">{{ t('sortByRating') }}</option>
<option value="books">{{ t('sortByBooks') }}</option> <option value="books">{{ t('sortByBooks') }}</option>
@@ -177,6 +177,33 @@ export class SeriesProgressChartComponent {
public readonly chartData$: Observable<SeriesChartData> = this.chartDataSubject.asObservable(); public readonly chartData$: Observable<SeriesChartData> = this.chartDataSubject.asObservable();
onSearchInput(event: Event): void {
const target = event.target;
if (!(target instanceof HTMLInputElement)) {
return;
}
this.onSearchChange(target.value);
}
onFilterSelect(event: Event): void {
const target = event.target;
if (!(target instanceof HTMLSelectElement)) {
return;
}
this.onFilterChange(target.value as typeof this.filterStatus);
}
onSortSelect(event: Event): void {
const target = event.target;
if (!(target instanceof HTMLSelectElement)) {
return;
}
this.onSortChange(target.value as typeof this.sortBy);
}
onSearchChange(term: string): void { onSearchChange(term: string): void {
this.searchTerm = term.toLowerCase().trim(); this.searchTerm = term.toLowerCase().trim();
this.currentPage = 0; this.currentPage = 0;