Nothing says which file a new HTTP handler belongs in #121

Open
opened 2026-09-21 07:18:36 +00:00 by cgalo5758 · 1 comment
Owner

What a contributor runs into

The server package holds well over a hundred files and no stated layout. Fragment handlers, the ones that answer a partial request rather than render a page, are registered from five of those files: two named for partials and three that are page files. A contributor adding a fragment picks a file by imitation, and reviewers cannot tell from a path whether a route serves a page or a fragment.

Why it costs

Related handlers drift into different files, the same small helper gets written twice, and a change to one surface has to be hunted for across the package.

Where

internal/server.

Done when

The package states its layout in one place (page handlers, fragment handlers, the shared rendering helpers), the files match it, and a new route has one obvious home.

Migrated from status/issues.md at b7a0e15

## What a contributor runs into The server package holds well over a hundred files and no stated layout. Fragment handlers, the ones that answer a partial request rather than render a page, are registered from five of those files: two named for partials and three that are page files. A contributor adding a fragment picks a file by imitation, and reviewers cannot tell from a path whether a route serves a page or a fragment. ## Why it costs Related handlers drift into different files, the same small helper gets written twice, and a change to one surface has to be hunted for across the package. ## Where [`internal/server`](https://git.coopcloud.tech/wiki-cafe/member-console/src/commit/b7a0e15/internal/server). ## Done when The package states its layout in one place (page handlers, fragment handlers, the shared rendering helpers), the files match it, and a new route has one obvious home. Migrated from status/issues.md at b7a0e15
cgalo5758 added the
kind
debt
area/operator-uiarea/member-ui
labels 2026-09-21 07:18:36 +00:00
Author
Owner

A proposed split for the member side, starting with the largest file: internal/server/member_products.go (about 2,000 lines) becomes member_plans.go (the plans page and its view models), member_plan_moves.go (preview, switch, keep, cancel), member_entitlements.go, member_addons.go and price_text.go. A page made of several sections gets one loader per section, each with its own error field, the shape loadOrgGrants already has in operator_enrollment.go.

A proposed split for the member side, starting with the largest file: `internal/server/member_products.go` (about 2,000 lines) becomes `member_plans.go` (the plans page and its view models), `member_plan_moves.go` (preview, switch, keep, cancel), `member_entitlements.go`, `member_addons.go` and `price_text.go`. A page made of several sections gets one loader per section, each with its own error field, the shape `loadOrgGrants` already has in `operator_enrollment.go`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: wiki-cafe/member-console#121