Conversation
📝 WalkthroughWalkthroughThis PR implements a comprehensive makeover of the Work Items page with a new paginated API endpoint, Pinia store for state management, consistent UX patterns with the Issues page (skeleton loading, error handling, pagination), removes the dedicated Pull Requests page, and updates internationalization keys accordingly. Changes
Sequence DiagramsequenceDiagram
actor User
participant Vue as Work Items Page
participant Store as workItems Store
participant API as /api/work-items
participant GitHub as GitHub API
participant Cache as Local Cache
User->>Vue: Navigate to /work-items
Vue->>Store: initRepo(owner, repo)
Store->>Cache: Check cached data (age < 120s)
alt Cache hit
Cache-->>Store: Return cached work items
else Cache miss
Store->>API: GET /api/work-items?repo=owner/repo&state=open
API->>GitHub: Fetch issues (state=open)
API->>GitHub: Fetch PRs (state=open)
API->>API: Cross-link issues ↔ PRs
API->>GitHub: GraphQL batch fetch insights<br/>(reviewDecision, CI status)
GitHub-->>API: Enriched data
API->>Cache: Store aggregated items
API-->>Store: Return paginated WorkItem[]
end
Store-->>Vue: Update sortedWorkItems + counts
Vue->>User: Render items with filter tabs & pagination
User->>Vue: Click "Closed" filter
Vue->>Store: setFilter('closed')
Store->>API: GET /api/work-items?repo=owner/repo&state=closed
API-->>Store: Return filtered items
Store-->>Vue: Update UI
Vue->>User: Display closed items
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (4)
app/pages/repos/[owner]/[repo]/work-items/index.vue (2)
1-3: Explicit type import is unnecessary.Same as the store — types from
shared/typesare auto-imported per project conventions.🧹 Suggested cleanup
<script lang="ts" setup> -import type { WorkItem } from '~~/shared/types/work-item' - definePageMeta({Based on learnings: "In the flumen.dev Nuxt project, all pure TypeScript types exported from ROOT/shared/types are globally auto-imported across components, composables, and stores."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/pages/repos/`[owner]/[repo]/work-items/index.vue around lines 1 - 3, Remove the explicit type import for WorkItem from the top of the <script lang="ts" setup> block — the WorkItem type is globally auto-imported from shared/types per project convention; delete the line "import type { WorkItem } from '~~/shared/types/work-item'" (and any other explicit imports of pure types) so the component relies on the global type import instead.
40-80: Consider extracting shared helpers to a composable.The comment notes these helpers are "same as RepoWorkItemList". This duplication could be extracted to a shared composable (e.g.,
useWorkItemHelpers) to maintain consistency and reduce maintenance burden.This is a good candidate for future cleanup but acceptable for this PR given the scope of changes.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/pages/repos/`[owner]/[repo]/work-items/index.vue around lines 40 - 80, Extract the duplicated helpers into a shared composable (e.g., create useWorkItemHelpers) by moving STATE_COLOR, stateBadgeColor, stateBadgeLabel, prStatusLabel, and ciIcon into that module, export functions with the WorkItem type, and import/use the composable from this file and RepoWorkItemList; ensure the composable depends on getCIIcon and your i18n t function (inject or accept t as a parameter) so callers pass required dependencies and types remain consistent.app/stores/workItems.ts (2)
25-29: Redundant sorting — API already sorts byupdatedAt.The server endpoint at
server/api/work-items/index.get.ts(line 210) already sorts items byupdatedAtdescending before returning. This client-side re-sort is unnecessary overhead.🧹 Suggested simplification
- const sortedWorkItems = computed(() => { - return [...section.data.value].sort( - (a, b) => new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime(), - ) - }) + const sortedWorkItems = computed(() => section.data.value)Alternatively, if you want to preserve the sorting as a defensive measure against future API changes, this can remain as-is.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/stores/workItems.ts` around lines 25 - 29, Remove the redundant client-side resorting in the computed property sortedWorkItems: instead of creating a new array and sorting by new Date(...).getTime(), return section.data.value directly (or rename/remove sortedWorkItems and use section.data.value where consumed). Update any callers expecting sortedWorkItems to use section.data.value so you don’t duplicate server-side sorting logic in the computed property (symbols to touch: sortedWorkItems, computed, section.data.value).
1-2: Explicit type import is unnecessary.Per project conventions, types from
shared/typesare auto-imported. This import can be removed.🧹 Suggested cleanup
-import type { WorkItem } from '~~/shared/types/work-item' - export const useWorkItemStore = defineStore('workItems', () => {Based on learnings: "In the flumen.dev Nuxt project, all pure TypeScript types exported from ROOT/shared/types are globally auto-imported across components, composables, and stores."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/stores/workItems.ts` around lines 1 - 2, Remove the unnecessary explicit type import "WorkItem" at the top of app/stores/workItems.ts; delete the import line "import type { WorkItem } from '~~/shared/types/work-item'" and rely on the project's global auto-imported types, leaving any usages of the WorkItem type in functions or store definitions (e.g., in the workItems store) unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@app/pages/repos/`[owner]/[repo]/work-items/index.vue:
- Around line 1-3: Remove the explicit type import for WorkItem from the top of
the <script lang="ts" setup> block — the WorkItem type is globally auto-imported
from shared/types per project convention; delete the line "import type {
WorkItem } from '~~/shared/types/work-item'" (and any other explicit imports of
pure types) so the component relies on the global type import instead.
- Around line 40-80: Extract the duplicated helpers into a shared composable
(e.g., create useWorkItemHelpers) by moving STATE_COLOR, stateBadgeColor,
stateBadgeLabel, prStatusLabel, and ciIcon into that module, export functions
with the WorkItem type, and import/use the composable from this file and
RepoWorkItemList; ensure the composable depends on getCIIcon and your i18n t
function (inject or accept t as a parameter) so callers pass required
dependencies and types remain consistent.
In `@app/stores/workItems.ts`:
- Around line 25-29: Remove the redundant client-side resorting in the computed
property sortedWorkItems: instead of creating a new array and sorting by new
Date(...).getTime(), return section.data.value directly (or rename/remove
sortedWorkItems and use section.data.value where consumed). Update any callers
expecting sortedWorkItems to use section.data.value so you don’t duplicate
server-side sorting logic in the computed property (symbols to touch:
sortedWorkItems, computed, section.data.value).
- Around line 1-2: Remove the unnecessary explicit type import "WorkItem" at the
top of app/stores/workItems.ts; delete the import line "import type { WorkItem }
from '~~/shared/types/work-item'" and rely on the project's global auto-imported
types, leaving any usages of the WorkItem type in functions or store definitions
(e.g., in the workItems store) unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: bf9a3a44-4594-44a8-93e6-a4cb2f620827
📒 Files selected for processing (9)
app/pages/repos/[owner]/[repo]/index.vueapp/pages/repos/[owner]/[repo]/issues/index.vueapp/pages/repos/[owner]/[repo]/pulls/index.vueapp/pages/repos/[owner]/[repo]/work-items/index.vueapp/stores/workItems.tsi18n/locales/de.jsoni18n/locales/en.jsoni18n/schema.jsonserver/api/work-items/index.get.ts
💤 Files with no reviewable changes (1)
- app/pages/repos/[owner]/[repo]/pulls/index.vue
Summary
Related issue(s)
Closes #214
Type of change
Checklist
Summary by CodeRabbit
Release Notes
New Features
Removed Features