-
Notifications
You must be signed in to change notification settings - Fork 5
add monitoring dashboard #120
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
…uired list view Resolves HappyHackingSpace#107 Changes: - Updated GraphQL queries to fetch author avatarUrl and label colors - Modified ActionItem interface to include labels array and author object with login and avatarUrl - Enhanced Action Required page to display: * Author avatars in a new column * Labels as colored badges (showing up to 3 with overflow indicator) * Last updated timestamp in human-readable format (e.g., "2h ago", "3d ago") - Updated table layout to accommodate new columns while maintaining readability - Fixed useQuickWins hook to properly map author and labels data - Updated kanban store to use new author structure and populate labels from action items - Added formatTimeAgo utility function for relative timestamp display This improves information density and provides better context when scanning the list.
…NcB9kaPmRiN2pDJLy4Xiuu Add labels, author avatars, and last updated timestamps to Action Req…
Review requests now receive elevated 'urgent' priority compared to standard @mentions. This prevents critical code review requests from being missed or deprioritized alongside routine notifications. Changes: - Modified calculateActionPriority to accept mentionType parameter - Review requests automatically assigned 'urgent' priority - Regular mentions continue to use label/age-based priority calculation Fixes HappyHackingSpace#108
…-017tZajnqa8B97DjDPESyTXp Claude/add monitoring dashboard
WalkthroughThis PR restructures the ActionItem data model across the codebase, changing author representation from a string to an object with login and avatarUrl, adding a labels array with optional color support, and introducing timestamp tracking. The GraphQL client, stores, UI components, and data mapping hooks are updated to propagate these changes consistently. Priority calculation now accepts an optional mentionType parameter for enhanced urgency assessment. Changes
Sequence DiagramsequenceDiagram
participant GQL as GitHub GraphQL
participant Client as github-graphql-client
participant Store as actionItems Store
participant Hook as useQuickWins
participant UI as action-required UI
GQL->>Client: Response with author.avatarUrl,<br/>labels[].color
rect rgb(200, 220, 240)
Note over Client: Transform data shape
Client->>Client: author: {login, avatarUrl}<br/>labels: [{name, color}]
end
Client->>Store: Update ActionItem type
Client->>Hook: Propagate to mappers
rect rgb(220, 240, 200)
Note over Hook: Map to UI-ready format
Hook->>Store: Pass author object,<br/>colored labels
end
Store->>UI: Provide structured data
rect rgb(240, 220, 200)
Note over UI: Render new layout
UI->>UI: Display avatar<br/>Render color badges<br/>Show relative time
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related issues
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 1
🧹 Nitpick comments (2)
src/app/action-required/page.tsx (1)
35-51: Local ActionItem type and time-ago helper match the new data modelThe page-level
ActionIteminterface (author object, labels array,updatedAt) lines up with the updated store/GraphQL shapes, which keeps the typing story consistent across layers.
formatTimeAgois straightforward and appropriate for the “Action Required” context.If you want to harden it further, you could clamp negative
diffInSecondsto0so future-dated items (clock skew, etc.) don’t display a negative month count, but that’s an optional polish.Also applies to: 56-67
src/lib/api/github-graphql-client.ts (1)
786-821: mentionType-aware priority logic looks correct; consider reusing it in KanbanThe updated
mapToActionItem/calculateActionPrioritychain does what the PR describes:
- Labels are normalized to
{ name, color? }[], andlabelNamesare passed intocalculateActionPriority.calculateActionPrioritynow treatsmentionType === "review_request"as immediatelyurgent, regardless of labels or age.- Non-review-request items still follow label- and age-based rules (
critical/urgent/p0→ urgent;high/p1/bug→ high; older items escalated bydaysOld).This gives review requests a guaranteed “urgent” priority in the core action-items data.
One thing to consider for consistency:
src/stores/kanban.tsstill assigns priorities for synced GitHub tasks using a localisReviewRequest ? "high" : "medium"rule, ignoring theprioritycomputed here. If you want review requests to show as “urgent” in Kanban as well, it would be cleaner to pass throughitem.priorityfrom the action-items store rather than recomputing a separate scheme there.Also applies to: 823-855
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
src/app/action-required/page.tsx(7 hunks)src/components/quick-wins/hooks/useQuickWins.ts(2 hunks)src/lib/api/github-graphql-client.ts(13 hunks)src/stores/actionItems.ts(1 hunks)src/stores/kanban.ts(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/app/action-required/page.tsx (3)
src/components/ui/table.tsx (2)
TableHead(112-112)TableCell(114-114)src/components/ui/avatar.tsx (3)
Avatar(53-53)AvatarImage(53-53)AvatarFallback(53-53)src/components/ui/badge.tsx (1)
Badge(46-46)
🔇 Additional comments (5)
src/stores/kanban.ts (1)
338-351: ActionItem → KanbanTask mapping now aligned with new author/labels shapeThe updated
descriptionandlabelsmapping correctly adapt the richerActionItemshape:
descriptionnow showsrepoandauthor.loginwhen present.labelsmapsitem.labelsobjects down to astring[], matchingKanbanTask.labels.This keeps Kanban tasks consistent with the new store model without introducing extra coupling.
src/components/quick-wins/hooks/useQuickWins.ts (1)
49-54: QuickWins mappings correctly project into the new ActionItem shapeThe
goodIssues/easyFixesmappings now:
- Wrap
issue.authorinto{ login, avatarUrl }.- Convert
issue.labelsto{ name, color }objects.This matches the updated
ActionItemcontract and keeps Quick Wins data consistent with what the action-items store and Action Required UI expect.Also applies to: 75-80
src/app/action-required/page.tsx (1)
165-201: Table layout, skeleton, avatar/labels, and updated-time rendering are coherent
- The loading skeleton’s header and row placeholders now mirror the live table columns (Title/Repo, Author, Labels, Priority, Activity, Updated, Actions), which avoids jarring layout shifts.
- The Author column uses
AvatarImage/AvatarFallbackwithitem.author.avatarUrlanditem.author.login.substring(0, 2), matching the new author shape.- The Labels column renders up to three colored badges from
item.labelsand a compact+Noverflow badge, correctly using the GitHub hex color (no#) and enhancing scan-ability.- The Updated column’s
formatTimeAgo(item.updatedAt)leverages the new timestamp field exactly as intended.Overall this wiring looks correct and consistent with the rest of the PR.
Also applies to: 249-256, 286-322, 346-348
src/lib/api/github-graphql-client.ts (2)
61-79: Author/avatar and label/color propagation is consistent end-to-endAcross the types and queries:
GitHubActionItem,ActionItem, andPullRequestnow all exposeauthor: { login; avatarUrl }andlabels: { name; color? }[].- GraphQL selections for assigned issues/PRs, stale PRs, mentions, and review requests all fetch
author.avatarUrlandlabels.nodes { name, color }, matching whatmapIssueToGitHubIssueandmapToActionItemexpect.- Quick Wins and the action-items store consume these shapes consistently.
This keeps the data model coherent from GraphQL → client types → stores → UI.
Also applies to: 102-118, 125-144, 233-285, 318-370, 490-701
399-428: QuickWins issue mapping correctly feeds richer labels and author into GitHubIssue
mapIssueToGitHubIssuenow:
- Projects
issue.labels.nodesinto{ name, color }[].- Sets
authorto{ login, avatar_url }, with safe fallbacks when GitHub’sauthoris null.- Computes priority via
this.calculatePriority(labels.map((l) => l.name), issue.comments.totalCount)based on label names + comment count.This aligns with the QuickWins hook’s expectations and keeps the priority logic localized to this helper.
| author: { | ||
| login: string; | ||
| avatarUrl: string; | ||
| }; | ||
| labels: Array<{ name: string; color?: string }>; | ||
| daysOld: number; |
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.
🧩 Analysis chain
Persisted ActionItem shape is not migrated (risk of crashes for existing users)
You’ve upgraded ActionItem to:
author: { login: string; avatarUrl: string }labels: Array<{ name: string; color?: string }>(required)
but the store still persists assignedItems / mentionItems / staleItems under the same "githubmon-action-items" key with no rehydrate migration. Existing installations may have cached items where:
authoris still a plain string.labelsis missing or in an older shape.
The new UI (e.g., item.author.login.substring(...), label rendering) assumes the new structure and can throw at runtime on first render before refreshData overwrites stale entries.
Consider one of:
- Bump the storage key name to force a fresh cache.
- Add an
onRehydrateStorage(or equivalent) to normalize old entries into the new{ author, labels }shape. - Make
authorandlabelsbackward‑compatible unions and normalize them lazily on read.
I’d treat this as important to fix before shipping since it affects existing users’ first render after upgrade.
I need to verify the persistence configuration and interface changes. Let me investigate the codebase.
🏁 Script executed:
#!/bin/bash
# Check the ActionItem interface definition and persist configuration
cat src/stores/actionItems.tsLength of output: 12141
🏁 Script executed:
#!/bin/bash
# Search for onRehydrateStorage usage in the store
rg -n "onRehydrateStorage" src/stores/actionItems.tsLength of output: 0
🏁 Script executed:
#!/bin/bash
# Search for persist key name
rg -n "githubmon-action-items" src/Length of output: 67
🏁 Script executed:
#!/bin/bash
# Find UI files consuming author.login to verify the assumption
rg -nC3 "author\.login|item\.author" src/pages/ src/components/Length of output: 2334
Let me verify if there's any defensive coding or migration logic elsewhere:
🏁 Script executed:
#!/bin/bash
# Search for defensive checks around author access (optional chaining, type guards)
rg -nC2 "author\?" src/components/ src/lib/Length of output: 2288
🏁 Script executed:
#!/bin/bash
# Search for migration logic or store initialization
rg -n "migrate|rehydrate|onRehydrate" src/stores/ src/lib/Length of output: 777
🏁 Script executed:
#!/bin/bash
# Check if other stores have migration patterns
grep -r "onRehydrateStorage" src/stores/Length of output: 65
🏁 Script executed:
#!/bin/bash
# Search for any shape normalization or type coercion on author/labels
rg -nC3 "typeof.*author|Array.isArray.*labels" src/Length of output: 0
ActionItem persistence schema mismatch confirmed—no migration for breaking changes
Verified: The store persists assignedItems, mentionItems, and staleItems to "githubmon-action-items" with:
authorchanged from string to required{ login: string; avatarUrl: string }labelsnow required asArray<{ name: string; color?: string }>
No onRehydrateStorage or migration present in the persist config. The UI (e.g., author.login.charAt(0) in columns.tsx) directly accesses the new structure without defensive checks.
Existing installations have cached items where author is still a string or labels is missing. On first render after upgrade (before refreshData completes), components will crash trying to call .charAt() on a string or undefined.
Fix before shipping—existing users are at risk. Your suggested mitigations (storage key bump, onRehydrateStorage migration, or backward-compatible unions) are sound; the codebase already uses onRehydrateStorage in kanban.ts and migration patterns in auth.ts, so precedent exists.
🤖 Prompt for AI Agents
In src/stores/actionItems.ts around lines 16 to 21, persisted action items
changed shape (author was string, now object with login/avatarUrl; labels became
required array) but no migration exists; add an onRehydrateStorage migration (or
bump the storage key) to convert legacy entries: when rehydrating, detect author
as string and replace with { login: oldString, avatarUrl: '' } (or derive avatar
if available), ensure labels is at least an empty array and normalize any label
strings into { name: string, color?: string }, and keep daysOld numeric;
implement these transforms before the store is used so components calling
author.login.charAt(0) or iterating labels cannot crash. Ensure the migration is
idempotent and preserves existing new-shape records.
Review requests now receive elevated 'urgent' priority compared to
standard @mentions. This prevents critical code review requests from
being missed or deprioritized alongside routine notifications.
Changes:
Summary by CodeRabbit