-
Notifications
You must be signed in to change notification settings - Fork 31
Speed review improvements #2207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
26c70f5
0ba9240
a9184d5
1b2549d
e042cb4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -349,7 +349,19 @@ | |
| case 'E': | ||
| handleRateRef.current('strong-yes'); | ||
| break; | ||
| case ' ': { | ||
| e.preventDefault(); | ||
| const details = Array.from(document.querySelectorAll('details')); | ||
| const openIndex = details.findIndex((d) => d.open); | ||
| details.forEach((d) => { d.open = false; }); | ||
|
Check failure on line 356 in apps/speed-review/src/pages/index.tsx
|
||
| const nextIndex = openIndex === -1 ? 0 : openIndex + 1; | ||
| if (nextIndex < details.length) { | ||
| details[nextIndex]!.open = true; | ||
| details[nextIndex]!.scrollIntoView({ behavior: 'smooth', block: 'nearest' }); | ||
|
Comment on lines
+352
to
+363
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
A more robust approach would be to scope the query to the card container using a ref or a specific data attribute on the card's wrapper // In the JSX, add a data attribute:
// <div data-app-details-container ...>
// In the keyboard handler:
const container = document.querySelector('[data-app-details-container]');
const details = Array.from(container?.querySelectorAll('details') ?? []);
Comment on lines
+352
to
+363
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The spacebar cycling behaviour (open first section β cycle to next β close all β wrap around) is non-trivial logic. Consider adding a unit or integration test that verifies the cycle order, the wrap-around when reaching the last section, and that Rule Used: Consider adding tests for any new functionality in... (source) Learnt From |
||
| } | ||
| break; | ||
| } | ||
|
Comment on lines
+352
to
+363
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix ESLint brace-style violations causing CI failure. The pipeline is failing due to style violations flagged by ESLint:
The navigation logic itself is sound. π§ Proposed fix for ESLint violations case ' ': {
e.preventDefault();
const details = Array.from(document.querySelectorAll('details'));
const openIndex = details.findIndex((d) => d.open);
- details.forEach((d) => { d.open = false; });
+ details.forEach((d) => {
+ d.open = false;
+ });
const nextIndex = openIndex === -1 ? 0 : openIndex + 1;
if (nextIndex < details.length) {
details[nextIndex]!.open = true;
details[nextIndex]!.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
}
+
break;
}π§° Toolsπͺ GitHub Actions: ci_cd[error] 356-356: ESLint ( πͺ GitHub Check: ci[failure] 362-362: [failure] 356-356: [failure] 356-356: [failure] 356-356: π€ Prompt for AI Agents |
||
| case 'p': | ||
| case 'P': | ||
| dispatch({ type: 'TOGGLE_PAUSE' }); | ||
| break; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todayStart.setHours(0, 0, 0, 0)sets midnight in the server's local timezone, butnew Date(r.firstDiscussion)wherer.firstDiscussionis a date-only string like"2025-04-01"is parsed as UTC midnight per the ECMAScript spec.If the server runs in a timezone behind UTC (e.g., UTC-5),
todayStartis2025-04-01T05:00:00Zwhilenew Date('2025-04-01')is2025-04-01T00:00:00Z, sodiscussionDate >= todayStartevaluates tofalseβ meaning today's rounds would be excluded from the list.The old string comparison approach (
r.firstDiscussion >= todayon twoYYYY-MM-DDstrings) was actually correct and timezone-safe for pure calendar-date comparisons. The new approach only works correctly when the server is running in UTC.A consistent fix would be to stay in UTC throughout: