Skip to content

Removed dead exports from Shade - #30142

Merged
9larsons merged 1 commit into
mainfrom
slars/prune-shade-dead-exports
Aug 21, 2026
Merged

9larsons merged 1 commit into
mainfrom
slars/prune-shade-dead-exports

Conversation

@9larsons

Copy link
Copy Markdown
Contributor

Deletion-only prune of Shade code with no consumers anywhere in the repo (each export name grep-verified across apps/ and e2e/ before removal):

  • Deleted layout/page, layout/header, layout/list-header, layout/view-header, ui/right-sidebar, patterns/utm-campaign-tabs and patterns/table-filter-tabs (UtmCampaignTabs was its only consumer), along with their stories and unit tests
  • Trimmed the unused KpiTabs/KpiTabsList/KpiTabsContent wrappers from patterns/kpi-tabs — consumers pass variant='kpis' to Tabs directly, and KpiTabTrigger/KpiTabValue/KpiDropdownButton stay
  • Deleted the unused formatUrl, isValidDomain, getYRangeWithMinPadding and getYRangeWithLargePadding utils from lib/app-utils (Admin settings has its own format-url copy)
  • Un-exported MetricValue and TrendBadge from the components barrel; they remain internal building blocks of the KPI patterns
  • Dropped the retired shade-stats and shade-posts app names from SHADE_APP_NAMESPACES

ViewBar was a candidate but stays: it is the documented ListPage.Header slot component (used by list-page.stories.tsx and docs/page-types.mdx).

23 files changed, +2/−1995. No behaviour change.

Verification: shade pnpm build + pnpm test:unit (31 files / 276 tests) + pnpm lint green; admin tsc -b + eslint src green; activitypub tsc --noEmit green; final repo-wide grep sweep shows zero references to every deleted name.

no ref

Deletion-only prune of Shade code with no consumers, verified by
grepping apps/ and e2e/ for each export name:

- Deleted layout/page, layout/header, layout/list-header,
  layout/view-header, ui/right-sidebar, patterns/utm-campaign-tabs and
  patterns/table-filter-tabs (UtmCampaignTabs was its only consumer),
  along with their stories and unit tests
- Trimmed the unused KpiTabs/KpiTabsList/KpiTabsContent wrappers from
  patterns/kpi-tabs; consumers pass variant='kpis' to Tabs directly
- Deleted the unused formatUrl, isValidDomain, getYRangeWithMinPadding
  and getYRangeWithLargePadding utils (Admin settings has its own
  format-url copy) and formatUrl's unit test
- Un-exported MetricValue and TrendBadge from the components barrel;
  they remain internal building blocks of the KPI patterns
- Dropped the retired shade-stats and shade-posts app names from
  SHADE_APP_NAMESPACES
@coderabbitai

coderabbitai Bot commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: QUIET

Plan: Pro Plus

Run ID: dcf54ec0-b4a3-4d62-ab4c-7650d89eb94f

📥 Commits

Reviewing files that changed from the base of the PR and between 452c80a and 085f7f3.

📒 Files selected for processing (23)
  • apps/shade/src/app.ts
  • apps/shade/src/components.ts
  • apps/shade/src/components/layout/header.stories.tsx
  • apps/shade/src/components/layout/header.tsx
  • apps/shade/src/components/layout/list-header.stories.tsx
  • apps/shade/src/components/layout/list-header.tsx
  • apps/shade/src/components/layout/page.stories.tsx
  • apps/shade/src/components/layout/page.tsx
  • apps/shade/src/components/layout/view-header.stories.tsx
  • apps/shade/src/components/layout/view-header.tsx
  • apps/shade/src/components/patterns/kpi-tabs.tsx
  • apps/shade/src/components/patterns/table-filter-tabs.tsx
  • apps/shade/src/components/patterns/utm-campaign-tabs.tsx
  • apps/shade/src/components/ui/right-sidebar.stories.tsx
  • apps/shade/src/components/ui/right-sidebar.tsx
  • apps/shade/src/lib/app-utils.ts
  • apps/shade/src/patterns.ts
  • apps/shade/src/primitives.ts
  • apps/shade/src/shade-app.tsx
  • apps/shade/test/unit/components/layout/list-header.test.tsx
  • apps/shade/test/unit/components/layout/page.test.tsx
  • apps/shade/test/unit/components/layout/view-header.test.tsx
  • apps/shade/test/unit/utils/format-url.test.ts
