Repository navigation
Fix routing #954
Description
Routing continues to be a nightmare in the gh-pages feature deployment. A very through anaylisis of the routing worfklow is needed. So a comprehesinve unifed approach can be enforced across all pages such as:
landing page
https://litlfred.github.io/sgex/ (also handle index.html)
https://litlfred.github.io/sgex/docs
https://litlfred.github.io/sgex/404.html
feature branch or main deployment such as:
https://litlfred.github.io/sgex/copilot-fix-549/ (also handle index.html)
https://litlfred.github.io/sgex/copilot-fix-915/docs
https://litlfred.github.io/sgex/copilot-fix-915/dashboard/litlfred/smart-ips-pilgrimage
etc.
there is no 404 for feature/main branch deployments. There is one 404 page. It should be deployed from the main branch and covers all 404 routing. behaviour is:
- It needs to handle cyclic redirects.
- if URL looks like is a feature/main deployment (so not /docs or /index.html or / or /404.html) and it is not already coming from a redirect from the landing page url for that deployment, then first try to redirect to the deployment landing page
when entering in a URL directly (and not viewing browsing the UI of the SPA) the site does not load the page as expected, rather it goes to the welcome page. when opening a direct link, the url should be processed to set all session storage variables (e.g. :profile, :repo, etc.). these should also be preserved in the URL itself. all of the url fragments, anchors #, and query params ? should be preserved in the URL when processing a directly entered URL to determine the page to display.
no branch names or page names should be hardcoded. everything should be handled dynamically and be optimistic in assuming branches / pages are deployed.
please describe a comprehsinve solution of how to make the routing work reliably. descirbe any change migration needed.
DO NOT IMPLEMENT. I want to review proposal before implementation.
Activity
litlfred commentedon Oct 15, 2025
There was another reported issue:
#1112
which has begun to be addressed here #1113. I will close that PR as this PR should fix that issue as well.
This issue was closed before and was fixed by
#955
but somehow some of the behavior has reverted. Perhaps related to #1087
Additionnaly, something in the routing/page/asset logic handling has messed up direct URL edits. The user can no longer open a "virtual" page (e.g. a shared link via email) of the SPA nor edit the URL in the browser and successfully load the desired page.
@ritikarawlani I will assign to copilot