feat(billing): render the add-ons page with shadcn-vue components #188
No reviewers
Labels
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
codefloe/forgejo-codefloe!188
Loading…
Reference in a new issue
No description provided.
Delete branch "codefloe/addons-shadcn-vue"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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), pluscn()and local octicon imports so upstream'ssvg.jsstays 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 replacesbilling-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; removecodefloe_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: addreka-ui,class-variance-authority,clsxandtailwind-merge2 (3 targets Tailwind 4).README.md: extend the "Billing add-ons" row.Behaviour change
index.jsgrows by about 1 KB gzip andindex.cssby about 1 KB gzip.Validation
codefloe-billing.test.e2e.tspasses in Chromium, Firefox and Mobile Chrome, including the new check that the quantity typed into the stepper arrives in the checkout post.TestBilling|TestQuota|TestCodefloe|TestAPIQuota|TestActionsQuotaCIpass.prek run -apasses (backend lint on the pinned go1.26.7, swagger, frontend lint and type checking).