💤 Files with no reviewable changes (21)
  • apps/shade/src/components/layout/list-header.stories.tsx
  • apps/shade/test/unit/components/layout/page.test.tsx
  • apps/shade/src/components/layout/page.tsx
  • apps/shade/src/components/layout/header.stories.tsx
  • apps/shade/test/unit/utils/format-url.test.ts
  • apps/shade/test/unit/components/layout/view-header.test.tsx
  • apps/shade/src/components/patterns/table-filter-tabs.tsx
  • apps/shade/src/patterns.ts
  • apps/shade/src/components/patterns/utm-campaign-tabs.tsx
  • apps/shade/test/unit/components/layout/list-header.test.tsx
  • apps/shade/src/components/layout/page.stories.tsx
  • apps/shade/src/components.ts
  • apps/shade/src/components/ui/right-sidebar.stories.tsx
  • apps/shade/src/app.ts
  • apps/shade/src/components/layout/header.tsx
  • apps/shade/src/primitives.ts
  • apps/shade/src/components/layout/view-header.stories.tsx
  • apps/shade/src/lib/app-utils.ts
  • apps/shade/src/components/layout/list-header.tsx
  • apps/shade/src/components/ui/right-sidebar.tsx
  • apps/shade/src/components/layout/view-header.tsx

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (10)
  • GitHub Check: Check app version bump
  • GitHub Check: Lint
  • GitHub Check: App Playwright Acceptance Tests (@tryghost/activitypub)
  • GitHub Check: Unit tests (Node 22.23.1)
  • GitHub Check: Admin tests - Chrome
  • GitHub Check: App Playwright Acceptance Tests (@tryghost/admin)
  • GitHub Check: Build Docker Images
  • GitHub Check: Build E2E Public App Assets
  • GitHub Check: Build Admin
  • GitHub Check: Analyze (javascript-typescript)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (Custom checks)

**/*.{ts,tsx}: Type-safe boundaries: Fail only if the PR:

  • consumes boundary data (HTTP input, external API/SDK responses, env/config,
    DB/filesystem reads, queue/webhook/event payloads) without validating it
    first — Zod by default, another format only where an external contract
    requires it; or
  • introduces any, unchecked as, @ts-nocheck, or @ts-ignore to bypass
    typing boundary data; or
  • hand-writes a type duplicating a shape a Zod schema describes (use z.infer).
    Never fail for: internal function/module calls (no runtime validation needed),
    pre-existing JS files touched incidentally, tests, scripts, or config files.

Files:

  • apps/shade/src/shade-app.tsx
  • apps/shade/src/components/patterns/kpi-tabs.tsx
**/*

📄 CodeRabbit inference engine (AGENTS.md)

Always use pnpm, never npm or Yarn.

Files:

  • apps/shade/src/shade-app.tsx
  • apps/shade/src/components/patterns/kpi-tabs.tsx

⚙️ CodeRabbit configuration file

**/*: Prioritise concrete correctness, security, data-integrity, compatibility,
and regression risks. Explain the failure mode and point to the affected
code. Do not report formatting, naming, import ordering, type errors, or
other findings already owned by configured static tools or failing GitHub
checks. Do not request speculative abstractions, broad refactors, generic
documentation, or tests unrelated to changed behaviour. Treat nearby
AGENTS.md files and mapped codebase documentation as authoritative; do not
enforce proposals, plans, or historical guidance as current policy.

Files:

  • apps/shade/src/shade-app.tsx
  • apps/shade/src/components/patterns/kpi-tabs.tsx
**/*.{ts,tsx,mts,cts}

⚙️ CodeRabbit configuration file

**/*.{ts,tsx,mts,cts}: Review lens: "where does this data become trusted?"

  • Boundary data (HTTP input, external API/SDK responses, env/config,
    DB/filesystem reads, queue/webhook/event payloads) is unknown until
    validated — Zod by default.
  • Infer boundary types via z.infer/z.input; flag handwritten duplicates.
  • Flag any, unchecked as on boundary data, @ts-nocheck, and unexplained
    @ts-ignore/@ts-expect-error.
  • Validated data stays trusted: don't request Zod on internal calls, and flag
    redundant re-validation.
  • ghost/core golden path: schema.ts owns Zod schemas + inferred types, with
    codec/serializer modules at the edges (see core/server/services/gift-links).
  • Looser typing in tests is fine unless it hides a real defect.

Files:

  • apps/shade/src/shade-app.tsx
  • apps/shade/src/components/patterns/kpi-tabs.tsx
apps/{admin,activitypub,admin-x-framework,shade}/**/*.{ts,tsx}

⚙️ CodeRabbit configuration file

