Skip to content

Refactor case study page into nested routes with Overview/History/Contributors#96

Merged
mathix420 merged 11 commits into
stagingfrom
claude/case-studies-design-fix-p257al
Jul 12, 2026
Merged

Refactor case study page into nested routes with Overview/History/Contributors#96
mathix420 merged 11 commits into
stagingfrom
claude/case-studies-design-fix-p257al

Conversation

@mathix420

Copy link
Copy Markdown
Owner

Summary

Restructures the case study detail page (/case-study/[id]) from a monolithic view into a nested route layout with three child pages: Overview (default), History, and Contributors. This mirrors the pattern used for issues/solutions and improves separation of concerns by keeping the main record view focused while moving metadata (change history, team) to quiet meta links.

Key Changes

  • Parent layout ([id].vue): Now acts as a shell that loads the case study data once and provides it to child routes via provide(). Handles edit modal, pending revision banner (with smart link to history tab), and renders <NuxtPage /> for child content.

    • Removed all detail card rendering (moved to index.vue)
    • Removed history timeline rendering (moved to history.vue)
    • Removed NodeMembers panel (moved to contributors.vue)
    • Simplified pending revision fetch: only loads count for owner/admin, keyed to avoid duplication
    • Changed pending banner from scroll-to-section to a NuxtLink to /case-study/[id]/history
    • Provides caseStudy, caseStudyParent, caseStudyCanApply, and caseStudyRefresh to children
  • New Overview page ([id]/index.vue): Renders all structured case study fields as cards (implementer, timeline, location map, description, metrics, funding, lessons learned, sources, links, documentation metadata). Includes quiet meta links at the bottom to Contributors and History pages.

  • New History page ([id]/history.vue): Full revision timeline with owner/admin approval controls. Loads complete revision list (not just pending count). Includes back link to overview.

  • New Contributors page ([id]/contributors.vue): NodeMembers panel for team management. Includes back link to overview.

Notable Implementation Details

  • Uses Vue's provide()/inject() to share loaded study data and callbacks across nested routes, avoiding duplicate fetches
  • Pending revision banner only fetches data when canApply is true (owner/admin), with immediate: false to defer until needed
  • Pending banner intelligently hides when already on the history tab (onHistoryTab computed)
  • Moved date formatting and cost display logic to index.vue (only needed there)
  • Map visibility tracking remains in index.vue where it's used
  • Maintains all existing edit/suggest-edit functionality in parent shell
  • Tracking calls updated to reflect new navigation patterns (banner click now navigates instead of scrolling)

https://claude.ai/code/session_012MFHDAHHvfjqmUf7TycaJJ

mathix420 and others added 6 commits June 30, 2026 11:11
🚀 Release: master ⬅️ staging
🚀 Release: master ⬅️ staging
🚀 Release: master ⬅️ staging
🚀 Release: master ⬅️ staging
🚀 Release: master ⬅️ staging
- Move the parent "Case study of" callout below the title and badges,
  matching how issues render (id → title → badges → parent).
- Hide the owner/collaborators panel behind a dedicated Contributors
  page and the change log behind a History page, reached via quiet meta
  links at the bottom of the overview — the same pattern issues and
  solutions use. Both are now nested routes under /case-study/[id].

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012MFHDAHHvfjqmUf7TycaJJ
@github-actions

github-actions Bot commented Jul 12, 2026

Copy link
Copy Markdown

🧹 Code quality

Check Summary
vize lint 0 errors · 330 warnings
vize format all files formatted
fallow audit pass · 0 dead-code · 7 complexity · 0 dupes (17 files)

updated for 82ef0a3 · run #263

- Extract the outcome/scale badge label+variant maps — previously
  copy-pasted across the case-study page, case-study card, tree node,
  and issue overview — into a single app/utils/case-study.ts.
- Extract the shared "Contributors · History" overview footer into a
  NodeMetaLinks component, used by both the issue and case-study
  overviews, and the meta-page "← back" link into NodeBackLink.

No visual change; purely removes duplication.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012MFHDAHHvfjqmUf7TycaJJ
@mathix420
mathix420 changed the base branch from master to staging July 12, 2026 13:55
claude and others added 4 commits July 12, 2026 13:59
- Pin vue-tsc (2.2.10) in devDependencies. CI runs `bunx vue-tsc`, which
  otherwise resolves vue-tsc@latest (v3) — incompatible with the pinned
  TypeScript on Node 24 (ERR_PACKAGE_PATH_NOT_EXPORTED './lib/tsc'),
  failing the required typecheck job repo-wide. A local pin makes bunx use
  a working version.
- Apply vize formatting to the new/changed case-study files.
- Extract case-study date-range + cost formatting into small pure helpers
  in app/utils/case-study.ts (shared, testable, lower per-fn complexity).
- Extract the near-identical Sources/Links lists into CaseStudyLinkCard.
- Flatten history.vue's template (derive viewerId/revisionCount in script).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012MFHDAHHvfjqmUf7TycaJJ
GitHub Actions did not schedule a run for the previous commit; empty
commit to fire the pull_request:synchronize workflow.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012MFHDAHHvfjqmUf7TycaJJ
…ribution

Resolves the conflict in app/pages/case-study/[id].vue (the refactor turned it
into a <NuxtPage /> shell, so staging's safeUrl() hardening of the sources/links
hrefs from #94 no longer applied there). Kept the shell and re-applied safeUrl()
in the extracted CaseStudyLinkCard component so the security fix survives.

Also scopes fallow-ignore comments on the shell + Overview templates: the
refactor splits one monolithic template into two simpler ones (net complexity
drop) but the diff-gate re-attributes each touched template as introduced —
same pattern as createCaseStudy (bb3550c).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EzhVToTww4v85fHmuWyPEh
…n id

- Remove provide('caseStudyParent') — no child route injects it (the parent
  callout is rendered in the shell itself).
- Key the pending-banner revisions fetch on the case-study id so client
  navigation between two studies can't briefly surface the previous count.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EzhVToTww4v85fHmuWyPEh
@mathix420
mathix420 merged commit 7b7a419 into staging Jul 12, 2026
6 checks passed
@mathix420
mathix420 deleted the claude/case-studies-design-fix-p257al branch July 12, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants