codefloe/forgejo-codefloe
Watch
4
12
Fork
You've already forked forgejo-codefloe
0

feat(billing): render the add-ons page with shadcn-vue components #188

Merged
pat-s merged 1 commit from codefloe/addons-shadcn-vue into v16.0/forgejo-codefloe 2026-10-01 07:03:05 +00:00
Owner

Prototype moving one fork-owned page off Fomantic markup and onto shadcn-vue components, to judge how they fit Forgejo's frontend and what they cost.

Changes

  • web_src/js/codefloe/ui/: add Button, Card, Badge, Table, Dialog, NumberField, Progress and Label, adapted from shadcn-vue to Forgejo's Tailwind (tw- prefix, theme colour variables, no preflight, theme focus ring, --border-radius), plus cn() and local octicon imports so upstream's svg.js stays untouched.
  • web_src/js/codefloe/components/AddonsPage.vue: render billing, limits (with a usage bar), owned add-ons (status badges, quantity and cancel dialogs) and products (cards with a stepper) from JSON props.
  • web_src/js/codefloe/addons-page.js: mount the page as a lazily loaded chunk, so no other page downloads the UI kit; this replaces billing-checkout.js, whose theme-on-submit moves into the component.
  • templates/shared/codefloe_billing.tmpl: emit the mount point with props and locale strings, keeping the htmx poll server-rendered; remove codefloe_billing_list.tmpl.
  • routers/web/shared/codefloe_billing.go: build the page props from the existing views, add a status kind and usage percentage, and stop offering products while a purchase is pending on the server rather than in the template.
  • package.json: add reka-ui, class-variance-authority, clsx and tailwind-merge 2 (3 targets Tailwind 4).
  • README.md: extend the "Billing add-ons" row.
  • Tests: integration tests read the page props instead of the HTML; e2e selectors use roles and labels and assert that the chosen quantity reaches the checkout post.

Behaviour change

  • Same endpoints, forms and fetch-action dialogs; only the rendering moves to the browser.
  • The add-ons chunk is 228 KB minified (74 KB gzip), loaded only on this page; index.js grows by about 1 KB gzip and index.css by about 1 KB gzip.

Validation

  • Playwright codefloe-billing.test.e2e.ts passes in Chromium, Firefox and Mobile Chrome, including the new check that the quantity typed into the stepper arrives in the checkout post.
  • Integration on SQLite: TestBilling|TestQuota|TestCodefloe|TestAPIQuota|TestActionsQuotaCI pass.
  • prek run -a passes (backend lint on the pinned go1.26.7, swagger, frontend lint and type checking).
  • Screenshots of light, dark, dialog and 390 px layouts were compared against the current page; PostgreSQL and MySQL are left to CI.