apps/{admin,activitypub,admin-x-framework,shade}/**/*.{ts,tsx}: Review Admin UI for existing Shade reuse, correct component layer, semantic
tokens, accessible interaction states, and whole-sentence translations. New UI
that depends on backend settings, endpoints, or config must feature-detect old
backend support and cover the not-yet-deployed backend case. Do not apply these
rules to independent public UMD apps. Do not repeat ESLint/Tailwind findings.

Files:

  • apps/shade/src/shade-app.tsx
  • apps/shade/src/components/patterns/kpi-tabs.tsx
🔇 Additional comments (2)
apps/shade/src/components/patterns/kpi-tabs.tsx (1)

8-10: LGTM!

Also applies to: 99-100

apps/shade/src/shade-app.tsx (1)

10-10: LGTM!


Walkthrough

The change removes deprecated Shade layout components, patterns, sidebar components, stories, and unit tests. It reduces public barrel exports and removes URL, domain, and Y-axis utility helpers. It removes the related validator usage. The legacy primitives export surface retains only ErrorPage and heading. The shade-stats and shade-posts namespaces are removed from SHADE_APP_NAMESPACES.

Merge Risk: ⚪ Minimal · up to 085f7

This deletion-only cleanup removes unused Shade exports and related tests without changing behavior; the reported checks are green, and no actionable merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary change: removing unused Shade exports.
Description check ✅ Passed The description accurately explains the deleted exports, files, retained components, verification, and absence of behavior changes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Type-Safe Boundaries ✅ Passed The diff is deletion-only except an internal TabsTrigger import and a literal namespace change; no new boundary reads, unchecked casts, any, or TypeScript suppression were introduced.
New Files Are Typescript ✅ Passed The PR diff contains 23 modified or deleted paths and no added paths; therefore it adds no .js, .jsx, .cjs, or .mjs source file.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch slars/prune-shade-dead-exports

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Aug 20, 2026 •

Copy link
Copy Markdown

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 085f7f3

Command Status Duration Result
nx run @tryghost/admin:test:acceptance ✅ Succeeded 8m 12s View ↗
nx run-many -t test:unit -p @tryghost/shade,@tr... ✅ Succeeded 5m 5s View ↗
nx run ghost-admin:test ✅ Succeeded 3m 10s View ↗
nx run ghost-monorepo:lint:boundaries ✅ Succeeded 22s View ↗
nx run-many -t lint -p @tryghost/shade,@tryghos... ✅ Succeeded 2m 14s View ↗
nx run @tryghost/admin:build ✅ Succeeded 2m 6s View ↗
nx run @tryghost/activitypub:test:acceptance ✅ Succeeded 1m 1s View ↗
nx run-many --target=build --projects=tag:publi... ✅ Succeeded 3s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-08-20 14:15:58 UTC

@9larsons
9larsons requested a review from peterzimon August 20, 2026 14:08
@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.54%. Comparing base (65b2d76) to head (085f7f3).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #30142   +/-   ##
=======================================
  Coverage   75.54%   75.54%           
=======================================
  Files        1635     1635           
  Lines      145908   145908           
  Branches    18203    18203           
=======================================
  Hits       110230   110230           
  Misses      34676    34676           
  Partials     1002     1002           
Flag Coverage Δ
admin-tests 56.85% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@9larsons
9larsons merged commit af4af7d into main Aug 21, 2026
53 checks passed
@9larsons
9larsons deleted the slars/prune-shade-dead-exports branch August 21, 2026 11:42
zach1618 added a commit that referenced this pull request Aug 26, 2026
ref https://linear.app/ghost/issue/NY-1498/automation-run-analytics-ux

Main removed MetricValue from Shade's public components barrel as a dead export
(#30142). It was dead in main — only KpiCard and KpiTabs use it, internally — but
this prototype was importing it, so the catch-up merge broke the admin build.

Both call sites now compose the exported KpiCard pair from @tryghost/shade/patterns
instead, which is the supported way to reach the same rendering: KpiCardHeaderValue
wraps MetricValue itself, and KpiCardHeaderLabel carries chrome identical to
MetricValue's own label. They're separate components rather than one with a label
prop, so a Stack holds them — gap="sm" is gap-2, the gap MetricValue used between
its label and value.

Nothing shared changed. Re-adding the export would have made a prototype re-open
API surface Shade had just deliberately retired.

Worth knowing for next time: a local `tsc --noEmit` passed on the broken code,
because apps/shade/types still held the pre-merge barrel. The typecheck is only
as current as the last Shade build, so after merging main the build has to come
first — or the check quietly validates against exports that no longer exist.
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