Skip to content

fix(starter-kits): typed nav links, persistent Vue layouts, Vue browser test plugins, and empty old input - #39

Merged
thetutlage merged 4 commits into
mainfrom
fix/starter-nav-layouts-tests
Nov 20, 2026
Merged

thetutlage merged 4 commits into
mainfrom
fix/starter-nav-layouts-tests

Conversation

@thetutlage

@thetutlage thetutlage commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Fixes found while applying Flow feature packs (auth, workspaces) to fresh React and Vue apps.

Changes

  • Typed NavLink (React, Vue). It takes the typed props of a route Link, so routeParams / params are checked against the route name. Before, it took only a route name, so a route with params could not use it.
    • Vue: a generic component. The Vue compiler cannot resolve the Link props type, so that part is marked /* @vue-ignore */. params arrives as an attribute, and vue-tsc still checks it at each call site.
  • Inline nav links (React, Vue). The app and settings layouts write each NavLink inline. The NavItem arrays are removed. An array of mixed routes cannot type their params.
  • Persistent layouts (Vue). Each page attaches its layout with defineOptions({ layout }), as the React pages do with Page.layout. A layout in the template mounts again on each visit, and the flash toast of a redirect is lost.
  • Browser test plugins (Vue). tests/bootstrap.ts registers browserClient, sessionBrowserClient and authBrowserClient, as the React kit does.
  • Paginator metadata (React, Vue, API, API monorepo). typecheck failed: the isLucidPaginatorMetaData guard of @adonisjs/http-transformers 2.3.2 does not list pageName, which Lucid 22.5 added. The provider casts the value. The real fix belongs in @adonisjs/http-transformers.
  • Empty old input (Hypermedia). After a validation error, an empty field showed the saved value again. The bodyparser turns an empty field into null, and the field components read the old input with ||, so it fell back to the saved value. input/control and textarea/control now use the saved value only when there is no old input. field/root and the checkbox and radio groups pass the old value as it is.
  • Icon set at runtime (Hypermedia). start/view.ts imports @iconify-json/lucide, but it was a dev dependency, so an install with --omit=dev failed to boot. It moves to dependencies.
  • Dedicated test database (all kits). The SQLite file was hard-coded to tmp/db.sqlite3 and the test runner did not migrate, so specs that truncate the database ran on, and wiped, the development database. Each kit reads the file name from DB_DATABASE, .env.test sets it to test.sqlite3, and tests/bootstrap.ts migrates before the first test.

Checks

  • inertia-react, inertia-vue: npm run typecheck and npm run lint pass.
  • api, api-monorepo backend: tsc --noEmit passes.
  • Hypermedia old input, in an app with the Flow workspaces pack: a throwaway browser spec submitted an empty Workspace name (the input stays empty), a 101-character name (the input keeps it), and a valid rename (saved). The app's 48 browser specs and lint pass.
  • Test database, in each of the five kits: migrated the development database and added a user, then ran a throwaway spec that truncates. The spec passed, tmp/test.sqlite3 was created, and the development database still had its user.
  • Hypermedia icon set: built the kit, copied the build to a folder outside the repo, ran npm install --omit=dev and booted it. Before: Cannot find package '@iconify-json/lucide'. After: the home page returns 200.
  • Vue NavLink, with a throwaway route /probe/:slug: a missing param, a wrong param and an unknown route name each fail vue-tsc. node ace build compiles the component. A throwaway browser test rendered href="/probe/a", kept the class, and put no params attribute on the anchor.
  • Full apps with the Flow auth and workspaces packs pass their browser specs: the React app with this React NavLink, and the Vue app (49 specs) with these persistent layouts. The Vue app used an earlier, untyped NavLink, so the typed Vue NavLink is checked only by the throwaway route and test above.

…rowser test plugins

- NavLink takes the typed props of a route Link in the React and Vue kits,
  so params are checked against the route.
- The app and settings layouts write their links inline, in place of
  NavItem arrays.
- Vue pages attach their layout with defineOptions, so the layout and its
  flash toasts stay mounted across visits.
- The Vue kit registers the browser, session and auth browser client
  plugins, as the React kit does.
