Skip to content

feat: issue and workitems makeover#215

Merged
Flo0806 merged 2 commits intomainfrom
feat/issue-workitems-makeover
Mar 8, 2026
Merged

feat: issue and workitems makeover#215
Flo0806 merged 2 commits intomainfrom
feat/issue-workitems-makeover

Conversation

@Flo0806
Copy link
Contributor

@Flo0806 Flo0806 commented Mar 8, 2026

Summary

  • Make over for WorkItems and issue page

Related issue(s)

Closes #214

Type of change

  • Bug fix
  • Feature
  • Refactor
  • Docs
  • CI

Checklist

  • Tests added/updated
  • i18n keys added/updated (if needed)
  • No breaking changes

Summary by CodeRabbit

Release Notes

  • New Features

    • Added Work Items section aggregating issues and pull requests with open/closed state filtering and pagination.
    • Enhanced Issues page with loading indicators, error handling with retry options, and dynamic filtering.
    • Updated repository view with work items information and improved button styling.
  • Removed Features

    • Removed dedicated Pull Requests page.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 8, 2026

📝 Walkthrough

Walkthrough

This 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

Cohort / File(s) Summary
Repository Pages Refactor
app/pages/repos/[owner]/[repo]/index.vue, app/pages/repos/[owner]/[repo]/issues/index.vue, app/pages/repos/[owner]/[repo]/pulls/index.vue, app/pages/repos/[owner]/[repo]/work-items/index.vue
Removed Pull Requests page entirely. Refactored Issues and Work Items pages to use store-driven state with pagination, loading skeletons, error alerts, and filter tabs. Added work items hint to main repo index. Replaced component-based filtering with centralized state management and derived counts.
Store Layer
app/stores/workItems.ts
Introduced new Pinia store for work items with pagination, state filtering ('open'/'closed'), repository selection, error handling, and automatic sorting by updatedAt. Exposes paginated data with computed counts and loading states.
API Layer
server/api/work-items/index.get.ts
New paginated API endpoint aggregating GitHub issues and PRs into unified work items with cross-linking logic, GraphQL batch enrichment for review decisions and CI status, in-file caching (120s), and comprehensive error handling.
Internationalization
i18n/locales/de.json, i18n/locales/en.json, i18n/schema.json
Removed pulls section and issues.all key. Added workItemsHint and work item state labels ('open', 'closed', 'noResults'). Removed workItems.filter.all nested structure.

Sequence Diagram

sequenceDiagram
    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
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • PR #152: Both introduce/modify paginated-section pagination abstraction and update repository-scoped stores that leverage pagination logic.
  • PR #193: Both modify the work-items feature surface including API endpoints, pages, and work-item detail fields that integrate with the work-items functionality.
  • PR #206: Both modify work-items feature routing, reference rendering, and sidebar/work-item UI with overlapping navigation changes.

Suggested reviewers

  • Gonzo17

🐰 Work items hop with pagination grace,
Store-driven state takes filtering's place,
Pulls vanish, issues find their space,
One unified flow, a elegant trace,
A makeover with GitHub's embrace! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: issue and workitems makeover' is concise and directly describes the main changes, which involve UI updates to both the issues and work items pages.
Description check ✅ Passed The description matches the template with Summary, Related issue(s), Type of change, and Checklist sections. All critical sections are present and populated appropriately.
Linked Issues check ✅ Passed The pull request successfully implements all objectives from issue #214: work items page rewrite with pagination and store [#214], new paginated API endpoint with caching [#214], consistent UX with issues page [#214], and i18n cleanup [#214].
Out of Scope Changes check ✅ Passed All changes are scope-aligned with the objectives: work items page refactor, issues page updates, API endpoint implementation, i18n updates, and removal of pulls page. No extraneous changes detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/issue-workitems-makeover

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 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/types are 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 by updatedAt.

The server endpoint at server/api/work-items/index.get.ts (line 210) already sorts items by updatedAt descending 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/types are 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

📥 Commits

Reviewing files that changed from the base of the PR and between 4b3d01e and d68d2aa.

📒 Files selected for processing (9)
  • app/pages/repos/[owner]/[repo]/index.vue
  • app/pages/repos/[owner]/[repo]/issues/index.vue
  • app/pages/repos/[owner]/[repo]/pulls/index.vue
  • app/pages/repos/[owner]/[repo]/work-items/index.vue
  • app/stores/workItems.ts
  • i18n/locales/de.json
  • i18n/locales/en.json
  • i18n/schema.json
  • server/api/work-items/index.get.ts
💤 Files with no reviewable changes (1)
  • app/pages/repos/[owner]/[repo]/pulls/index.vue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Makeover: Issue and Work Item pages

1 participant