Skip to content

hotfix: Round 3 — 4 production UI bugs#51

Merged
Weegy merged 1 commit intomainfrom
hotfix/admin-ui-bugs-r3
Mar 16, 2026
Merged

hotfix: Round 3 — 4 production UI bugs#51
Weegy merged 1 commit intomainfrom
hotfix/admin-ui-bugs-r3

Conversation

@Weegy
Copy link
Copy Markdown
Contributor

@Weegy Weegy commented Mar 16, 2026

Summary

Fixes 4 production UI bugs in the admin panel.

Bug 1: Spaces pages rendered MainLayout TWICE

  • Removed <MainLayout> wrapper from templates in Index.vue, Create.vue, Edit.vue
  • Added defineOptions({ layout: MainLayout }) to each Spaces page (proper Inertia pattern)
  • Removed duplicate Spaces nav entry in MainLayout.vue (kept 🏢, removed 🌐)

Bug 2: Media upload URL was 404

  • MediaUploadZone.vue: Fixed URL from /api/media/api/v1/media
  • Media/Index.vue: Fixed fetch URLs to use /api/v1/media prefix
  • Added X-Requested-With: XMLHttpRequest header to XHR upload

Bug 3: Knowledge Graph still 401

  • KnowledgeGraphViewer.vue: Changed credentials: same-origininclude
  • Added decodeURIComponent() to XSRF-TOKEN cookie extraction

Bug 4: Locale management redirected instead of staying on page

  • Locales.vue: Replaced all router.post/patch/delete with fetch() API calls
  • After successful API calls, uses router.reload({ only: ["locales"] }) to refresh data

Quality Gates

  • ✅ pint --test — 521 files pass
  • ✅ phpstan analyse — 28 pre-existing errors (0 new)
  • ✅ npm run build — builds successfully

Bug 1: Spaces pages double-rendered MainLayout
- Remove <MainLayout> wrapper from templates in Index/Create/Edit.vue
- Add defineOptions({ layout: MainLayout }) to each page
- Remove duplicate Spaces nav entry in MainLayout.vue (keep 🏢, remove 🌐)

Bug 2: Media upload URL was overcorrected to /api/media (404)
- Fix MediaUploadZone.vue: xhr.open to /api/v1/media
- Fix Media/Index.vue: fetch URLs to /api/v1/media and /api/v1/media/:id
- Add X-Requested-With header to XHR upload

Bug 3: Knowledge Graph still 401
- Fix KnowledgeGraphViewer.vue: credentials 'same-origin' -> 'include'
- Add decodeURIComponent() to XSRF token extraction

Bug 4: Locales page redirects instead of staying on page
- Replace ALL router.post/patch/delete with fetch() API calls
- Use router.reload({ only: ['locales'] }) after successful ops
- Add proper Sanctum auth headers (X-XSRF-TOKEN, X-Requested-With)
@Weegy Weegy merged commit 736857e into main Mar 16, 2026
2 of 3 checks passed
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.

1 participant