Prototype moving one fork-owned page off Fomantic markup and onto shadcn-vue components, to judge how they fit Forgejo's frontend and what they cost. ## Changes - `web_src/js/codefloe/ui/`: add Button, Card, Badge, Table, Dialog, NumberField, Progress and Label, adapted from shadcn-vue to Forgejo's Tailwind (`tw-` prefix, theme colour variables, no preflight, theme focus ring, `--border-radius`), plus `cn()` and local octicon imports so upstream's `svg.js` stays untouched. - `web_src/js/codefloe/components/AddonsPage.vue`: render billing, limits (with a usage bar), owned add-ons (status badges, quantity and cancel dialogs) and products (cards with a stepper) from JSON props. - `web_src/js/codefloe/addons-page.js`: mount the page as a lazily loaded chunk, so no other page downloads the UI kit; this replaces `billing-checkout.js`, whose theme-on-submit moves into the component. - `templates/shared/codefloe_billing.tmpl`: emit the mount point with props and locale strings, keeping the htmx poll server-rendered; remove `codefloe_billing_list.tmpl`. - `routers/web/shared/codefloe_billing.go`: build the page props from the existing views, add a status kind and usage percentage, and stop offering products while a purchase is pending on the server rather than in the template. - `package.json`: add `reka-ui`, `class-variance-authority`, `clsx` and `tailwind-merge` 2 (3 targets Tailwind 4). - `README.md`: extend the "Billing add-ons" row. - Tests: integration tests read the page props instead of the HTML; e2e selectors use roles and labels and assert that the chosen quantity reaches the checkout post. ## Behaviour change - Same endpoints, forms and fetch-action dialogs; only the rendering moves to the browser. - The add-ons chunk is 228 KB minified (74 KB gzip), loaded only on this page; `index.js` grows by about 1 KB gzip and `index.css` by about 1 KB gzip. ## Validation - Playwright `codefloe-billing.test.e2e.ts` passes in Chromium, Firefox and Mobile Chrome, including the new check that the quantity typed into the stepper arrives in the checkout post. - Integration on SQLite: `TestBilling|TestQuota|TestCodefloe|TestAPIQuota|TestActionsQuotaCI` pass. - `prek run -a` passes (backend lint on the pinned go1.26.7, swagger, frontend lint and type checking). - Screenshots of light, dark, dialog and 390 px layouts were compared against the current page; PostgreSQL and MySQL are left to CI.
feat(billing): render the add-ons page with shadcn-vue components
All checks were successful
milestone / set (pull_request_target) Has been skipped
issue-labels / backporting (pull_request_target) Has been skipped
testing / test-unit (pull_request) Successful in 10m33s
testing / frontend-checks (pull_request) Successful in 1m26s
testing / backend-checks (pull_request) Successful in 5m6s
testing / test-remote-cacher (garnet) (pull_request) Successful in 3m12s
testing / test-remote-cacher (redis) (pull_request) Successful in 3m12s
testing / test-mysql (pull_request) Successful in 33m23s
testing / test-remote-cacher (valkey) (pull_request) Successful in 3m11s
testing / test-e2e (pull_request) Successful in 31m3s
testing / test-sqlite (pull_request) Successful in 48m41s
testing / test-pgsql (pull_request) Successful in 51m44s
9844669d27
Prototype moving one fork-owned page off Fomantic markup and onto shadcn-vue components, to judge how they fit Forgejo's frontend and what they cost.

## Changes

- `web_src/js/codefloe/ui/`: add Button, Card, Badge, Table, Dialog, NumberField, Progress and Label, adapted from shadcn-vue to Forgejo's Tailwind (`tw-` prefix, theme colour variables, no preflight, theme focus ring, `--border-radius`), plus `cn()` and local octicon imports so upstream's `svg.js` stays untouched.
- `web_src/js/codefloe/components/AddonsPage.vue`: render billing, limits (with a usage bar), owned add-ons (status badges, quantity and cancel dialogs) and products (cards with a stepper) from JSON props.
- `web_src/js/codefloe/addons-page.js`: mount the page as a lazily loaded chunk, so no other page downloads the UI kit; this replaces `billing-checkout.js`, whose theme-on-submit moves into the component.
- `templates/shared/codefloe_billing.tmpl`: emit the mount point with props and locale strings, keeping the htmx poll server-rendered; remove `codefloe_billing_list.tmpl`.
- `routers/web/shared/codefloe_billing.go`: build the page props from the existing views, add a status kind and usage percentage, and stop offering products while a purchase is pending on the server rather than in the template.
- `package.json`: add `reka-ui`, `class-variance-authority`, `clsx` and `tailwind-merge` 2 (3 targets Tailwind 4).
- `README.md`: extend the "Billing add-ons" row.
- Tests: integration tests read the page props instead of the HTML; e2e selectors use roles and labels and assert that the chosen quantity reaches the checkout post.

## Behaviour change

- Same endpoints, forms and fetch-action dialogs; only the rendering moves to the browser.
- The add-ons chunk is 228 KB minified (74 KB gzip), loaded only on this page; `index.js` grows by about 1 KB gzip and `index.css` by about 1 KB gzip.

## Validation

- Playwright `codefloe-billing.test.e2e.ts` passes in Chromium, Firefox and Mobile Chrome, including the new check that the quantity typed into the stepper arrives in the checkout post.
- Integration on SQLite: `TestBilling|TestQuota|TestCodefloe|TestAPIQuota|TestActionsQuotaCI` pass.
- `prek run -a` passes (backend lint on the pinned go1.26.7, swagger, frontend lint and type checking).
- Screenshots of light, dark, dialog and 390 px layouts were compared against the current page; PostgreSQL and MySQL are left to CI.
pat-s merged commit 4369ddb0cc into v16.0/forgejo-codefloe 2026-10-01 07:03:05 +00:00
pat-s deleted branch codefloe/addons-shadcn-vue 2026-10-01 07:03:05 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
codefloe/forgejo-codefloe!188
No description provided.