-
Notifications
You must be signed in to change notification settings - Fork 0
feat(dashboard): replace unplayable machines with newest/recently fix… #868
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
Conversation
…ed games - Remove "Unplayable Machines" section (cluttered, low value) - Add "Newest Games" row showing 3 most recently added machines - Add "Recently Fixed Games" row showing machines that went from major/unplayable issues to none, ordered by when last fixed - Reorder layout: Quick Stats → Newest → Fixed → Assigned to Me → Recent Issues - Update Issues Assigned to Me to use full-width grid layout Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Pull request overview
This PR improves the dashboard by replacing the low-value "Unplayable Machines" section with two more useful features: "Newest Games" (showing the 3 most recently added machines) and "Recently Fixed Games" (showing machines that have been repaired from major/unplayable issues). The sections have been reordered for better information hierarchy, and the "Issues Assigned to Me" section now uses a full-width grid layout for improved readability.
Changes:
- Replaced "Unplayable Machines" query with "Newest Machines" (3 most recent) and "Recently Fixed Machines" queries
- Added complex SQL logic to identify machines that had major/unplayable issues but are now fully operational
- Reordered dashboard sections: Quick Stats → Newest Games → Recently Fixed Games → Assigned to Me → Recent Issues
- Updated "Issues Assigned to Me" to use full-width (
lg:col-span-3) with 2-column grid layout instead of single column
src/app/(app)/dashboard/page.tsx
Outdated
| <Card className="border-green-500/30 bg-green-500/10 hover:border-green-500 transition-all cursor-pointer h-full"> | ||
| <CardHeader> | ||
| <div className="flex items-start justify-between gap-2"> | ||
| <div className="flex-1"> | ||
| <CardTitle className="text-base text-green-400 mb-1"> | ||
| {machine.name} | ||
| </CardTitle> | ||
| <p className="text-xs text-green-400/80"> | ||
| Fixed{" "} | ||
| {new Date(machine.fixedAt).toLocaleDateString()} | ||
| </p> | ||
| </div> | ||
| <CheckCircle2 className="size-5 text-green-400" /> |
Copilot
AI
Jan 28, 2026
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.
The "Recently Fixed Games" section uses hardcoded green colors (green-500/30, green-500/10, green-500, green-400, green-400/80) instead of semantic color tokens defined in globals.css. According to the UI Guide's "No-Cruft" rule (docs/UI_GUIDE.md line 25), hardcoded colors should be avoided.
The codebase defines semantic success tokens in globals.css that should be used instead:
- Use
border-success/30instead ofborder-green-500/30 - Use
bg-success/10instead ofbg-green-500/10 - Use
hover:border-successinstead ofhover:border-green-500 - Use
text-successinstead oftext-green-400 - Use
text-success/80instead oftext-green-400/80
This ensures consistency with the Material Design 3 color system and makes the theme easier to maintain. Note that a glow-success utility is not currently defined in globals.css, but following the pattern of existing glow utilities (glow-primary, glow-secondary, glow-destructive, glow-warning), one should be added if the glow effect is desired for this section.
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.
@copilot open a new pull request to apply changes based on this feedback
|
@timothyfroehlich I've opened a new pull request, #869, to work on those changes. Once the pull request is ready, I'll request review from you. |
…ard (#869) * Initial plan * fix(dashboard): replace hardcoded green colors with semantic success tokens Co-authored-by: timothyfroehlich <5819722+timothyfroehlich@users.noreply.github.com> * feat(dashboard): add glow-success effect to Recently Fixed Games cards Co-authored-by: timothyfroehlich <5819722+timothyfroehlich@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: timothyfroehlich <5819722+timothyfroehlich@users.noreply.github.com>
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.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| const recentlyFixedMachinesPromise = db | ||
| .select({ | ||
| id: machines.id, | ||
| name: machines.name, | ||
| initials: machines.initials, | ||
| unplayableIssuesCount: sql<number>`count(*)::int`, | ||
| fixedAt: sql<Date>`max(${issues.updatedAt})`.as("fixed_at"), | ||
| }) | ||
| .from(machines) | ||
| .innerJoin(issues, eq(issues.machineInitials, machines.initials)) | ||
| .where( | ||
| and( | ||
| eq(issues.severity, "unplayable"), | ||
| notInArray(issues.status, [...CLOSED_STATUSES]) | ||
| // Issue was major or unplayable | ||
| inArray(issues.severity, ["major", "unplayable"]), | ||
| // Issue is now closed | ||
| inArray(issues.status, [...CLOSED_STATUSES]), | ||
| // Machine has NO open major/unplayable issues currently | ||
| not( | ||
| exists( | ||
| db | ||
| .select({ one: sql`1` }) | ||
| .from(issues) | ||
| .where( | ||
| and( | ||
| eq(issues.machineInitials, machines.initials), | ||
| inArray(issues.severity, ["major", "unplayable"]), | ||
| notInArray(issues.status, [...CLOSED_STATUSES]) | ||
| ) | ||
| ) | ||
| ) | ||
| ) | ||
| ) | ||
| ) | ||
| .groupBy(machines.id, machines.name, machines.initials); | ||
| .groupBy(machines.id, machines.name, machines.initials) | ||
| .orderBy(sql`max(${issues.updatedAt}) DESC`) | ||
| .limit(3); |
Copilot
AI
Jan 28, 2026
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.
The integration test file includes a test for "Unplayable Machines Query" (line 166-243) which tests functionality that has been removed in this PR. This test should either be removed or updated to test the new "Recently Fixed Games" query instead, as the old unplayable machines query no longer exists in the dashboard.
| // Query 4: Newest machines (3 most recently added) | ||
| const newestMachinesPromise = db.query.machines.findMany({ | ||
| orderBy: desc(machines.createdAt), | ||
| limit: 3, | ||
| columns: { | ||
| id: true, | ||
| name: true, | ||
| initials: true, | ||
| createdAt: true, | ||
| }, | ||
| }); |
Copilot
AI
Jan 28, 2026
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.
The "Newest Games" section lacks integration test coverage. Consider adding a test similar to the other dashboard queries to verify that it correctly returns the 3 most recently added machines ordered by createdAt.
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
…tions Replace "Unplayable Machines" section checks with new sections: - Newest Games: verifies heading and machines list or empty state - Recently Fixed Games: verifies heading and fixed machines list or empty state Fixes E2E test failures after dashboard refactor in 45baccd. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…tly fixed Addresses Copilot review feedback: - Remove obsolete "Unplayable Machines Query" test - Add "Newest Machines Query" test (verifies 3 most recent by createdAt) - Add "Recently Fixed Machines Query" test (verifies complex SQL logic for machines that had major/unplayable issues but are now fully operational) Tests follow dashboard query patterns and include edge cases. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| await db.insert(issues).values( | ||
| createTestIssue(machine4.initials, { | ||
| issueNumber: 1, | ||
| severity: "playable", |
Copilot
AI
Jan 28, 2026
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.
Invalid severity value "playable" used in test. The valid severity values are "cosmetic", "minor", "major", and "unplayable" as defined in the database schema (src/server/db/schema.ts:145). This test will fail because the database will reject this invalid enum value. Change "playable" to a valid severity value such as "minor" or "cosmetic".
| severity: "playable", | |
| severity: "minor", |
| const [machine1, machine2, machine3] = await db | ||
| // Create 5 machines with staggered creation times | ||
| const now = Date.now(); | ||
| const machinesData = await db |
Copilot
AI
Jan 28, 2026
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.
Unused variable machinesData.
| const machinesData = await db | |
| await db |
…ed games