Skip to content

Comments

Fix PCP auth redirect and restore dynamic menu/header loading#252

Merged
unclehowell merged 3 commits intogh-pagesfrom
codex/fix-stylesheet-and-menu-loading-issues
Feb 21, 2026
Merged

Fix PCP auth redirect and restore dynamic menu/header loading#252
unclehowell merged 3 commits intogh-pagesfrom
codex/fix-stylesheet-and-menu-loading-issues

Conversation

@unclehowell
Copy link
Owner

Motivation

  • The PCP dashboard was redirecting to /login.html outside the app path which caused a broken post-load navigation and disappearance of header styles and menu content.
  • The left navigation failed to populate because the dynamic menu/header loaders were fragile when served from different route contexts and when responses lacked JSON content-type.

Description

  • Update static/pcp/index.html to redirect unauthenticated users to /static/pcp/login.html and keep auth navigation within the PCP app path.
  • Update static/pcp/login.html to redirect authenticated users back to /static/pcp/index.html for both the already-authenticated and successful-login flows.
  • Replace static/pcp/js/menu-loader.js with a robust loader that tries relative and absolute PCP paths, parses response text (not relying on content-type), preserves icons, marks nested items with data-lte-toggle="treeview", and dispatches a menuLoaded event after rendering.
  • Replace static/pcp/js/header-loader.js with the same resilient JSON-fallback approach and stable header rendering.

Testing

  • Static syntax check for the updated JS loaders passed (node -e evaluated both loader files successfully).
  • Local HTTP server served the site for validation (python3 -m http.server --directory ...) and behaved as expected.
  • Playwright browser validation confirmed that unauthenticated visits to /static/pcp/index.html redirect to /static/pcp/login.html and authenticated visits stay on the dashboard and populate the sidebar (the automated script detected 33 menu items); screenshots were captured showing the restored dashboard state.

Codex Task

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 21, 2026

Deploying carfinance with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1dc2154
Status: ✅  Deploy successful!
Preview URL: https://c6208e5f.carfinance.pages.dev
Branch Preview URL: https://codex-fix-stylesheet-and-men.carfinance.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 21, 2026

Deploying dcc with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1dc2154
Status: ✅  Deploy successful!
Preview URL: https://9dc605b2.dcc-cwd.pages.dev
Branch Preview URL: https://codex-fix-stylesheet-and-men.dcc-cwd.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 21, 2026

Deploying ccan-homepage with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1dc2154
Status: ✅  Deploy successful!
Preview URL: https://1685597e.ccan-homepage.pages.dev
Branch Preview URL: https://codex-fix-stylesheet-and-men.ccan-homepage.pages.dev

View logs

@unclehowell unclehowell merged commit 5235297 into gh-pages Feb 21, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant