The Date range select on Matches and Activity never shows its current value, including the default "All time".
match-history-query.ts:28 parses days as a number, and MatchHistory.svelte:179 passes it as value={filters.days}, while the options use string values ("0", "7", ...).
activity.ts:108 does the same for Activity, and ActivityLog.svelte:244 passes value={filters.days ?? 0}.
Svelte compares a select's value with each option strictly, so 7 never matches "7" and no option is selected. On the Matches page selectedIndex is -1.
The same components back the server page's Matches and History tabs (servers/[name]/+page.svelte:828,835), Maintenance (maintenance/+page.svelte:415) and their phone filter sheets.
Screenshots
Before:
After (mockup):
Fix
Pass String(filters.days) to the Matches select and String(filters.days ?? 0) to the Activity select
Add a test that the Date range select shows the current filter
The Date range select on Matches and Activity never shows its current value, including the default "All time".
- `match-history-query.ts:28` parses `days` as a number, and `MatchHistory.svelte:179` passes it as `value={filters.days}`, while the options use string values (`"0"`, `"7"`, ...).
- `activity.ts:108` does the same for Activity, and `ActivityLog.svelte:244` passes `value={filters.days ?? 0}`.
- Svelte compares a select's value with each option strictly, so `7` never matches `"7"` and no option is selected. On the Matches page `selectedIndex` is -1.
The same components back the server page's Matches and History tabs (`servers/[name]/+page.svelte:828,835`), Maintenance (`maintenance/+page.svelte:415`) and their phone filter sheets.
**Screenshots**
Before:

After (mockup):

**Fix**
- [x] Pass `String(filters.days)` to the Matches select and `String(filters.days ?? 0)` to the Activity select
- [x] Add a test that the Date range select shows the current filter
Reviewed 61d4c25ce6. Both Date range selects now show the current filter, and each has a test, so I'm closing this.
Checklist
Pass string values to the selects.MatchHistory.svelte:179 passes String(filters.days) and ActivityLog.svelte:244 passes String(filters.days ?? 0).
Test that the select shows the current filter.ui-match-history.test.ts:44 and ui-activity.test.ts:56 render each range, including the default with no parameter. They check that the desktop and phone selects each have exactly one selected option and that it's the right one.
Review notes
Good extra catch: the extra option for a custom range, such as 14 days, also uses a string value now (ActivityLog.svelte:251), and the Activity test covers it.
I checked it in the synthetic preview after hydration. /matches shows "All time" and ?matchDays=30 shows "Last 30 days". /activity shows "All retained history", and ?days=7 and ?days=14 show their ranges. Choosing "Last 90 days" on Matches updates the URL and stays selected. The server page's Matches and History tabs and Maintenance use the same two components.
No other select has the same mismatch. The Per page select uses numbers for both its value and its options (ActivityLog.svelte:383-386), and the Players filters use string keys.
The 2 affected test files pass locally (28 tests), and CI run 844 on the current HEAD is green.
Reviewed 61d4c25ce6ae63a8a8a91decb45e425e0a641012. Both Date range selects now show the current filter, and each has a test, so I'm closing this.
**Checklist**
- [x] **Pass string values to the selects.** `MatchHistory.svelte:179` passes `String(filters.days)` and `ActivityLog.svelte:244` passes `String(filters.days ?? 0)`.
- [x] **Test that the select shows the current filter.** `ui-match-history.test.ts:44` and `ui-activity.test.ts:56` render each range, including the default with no parameter. They check that the desktop and phone selects each have exactly one selected option and that it's the right one.
**Review notes**
- Good extra catch: the extra option for a custom range, such as 14 days, also uses a string value now (`ActivityLog.svelte:251`), and the Activity test covers it.
- I checked it in the synthetic preview after hydration. `/matches` shows "All time" and `?matchDays=30` shows "Last 30 days". `/activity` shows "All retained history", and `?days=7` and `?days=14` show their ranges. Choosing "Last 90 days" on Matches updates the URL and stays selected. The server page's Matches and History tabs and Maintenance use the same two components.
- No other select has the same mismatch. The Per page select uses numbers for both its value and its options (`ActivityLog.svelte:383-386`), and the Players filters use string keys.
- The 2 affected test files pass locally (28 tests), and CI [run 844](https://gitea.thewrightserver.net/josh/electric-cherry/actions/runs/844) on the current HEAD is green.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
The Date range select on Matches and Activity never shows its current value, including the default "All time".
match-history-query.ts:28parsesdaysas a number, andMatchHistory.svelte:179passes it asvalue={filters.days}, while the options use string values ("0","7", ...).activity.ts:108does the same for Activity, andActivityLog.svelte:244passesvalue={filters.days ?? 0}.7never matches"7"and no option is selected. On the Matches pageselectedIndexis -1.The same components back the server page's Matches and History tabs (
servers/[name]/+page.svelte:828,835), Maintenance (maintenance/+page.svelte:415) and their phone filter sheets.Screenshots
Before:

After (mockup):

Fix
String(filters.days)to the Matches select andString(filters.days ?? 0)to the Activity selectReviewed
61d4c25ce6. Both Date range selects now show the current filter, and each has a test, so I'm closing this.Checklist
MatchHistory.svelte:179passesString(filters.days)andActivityLog.svelte:244passesString(filters.days ?? 0).ui-match-history.test.ts:44andui-activity.test.ts:56render each range, including the default with no parameter. They check that the desktop and phone selects each have exactly one selected option and that it's the right one.Review notes
ActivityLog.svelte:251), and the Activity test covers it./matchesshows "All time" and?matchDays=30shows "Last 30 days"./activityshows "All retained history", and?days=7and?days=14show their ranges. Choosing "Last 90 days" on Matches updates the URL and stays selected. The server page's Matches and History tabs and Maintenance use the same two components.ActivityLog.svelte:383-386), and the Players filters use string keys.