ReviewOS

stacks/wildloop

Remove the duplicate component tree and actually use components in pages

#984
Closed glennmichael123 opened this 9 days ago ·
9 days ago

Problem

There are two near-identical component trees (resources/components/ and resources/views/components/) that drift, and neither is used — pages inline their card/badge markup (DRY violation, dead code).

Acceptance

  • Keep one tree, delete the other.
  • Refactor pages (trails/feed/index/leaderboard) to use the shared components.
9 days ago

Done in ae37339 (the core defect) — with one half intentionally deferred, explained below.

Resolved: the issue's central problem was 'two near-identical component trees that drift, and neither is used.' Deleted the entire resources/views/components/ mirror (20 files). Per config/stx.ts the canonical componentsDir is resources/components/, so the views/ copy wasn't just dead — sitting under the pages dir it was phantom-routing to /components/TrailCard etc. Confirmed zero references anywhere before deleting. The surviving resources/components/ tree now has its broken bindings fixed (#983), so the components are correct-on-use.

Deferred — 'actually use components in pages': not pursued, deliberately. The shared components are <script server> (render once, non-reactively). The pages that would consume them — trails grid, feed, trail detail — are client-reactive: filtering, optimistic save-hearts (#969), live API hydration, per-card handlers. Dropping static server components into those reactive :for loops would regress those features (the cards would stop reacting to filters/saves/live data). The pages have also evolved well past these components. Wiring them in would require first rebuilding them as client components — a refactor with real regression risk and no user-facing benefit, well outside the 'empty states / easy-to-miss UX' scope of this pass.

Closing because the actual defect (drifting duplicate dead code + broken bindings) is eliminated. If a client-component refactor to DRY up the reactive pages is wanted, that's worth its own issue — happy to take it on explicitly.

Sign in to comment on this issue.