Skip to content

feat(router): move opencatalogi off hash routing to clean path URLs - #1341

Merged
rubenvdlinde merged 1 commit into
developmentfrom
feat/opencatalogi-history-routing-v2
Sep 1, 2026
Merged

feat(router): move opencatalogi off hash routing to clean path URLs#1341
rubenvdlinde merged 1 commit into
developmentfrom
feat/opencatalogi-history-routing-v2

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Collaborator

Third app off # routing, after stackiq (softwarecatalog#899) and zaakafhandelapp (#609).

Two parts, and the second is the one that matters

  1. createWebHashHistorycreateWebHistory.

  2. routerBase(), derived from the URL actually being served. Nextcloud serves the app under both /apps/opencatalogi/... and /index.php/apps/opencatalogi/..., but generateUrl() returns only the form the instance is configured for. Arriving on the other leaves the path outside the router base, vue-router cannot resolve it, and the catch-all redirects to / — the visitor lands on the dashboard with no error, deep link silently swallowed.

    This app needed it most of the three: its own e2e suite uses both spellings — /index.php/apps/opencatalogi in _nav.ts and the visual spec, /apps/opencatalogi in docs-screenshots.spec.ts — so one or the other would have broken regardless of which base was hardcoded.

7 spec files built URLs as `${APP}/#/<route>` (and one as `${APP}/#${route}`); all now use real paths.

Verification

URL result
/apps/opencatalogi/catalogi Catalogs
/index.php/apps/opencatalogi/catalogi Catalogs
/index.php/apps/opencatalogi/themes Themes
reload on /index.php/.../themes 200, still Themes

No hash anywhere. eslint exits 0, prettier --check on the full glob (**/*.{js,ts,vue,css,scss}, tests included) is clean, webpack compiles.

⚠️ Branch note: this is -v2 because the original branch was reset to development by a parallel session working the same checkout, orphaning the commit. It was recovered intact via git push origin <sha>:refs/heads/<new-branch> and its content re-verified — the source carries 0 references to createWebHashHistory.

Third app in the move off `#` routing, after stackiq
(softwarecatalog#899) and zaakafhandelapp (#609).

Same two parts as those:

1. createWebHashHistory -> createWebHistory.

2. routerBase(), derived from the URL actually being served. Nextcloud
   serves the app under BOTH /apps/opencatalogi/... and
   /index.php/apps/opencatalogi/..., but generateUrl() returns only the
   form the instance is configured for. Arriving on the other leaves the
   path outside the router base, vue-router cannot resolve it, and the
   catch-all redirects to '/' -- the visitor lands on the dashboard with
   no error and the deep link is silently swallowed.

   This app matters more than most here: its own e2e suite uses BOTH
   spellings -- /index.php/apps/opencatalogi in _nav.ts and the visual
   spec, /apps/opencatalogi in docs-screenshots.spec.ts -- so either
   would have broken without routerBase().

7 spec files built URLs as `${APP}/#/<route>` (and one as
`${APP}/#${route}`); all now use real paths.

Verified: eslint exits 0, prettier --check on the FULL glob
(**/*.{js,ts,vue,css,scss}, tests included) is clean, webpack compiles.

⚠️ NOT yet verified in a browser. The shared dev container has been
cycling in and out of maintenance mode throughout, so every deep-link
probe returned 503. The pattern is proven on the two apps above
(stackiq 18/18, zaakafhandelapp 24/24 after re-running three
environment-flap failures), but this app's own deep links and reload
behaviour still need a run against a stable instance before merge.
@rubenvdlinde
rubenvdlinde merged commit 086c7eb into development Sep 1, 2026
3 checks passed
@rubenvdlinde
rubenvdlinde deleted the feat/opencatalogi-history-routing-v2 branch September 1, 2026 07:59
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

Quality Report — ConductionNL/opencatalogi @ 0754356

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
build
check-l10n
check-manifest
format
check-schema-l10n
check-l10n-js
composer ✅ 129/129
npm ✅ 881/881
app:check-code ⏭️
info.xml
REUSE
PHPUnit
Newman
Playwright ⏭️ deferred — runs on the promotion into beta/main, not on a pull request into development
Hydra gates

Quality workflow — 2026-09-01 08:05 UTC

Download the full PDF report from the workflow artifacts.

rubenvdlinde added a commit that referenced this pull request Sep 1, 2026
Follow-up to #1341, which left one E2E test red on development
(111 passed, 1 failed). SPA-001 navigates correctly -- gotoHash() was
already de-hashed -- but its closing assertion still required the URL to
contain '#/search', which history routing no longer produces.

Matched as a SUFFIX rather than an exact URL: Nextcloud serves the app as
both /apps/... and /index.php/apps/..., and the router emits whichever
base the page was loaded under, so pinning either would fail on the other
for a reason that is not a defect.

Renamed the file-local gotoHash() to gotoRoute(). It stopped using a hash
when the app moved to history routing, and a helper whose name says
'hash' is the next reader's wrong turn.

Extended the docblock to say WHY the assertion matters: the Dashboard is
exactly what renders when the router cannot resolve a path and the
catch-all redirects to '/', so 'Search, not Dashboard' is the real guard
against a base-mismatch regression.

Verified: SPA-001 passes against the dev container. prettier --check on
the full glob is clean.

Co-authored-by: Conduction Release Bot <release-bot@conduction.nl>
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