Skip to content

fix(settings): extract items from projects menu API response - #416

Merged
PhenX merged 1 commit into
mainfrom
claude/auto-heal-settings-f5-error-qiuq6y
Aug 19, 2026
Merged

fix(settings): extract items from projects menu API response#416
PhenX merged 1 commit into
mainfrom
claude/auto-heal-settings-f5-error-qiuq6y

Conversation

@PhenX

@PhenX PhenX commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

What & why

The /api/projects/menu endpoint returns a response object with an items property containing the array of ProjectMenuItem[]. The previous code was treating the entire response as an array, which would cause type mismatches and runtime errors.

This change adds a transform function to the useFetch call to properly extract the items array from the response object, ensuring the data is correctly typed and structured for downstream usage.

How was it tested?

The change is a straightforward data transformation fix that aligns the fetch response handling with the actual API contract. Existing application logic that consumes projectsMenu will continue to work correctly with the properly extracted data.

Checklist

  • PR title follows Conventional Commits (type(scope): subject)
  • No tests needed — straightforward API response handling fix
  • No docs changes required — internal implementation detail

https://claude.ai/code/session_01V5sNCDkLeufETPxTePAKau

The auto-heal settings page typed GET /api/projects/menu as a bare
`ProjectMenuItem[]` and mapped over it directly. Both the real route and
the demo service-worker route return `{ items: ProjectMenuItem[] }`, so
`projectsMenu.value` was an object; `(projectsMenu.value ?? []).map(...)`
threw "(intermediate value).map is not a function", crashing the page on
a hard load (F5) where the throw happens during first render.

Unwrap the response with a `transform` and keep the array default,
matching the pattern already used by ProjectsMenu.vue, analytics.vue and
DesktopImportModal.vue.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V5sNCDkLeufETPxTePAKau
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report for Reporter (./packages/reporter)

Status Category Percentage Covered / Total
🔵 Lines 74.72% 2244 / 3003
🔵 Statements 73.01% 2552 / 3495
🔵 Functions 77.88% 391 / 502
🔵 Branches 67.26% 1802 / 2679
File CoverageNo changed files found.
Generated in workflow #1448 for commit 37f42b1 by the Vitest Coverage Report Action

@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report for Application (./apps/application)

Status Category Percentage Covered / Total
🔵 Lines 43.2% 5706 / 13206
🔵 Statements 42.43% 6640 / 15646
🔵 Functions 42.32% 1108 / 2618
🔵 Branches 38.78% 4972 / 12820
File CoverageNo changed files found.
Generated in workflow #1448 for commit 37f42b1 by the Vitest Coverage Report Action

@PhenX
PhenX merged commit 1c25d68 into main Aug 19, 2026
47 of 48 checks passed
@PhenX
PhenX deleted the claude/auto-heal-settings-f5-error-qiuq6y branch August 19, 2026 16:53
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.

2 participants