- The api providers cast the paginator metadata: the guard of
  @adonisjs/http-transformers does not list pageName, which Lucid 22.5 added.

Claude-Session: https://claude.ai/code/session_01TEEvhcHLnHEEa4Qd5eGJs4
@fleet-panda fleet-panda Bot added the status: incoming The status of the hub task label Nov 20, 2026
…idation error

The bodyparser turns an empty field into null, and the session flashes
it as the old input. The field components read it with `||`, so an
empty old value fell back to the saved value. The input and textarea
controls now use the saved value only when there is no old input.

Claude-Session: https://claude.ai/code/session_01TEEvhcHLnHEEa4Qd5eGJs4
@thetutlage thetutlage changed the title fix(starter-kits): typed nav links, persistent Vue layouts, and Vue browser test plugins fix(starter-kits): typed nav links, persistent Vue layouts, Vue browser test plugins, and empty old input Nov 20, 2026
start/view.ts imports the icon set at runtime, so an install with
--omit=dev failed to boot with "Cannot find package '@iconify-json/lucide'".

Claude-Session: https://claude.ai/code/session_01TEEvhcHLnHEEa4Qd5eGJs4
The SQLite file was hard-coded to tmp/db.sqlite3, and the test runner did
not migrate, so specs that truncate the database ran on, and wiped, the
development database. Each kit now reads the file name from DB_DATABASE,
.env.test points it at tmp/test.sqlite3, and the test runner migrates it
before the first test.

Claude-Session: https://claude.ai/code/session_01TEEvhcHLnHEEa4Qd5eGJs4
@thetutlage
thetutlage merged commit bef9f4c into main Nov 20, 2026
5 checks passed
@thetutlage
thetutlage deleted the fix/starter-nav-layouts-tests branch November 20, 2026 09:51
ankur-arch added a commit to thetutlage/prisma-examples that referenced this pull request Nov 20, 2026
…w screens

- Pass `module: infra/module.ts` to prisma/cloud-deploy-action. The action
  defaults to `module.ts` in the project root and passes it as `--entry`,
  which overrides prisma.config.ts, so deploy on push could not find the
  module after it moved to infra/.
- Drop the unused `pull-requests: write` permission from the workflow.
- Put the task title back after a network or server failure, and only when
  the input is still empty, so a draft typed during the request is kept.
- Wrap the task forms below 480px so they fit narrow screens.
- Sync nav_link, the app and settings layouts and the api provider with the
  current React starter kit (adonisjs/starter-kits#39).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
ankur-arch added a commit to prisma/prisma-examples that referenced this pull request Nov 20, 2026
* feat(compute/adonisjs): use the AdonisJS React starter kit

Replace the Hypermedia app with the React (Inertia) starter kit. Keep the
Bun setup, the Composer module and the deploy workflow. Use Node.js 26 in
the workflow and the README. Pass the environment to the migration
process in bin/compute.ts, because Bun does not pass the variables that
the file sets at runtime.

* feat(compute/adonisjs): optimistic task updates and an infra folder

Show a new task and remove a deleted task before the server answers.
Inertia restores the list when the request fails. Move module.ts and
service.ts to infra/.

* fix(compute/adonisjs): deploy workflow entry, form recovery and narrow screens

- Pass `module: infra/module.ts` to prisma/cloud-deploy-action. The action
  defaults to `module.ts` in the project root and passes it as `--entry`,
  which overrides prisma.config.ts, so deploy on push could not find the
  module after it moved to infra/.
- Drop the unused `pull-requests: write` permission from the workflow.
- Put the task title back after a network or server failure, and only when
  the input is still empty, so a draft typed during the request is kept.
- Wrap the task forms below 480px so they fit narrow screens.
- Sync nav_link, the app and settings layouts and the api provider with the
  current React starter kit (adonisjs/starter-kits#39).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

---------

Co-authored-by: Ankur Datta <64993082+ankur-arch@users.noreply.github.com>
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
@thetutlage thetutlage added status: discarded The status of the hub task and removed status: incoming The status of the hub task labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: discarded The status of the hub task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant