Skip to content

Removed legacy Admin X design system - #29584

Merged
9larsons merged 6 commits into
mainfrom
codex/admin-settings-design-system-teardown
Jul 25, 2026
Merged

9larsons merged 6 commits into
mainfrom
codex/admin-settings-design-system-teardown

Conversation

@9larsons

Copy link
Copy Markdown
Contributor

What changed

  • removed the retired apps/admin-x-design-system workspace and all package, Nx, CSS scan, Knip, ESLint, and lockfile wiring
  • moved the Koenig loader contract into the existing Shade app context
  • preserved Settings’ nested NiceModal provider so hash-routed modals continue to render and navigate correctly
  • internalized the Settings modal backdrop recipe and refreshed the adoption report to show zero legacy design-system imports

Why

Settings now uses Shade for its remaining UI primitives. The legacy package was only providing shell context and build wiring, so keeping it added an extra design-system dependency without owning any UI.

Validation

  • pnpm --filter @tryghost/admin-x-settings test:unit — 217 passed
  • pnpm --filter @tryghost/shade test:unit — 235 passed
  • pnpm --filter @tryghost/admin test:acceptance — 375 passed
  • pnpm --filter @tryghost/admin build
  • Settings, Shade, Framework, and Admin lint
  • frozen lockfile and Nx workspace-removal checks

Manual validation

  • open Settings and confirm the page shell and navigation render normally
  • open route-driven modals such as Offers, Staff, Tiers, Themes, and Integrations; close them and confirm the URL follows the modal state
  • open a Koenig-backed Settings editor, such as a welcome email editor, and confirm it loads and saves normally
  • verify both light and dark mode Settings surfaces

no ref

The Settings migration is complete, so the remaining shell only duplicated Shade context and build wiring. Moving the Koenig loader into Shade lets the obsolete package be removed without changing Settings modal behavior.
@coderabbitai

coderabbitai Bot commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The legacy admin-x-design-system package, components, styles, Storybook setup, tooling, and exports were removed. Shade now provides FetchKoenigLexical through context and app props. Admin and settings consume Shade context for editor loading and themes, update modal and preview styling, and remove legacy backdrop references. Adoption scanning and snapshots were refreshed, and the ActivityPub selector now targets .shade-activitypub directly.

Possibly related PRs

  • TryGhost/Ghost#29542 — Continues removing legacy design-system surfaces and aligning settings with Shade.
  • TryGhost/Ghost#29545 — Migrates dirty-state and confirmation flows from the legacy design system to Shade.
  • TryGhost/Ghost#29568 — Updates settings modal backdrop handling around Shade patterns.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: removal of the legacy Admin X design system.
Description check ✅ Passed The description matches the changeset and covers the workspace removal, Shade integration, and validation.
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.
✨ 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 codex/admin-settings-design-system-teardown

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 Jul 24, 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 9c67705

Command Status Duration Result
nx run ghost:test:integration ✅ Succeeded 3m 19s View ↗
nx run @tryghost/admin:test:acceptance ✅ Succeeded 6m 22s View ↗
nx run ghost:test:ci:integration ✅ Succeeded 4s View ↗
nx run ghost:test:legacy ✅ Succeeded 3m 6s View ↗
nx run ghost:test:e2e ✅ Succeeded 2m 48s View ↗
nx run @tryghost/koenig-lexical:test:acceptance ✅ Succeeded 2m 31s View ↗
nx run-many -t test:unit -p @tryghost/activityp... ✅ Succeeded 1m 33s View ↗
nx run ghost-monorepo:lint:boundaries ✅ Succeeded 16s View ↗
Additional runs (8) ✅ Succeeded ... View ↗

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


☁️ Nx Cloud last updated this comment at 2026-07-25 13:45:26 UTC

@codecov

codecov Bot commented Jul 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.79%. Comparing base (4324cc8) to head (9c67705).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #29584   +/-   ##
=======================================
  Coverage   74.79%   74.79%           
=======================================
  Files        1608     1608           
  Lines      141719   141719           
  Branches    17316    17319    +3     
=======================================
+ Hits       105992   105998    +6     
+ Misses      34684    34651   -33     
- Partials     1043     1070   +27     
Flag Coverage Δ
e2e-tests 76.86% <ø> (+<0.01%) ⬆️

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 added 5 commits July 25, 2026 07:59
The nested radius exposed the darker modal shell in dark mode, so the shared shell now owns the clipping.
no ref

The iframe canvas could remain visible when the rendered signup form landed on a fractional height, so it now shares the selected form background.
no ref

CodeMirror was not receiving the active Shade theme, leaving its light text palette unreadable on dark settings surfaces.
Render CodeMirror before optional language extensions resolve so a failed dev-time chunk request cannot leave the modal blank.

no ref
@9larsons
9larsons marked this pull request as ready for review July 25, 2026 13:40
@9larsons
9larsons enabled auto-merge (squash) July 25, 2026 13:40
@9larsons
9larsons merged commit 7da28a0 into main Jul 25, 2026
52 of 53 checks passed
@9larsons
9larsons deleted the codex/admin-settings-design-system-teardown branch July 25, 2026 13:49

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/admin-x-settings/src/components/code-editor-view.tsx (1)

108-120: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Make theme authoritative.

CodeMirror receives theme: darkMode ? 'dark' : 'light', then spreads props; a caller theme prop overrides the mode-driven value. Omit theme from the forwarded props or spread props before setting it.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/admin-x-settings/src/components/code-editor-view.tsx` around lines 108 -
120, Make the theme value in the CodeMirror component authoritative by
preventing the spread of props from overriding it. Update the prop forwarding
order or omit theme from props, while preserving the existing darkMode-based
theme selection.
🧹 Nitpick comments (1)
apps/shade/src/shade-app.tsx (1)

3-3: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use the Shade alias for this cross-file import.

Proposed fix
-import ShadeProvider, {type FetchKoenigLexical} from './providers/shade-provider';
+import ShadeProvider, {type FetchKoenigLexical} from '`@/providers/shade-provider`';

As per coding guidelines, “Inside Shade, use the @/ alias for cross-file imports.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/shade/src/shade-app.tsx` at line 3, Update the ShadeProvider and
FetchKoenigLexical import in shade-app.tsx to use the configured `@/` alias
instead of the relative cross-file path, preserving the existing imported
symbols.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/admin-x-settings/src/components/code-editor-view.tsx`:
- Around line 51-55: The basicSetup updater must preserve the existing
BasicSetupOptions fields instead of nesting them under an unsupported setup key.
Update the setBasicSetup callback to spread the previous options and set
searchKeymap to false, retaining the initial crosshairCursor value.

In `@apps/shade/src/docs/adoption-dashboard.stories.tsx`:
- Line 260: Update the overview KPI card copy near the existing “ghost/admin”
text to use “apps/ember-admin”, matching the adoption-dashboard documentation at
line 260. Keep the card’s surrounding content and formatting unchanged.

In `@apps/shade/src/shade-app.tsx`:
- Line 14: Update the fetchKoenigLexical property in the ShadeAppProps type to
use FetchKoenigLexical | null, matching ShadeProviderProps and allowing the
loader passed by app-root consumers while preserving nullability.

---

Outside diff comments:
In `@apps/admin-x-settings/src/components/code-editor-view.tsx`:
- Around line 108-120: Make the theme value in the CodeMirror component
authoritative by preventing the spread of props from overriding it. Update the
prop forwarding order or omit theme from props, while preserving the existing
darkMode-based theme selection.

---

Nitpick comments:
In `@apps/shade/src/shade-app.tsx`:
- Line 3: Update the ShadeProvider and FetchKoenigLexical import in
shade-app.tsx to use the configured `@/` alias instead of the relative cross-file
path, preserving the existing imported symbols.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: efc89402-c6e6-4aac-b596-3018c19fe2da

📥 Commits

Reviewing files that changed from the base of the PR and between 4324cc8 and 9c67705.

⛔ Files ignored due to path filters (24)
  • apps/admin-x-design-system/.storybook/Inter.ttf is excluded by !**/*.ttf
  • apps/admin-x-design-system/src/assets/icons/eyedropper.svg is excluded by !**/*.svg
  • apps/admin-x-design-system/src/docs/assets/adminx-screenshot.png is excluded by !**/*.png
  • apps/admin-x-design-system/src/docs/assets/apps.svg is excluded by !**/*.svg
  • apps/admin-x-design-system/src/docs/assets/blocks.svg is excluded by !**/*.svg
  • apps/admin-x-design-system/src/docs/assets/circle-menu.svg is excluded by !**/*.svg
  • apps/admin-x-design-system/src/docs/assets/code-brackets.svg is excluded by !**/*.svg
  • apps/admin-x-design-system/src/docs/assets/colors.svg is excluded by !**/*.svg
  • apps/admin-x-design-system/src/docs/assets/comments.svg is excluded by !**/*.svg
  • apps/admin-x-design-system/src/docs/assets/direction.svg is excluded by !**/*.svg
  • apps/admin-x-design-system/src/docs/assets/ds-structure.png is excluded by !**/*.png
  • apps/admin-x-design-system/src/docs/assets/flow.svg is excluded by !**/*.svg
  • apps/admin-x-design-system/src/docs/assets/global-error-example.png is excluded by !**/*.png
  • apps/admin-x-design-system/src/docs/assets/local-error-example.png is excluded by !**/*.png
  • apps/admin-x-design-system/src/docs/assets/page-error-example.png is excluded by !**/*.png
  • apps/admin-x-design-system/src/docs/assets/page-viewcontainer.png is excluded by !**/*.png
  • apps/admin-x-design-system/src/docs/assets/plugin.svg is excluded by !**/*.svg
  • apps/admin-x-design-system/src/docs/assets/repo.svg is excluded by !**/*.svg
  • apps/admin-x-design-system/src/docs/assets/stackalt.svg is excluded by !**/*.svg
  • apps/admin-x-design-system/src/docs/assets/streamline-settings.png is excluded by !**/*.png
  • apps/admin-x-design-system/src/docs/assets/style-guide-layout.png is excluded by !**/*.png
  • apps/admin-x-design-system/src/docs/assets/style-guide.png is excluded by !**/*.png
  • apps/admin-x-design-system/src/docs/assets/tower.svg is excluded by !**/*.svg
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (75)
  • apps/activitypub/src/styles/index.css
  • apps/admin-x-design-system/.gitignore
  • apps/admin-x-design-system/.storybook/adminx-theme.tsx
  • apps/admin-x-design-system/.storybook/main.tsx
  • apps/admin-x-design-system/.storybook/manager.tsx
  • apps/admin-x-design-system/.storybook/preview.tsx
  • apps/admin-x-design-system/.storybook/storybook.css
  • apps/admin-x-design-system/README.md
  • apps/admin-x-design-system/eslint.config.js
  • apps/admin-x-design-system/package.json
  • apps/admin-x-design-system/postcss.config.cjs
  • apps/admin-x-design-system/preflight.css
  • apps/admin-x-design-system/src/boilerplate.stories.tsx
  • apps/admin-x-design-system/src/boilerplate.tsx
  • apps/admin-x-design-system/src/design-system-app.tsx
  • apps/admin-x-design-system/src/docs/Colors.mdx
  • apps/admin-x-design-system/src/docs/ErrorHandling.mdx
  • apps/admin-x-design-system/src/docs/Icons.mdx
  • apps/admin-x-design-system/src/docs/Layout.mdx
  • apps/admin-x-design-system/src/docs/Welcome.mdx
  • apps/admin-x-design-system/src/global/banner.stories.tsx
  • apps/admin-x-design-system/src/global/banner.tsx
  • apps/admin-x-design-system/src/global/chrome/desktop-chrome-header.stories.tsx
  • apps/admin-x-design-system/src/global/chrome/desktop-chrome-header.tsx
  • apps/admin-x-design-system/src/global/error-boundary.stories.tsx
  • apps/admin-x-design-system/src/global/error-boundary.tsx
  • apps/admin-x-design-system/src/global/layout/view-container.stories.tsx
  • apps/admin-x-design-system/src/global/layout/view-container.tsx
  • apps/admin-x-design-system/src/global/legacy-hint.tsx
  • apps/admin-x-design-system/src/global/loading-indicator.stories.tsx
  • apps/admin-x-design-system/src/global/loading-indicator.tsx
  • apps/admin-x-design-system/src/global/separator.stories.tsx
  • apps/admin-x-design-system/src/global/separator.tsx
  • apps/admin-x-design-system/src/global/tooltip.stories.tsx
  • apps/admin-x-design-system/src/global/tooltip.tsx
  • apps/admin-x-design-system/src/index.ts
  • apps/admin-x-design-system/src/providers/design-system-provider.tsx
  • apps/admin-x-design-system/src/typings.d.ts
  • apps/admin-x-design-system/src/utils/debounce.ts
  • apps/admin-x-design-system/src/utils/format-url.ts
  • apps/admin-x-design-system/styles.base.css
  • apps/admin-x-design-system/styles.css
  • apps/admin-x-design-system/test/.eslintrc.cjs
  • apps/admin-x-design-system/test/unit/utils/format-url.test.ts
  • apps/admin-x-design-system/tsconfig.declaration.json
  • apps/admin-x-design-system/tsconfig.json
  • apps/admin-x-design-system/tsconfig.node.json
  • apps/admin-x-design-system/vite.config.ts
  • apps/admin-x-framework/src/test/render.tsx
  • apps/admin-x-framework/src/utils/focus-koenig-editor-on-bottom-click.ts
  • apps/admin-x-settings/package.json
  • apps/admin-x-settings/src/app.tsx
  • apps/admin-x-settings/src/components/code-editor-view.tsx
  • apps/admin-x-settings/src/components/koenig-editor-base.tsx
  • apps/admin-x-settings/src/components/settings/growth/embed-signup/embed-signup-form-modal.tsx
  • apps/admin-x-settings/src/components/settings/growth/embed-signup/embed-signup-preview.tsx
  • apps/admin-x-settings/src/components/settings/membership/member-emails/member-email-editor.tsx
  • apps/admin-x-settings/src/components/settings/membership/member-emails/welcome-email-modal.tsx
  • apps/admin-x-settings/src/main-content.tsx
  • apps/admin-x-settings/src/styles/index.css
  • apps/admin/package.json
  • apps/admin/src/app-root.tsx
  • apps/admin/src/index.css
  • apps/admin/src/settings/settings.tsx
  • apps/shade/scripts/extract-adoption.ts
  • apps/shade/src/app.ts
  • apps/shade/src/components/patterns/settings-modal.tsx
  • apps/shade/src/docs/adoption-dashboard.stories.tsx
  • apps/shade/src/docs/adoption-data.json
  • apps/shade/src/patterns.ts
  • apps/shade/src/providers/shade-provider.tsx
  • apps/shade/src/shade-app.tsx
  • configs/eslint-react/index.mjs
  • knip.json
  • package.json
💤 Files with no reviewable changes (52)
  • apps/admin-x-design-system/README.md
  • apps/admin-x-design-system/postcss.config.cjs
  • apps/admin-x-design-system/.gitignore
  • apps/admin-x-design-system/src/docs/Welcome.mdx
  • apps/admin-x-design-system/test/.eslintrc.cjs
  • apps/admin-x-design-system/src/global/loading-indicator.stories.tsx
  • apps/admin-x-design-system/.storybook/adminx-theme.tsx
  • apps/admin-x-design-system/.storybook/preview.tsx
  • apps/admin-x-design-system/src/docs/ErrorHandling.mdx
  • apps/admin-x-design-system/src/global/chrome/desktop-chrome-header.tsx
  • apps/admin/src/index.css
  • apps/admin-x-design-system/tsconfig.json
  • apps/admin-x-design-system/tsconfig.declaration.json
  • apps/admin-x-design-system/src/typings.d.ts
  • apps/admin-x-design-system/src/boilerplate.tsx
  • apps/admin-x-design-system/src/global/banner.tsx
  • apps/admin-x-design-system/src/providers/design-system-provider.tsx
  • apps/admin-x-design-system/tsconfig.node.json
  • apps/admin-x-design-system/src/design-system-app.tsx
  • apps/admin-x-design-system/src/global/error-boundary.stories.tsx
  • apps/admin-x-design-system/src/global/tooltip.stories.tsx
  • apps/admin-x-design-system/src/global/tooltip.tsx
  • apps/admin-x-design-system/src/utils/debounce.ts
  • apps/admin-x-design-system/.storybook/storybook.css
  • apps/admin-x-design-system/styles.base.css
  • apps/admin-x-design-system/src/global/chrome/desktop-chrome-header.stories.tsx
  • apps/admin-x-design-system/eslint.config.js
  • apps/admin-x-design-system/src/global/separator.tsx
  • apps/admin-x-settings/src/styles/index.css
  • apps/admin-x-design-system/styles.css
  • apps/admin-x-design-system/vite.config.ts
  • apps/admin-x-design-system/src/index.ts
  • apps/admin-x-design-system/src/utils/format-url.ts
  • apps/admin-x-design-system/src/docs/Layout.mdx
  • apps/admin-x-design-system/src/global/separator.stories.tsx
  • apps/admin-x-design-system/src/global/legacy-hint.tsx
  • apps/admin-x-design-system/preflight.css
  • apps/admin-x-design-system/.storybook/manager.tsx
  • apps/admin-x-design-system/src/docs/Colors.mdx
  • apps/admin-x-design-system/test/unit/utils/format-url.test.ts
  • apps/admin-x-design-system/src/global/loading-indicator.tsx
  • apps/admin-x-design-system/src/global/banner.stories.tsx
  • apps/admin-x-design-system/src/boilerplate.stories.tsx
  • apps/admin-x-design-system/src/global/layout/view-container.stories.tsx
  • apps/admin-x-design-system/.storybook/main.tsx
  • apps/admin-x-settings/package.json
  • apps/admin-x-design-system/src/global/layout/view-container.tsx
  • apps/admin-x-design-system/package.json
  • apps/admin-x-design-system/src/global/error-boundary.tsx
  • knip.json
  • apps/admin/package.json
  • apps/admin-x-design-system/src/docs/Icons.mdx

Comment on lines +51 to +55
const [resolvedExtensions, setResolvedExtensions] = React.useState<Extension[]>([]);
const [basicSetup, setBasicSetup] = useState<BasicSetupOptions>({
crosshairCursor: false
});
const {setFocusState} = useFocusContext();
const {darkMode, setFocusState} = useFocusContext();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== locate file =="
git ls-files | rg 'apps/admin-x-settings/src/components/code-editor-view\.tsx$' || true

echo "== file excerpt =="
sed -n '1,120p' apps/admin-x-settings/src/components/code-editor-view.tsx

echo "== package refs =="
rg -n '"`@uiw/react-codemirror`"|"admin-x-settings"|BasicSetupOptions|setBasicSetup|<BasicCodeMirror' -S --glob '!node_modules' .

Repository: TryGhost/Ghost

Length of output: 4883


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== workspace package/catalog for `@uiw/react-codemirror` =="
rg -n '"`@uiw/react-codemirror`"|catalog:' package.json pnpm-workspace.yaml pnpm-lock.yaml 2>/dev/null | head -80 || true

echo "== lockfile package entry =="
if [ -f pnpm-lock.yaml ]; then
  rg -n '`@uiw/react-codemirror`:' -A 8 pnpm-lock.yaml | head -80 || true
fi

echo "== installed package type definitions if available =="
for path in node_modules/@uiw/react-codemirror/index.d.ts node_modules/@uiw/react-codemirror/esm/index.d.ts node_modules/@uiw/react-codemirror/lib/index.d.ts node_modules/@uiw/react-codemirror/types/index.d.ts; do
  if [ -f "$path" ]; then
    echo "--- $path"
    sed -n '1,220p' "$path"
  fi
done

echo "== local package type definitions if available =="
if [ -f node_modules/@uiw/react-codemirror/package.json ]; then
  node -e "console.log(JSON.stringify(require('./node_modules/@uiw/react-codemirror/package.json'), null, 2))"
fi

echo "== TypeScript availability and structural check without repo code execution =="
node - <<'JS'
const fs = require('fs');
const path = 'node_modules/@uiw/react-codemirror/package.json';
try {
  const pkg = JSON.parse(fs.readFileSync(path, 'utf8'));
  console.log('package present:', path, 'version:', pkg.version, 'main:', pkg.main, 'types:', pkg.types);
} catch (e) {
  console.log('package not present locally');
}
JS

Repository: TryGhost/Ghost

Length of output: 4361


🌐 Web query:

@uiw/react-codemirror BasicSetupOptions interface basicSetup prop ReactCodeMirrorProps

💡 Result:

In the @uiw/react-codemirror package, the basicSetup prop in ReactCodeMirrorProps allows you to configure the built-in CodeMirror extensions [1][2][3]. It accepts either a boolean (to enable or disable the default basic setup) or an object conforming to the BasicSetupOptions interface to customize individual features [1][3][4]. The BasicSetupOptions interface, provided by the @uiw/codemirror-extensions-basic-setup package, defines the available configuration flags [5][6][2]. You can use this interface to toggle specific editor features such as line numbers, bracket matching, autocompletion, and various keymaps [5][6][7]. Key aspects of these options include: - Extends MinimalSetupOptions: It inherits settings like highlightSpecialChars, history, drawSelection, syntaxHighlighting, defaultKeymap, and historyKeymap [5][6][7]. - Customization flags: Includes boolean options for lineNumbers, highlightActiveLineGutter, foldGutter, dropCursor, allowMultipleSelections, indentOnInput, bracketMatching, closeBrackets, autocompletion, rectangularSelection, crosshairCursor, highlightActiveLine, highlightSelectionMatches, and several keymaps (closeBracketsKeymap, searchKeymap, foldKeymap, completionKeymap, lintKeymap) [5][6][7]. - tabSize: An optional number to set the indentation unit, which defaults to 2 spaces [5][6][7]. By passing an object to the basicSetup prop, you can precisely control which components of the basic setup are active in your CodeMirror instance [5][7]. Example usage: <CodeMirror value="console.log('hello world!');" basicSetup={{ lineNumbers: true, highlightActiveLineGutter: false, bracketMatching: true, autocompletion: true, tabSize: 4 }} />

Citations:


🌐 Web query:

github @uiw/react-codemirrorBasicSetupOptions interface@uiw/codemirror-extensions-basic-setup``

💡 Result:

The BasicSetupOptions interface in @uiw/react-codemirror and @uiw/codemirror-extensions-basic-setup is used to customize the default configuration of the CodeMirror 6 editor [1][2][3]. By providing this object to the basicSetup prop, you can enable or disable specific features [4][3]. The interface extends MinimalSetupOptions and includes the following configuration options [2][5]: BasicSetupOptions Members: - lineNumbers?: boolean - highlightActiveLineGutter?: boolean - foldGutter?: boolean - dropCursor?: boolean - allowMultipleSelections?: boolean - indentOnInput?: boolean - bracketMatching?: boolean - closeBrackets?: boolean - autocompletion?: boolean - rectangularSelection?: boolean - crosshairCursor?: boolean - highlightActiveLine?: boolean - highlightSelectionMatches?: boolean - closeBracketsKeymap?: boolean - searchKeymap?: boolean - foldKeymap?: boolean - completionKeymap?: boolean - lintKeymap?: boolean - tabSize?: number (Facet for overriding indentation unit, defaults to 2 spaces) [2][6] MinimalSetupOptions Members (included in BasicSetupOptions): - highlightSpecialChars?: boolean - history?: boolean - drawSelection?: boolean - syntaxHighlighting?: boolean - defaultKeymap?: boolean - historyKeymap?: boolean You can use these options in your React component as shown below [3]: import CodeMirror from '@uiw/react-codemirror'; function App { return ( <CodeMirror value="console.log('hello world!');" height="200px" basicSetup={{ foldGutter: false, dropCursor: false, allowMultipleSelections: false, indentOnInput: false, }} />); } The @uiw/codemirror-extensions-basic-setup package provides these utilities to simplify editor configuration, allowing for finer control than the default setup [2][3].

Citations:


🌐 Web query:

site:github.com/uiwjs/react-codemirror "interface BasicSetupOptions"

💡 Result:

The BasicSetupOptions interface is a TypeScript definition used in the @uiw/react-codemirror library to configure the default extensions enabled in a CodeMirror 6 editor component [1][2]. It allows developers to selectively enable or disable various built-in features of the basic setup [1][3]. The interface includes optional boolean flags for the following features [1][2]: lineNumbers: Toggles line number display. highlightActiveLineGutter: Toggles highlighting of the active line gutter. highlightSpecialChars: Toggles highlighting of special characters. history: Enables undo/redo history. foldGutter: Toggles the code folding gutter. drawSelection: Enables selection rendering. dropCursor: Enables the drop cursor. allowMultipleSelections: Allows multiple simultaneous selections. indentOnInput: Enables indentation on new lines. syntaxHighlighting: Enables syntax highlighting. bracketMatching: Enables bracket matching. closeBrackets: Enables automatic bracket closing. autocompletion: Enables autocompletion. rectangularSelection: Enables rectangular block selection. crosshairCursor: Enables crosshair cursor. highlightActiveLine: Enables active line highlighting. highlightSelectionMatches: Enables highlighting of selection matches. closeBracketsKeymap: Enables default bracket-related keybindings. defaultKeymap: Enables standard editor keybindings. searchKeymap: Enables search-related keybindings. historyKeymap: Enables history-related keybindings. foldKeymap: Enables folding-related keybindings. completionKeymap: Enables autocompletion-related keybindings. lintKeymap: Enables linting-related keybindings. By passing an object conforming to this interface to the basicSetup prop in the ReactCodeMirror component, you can customize which functionalities are active [1][3].

Citations:


Preserve the existing BasicSetupOptions fields.

The updater returns {setup, searchKeymap: false}, so setBasicSetup stores the previous options under an unsupported setup key and the initial crosshairCursor: false is lost. Spread the previous options instead.

Proposed fix
-        setBasicSetup(setup => ({setup, searchKeymap: false}));
+        setBasicSetup(setup => ({...setup, searchKeymap: false}));
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const [resolvedExtensions, setResolvedExtensions] = React.useState<Extension[]>([]);
const [basicSetup, setBasicSetup] = useState<BasicSetupOptions>({
crosshairCursor: false
});
const {setFocusState} = useFocusContext();
const {darkMode, setFocusState} = useFocusContext();
setBasicSetup(setup => ({...setup, searchKeymap: false}));
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/admin-x-settings/src/components/code-editor-view.tsx` around lines 51 -
55, The basicSetup updater must preserve the existing BasicSetupOptions fields
instead of nesting them under an unsupported setup key. Update the setBasicSetup
callback to spread the previous options and set searchKeymap to false, retaining
the initial crosshairCursor value.

<CardTitle>Ember legacy admin</CardTitle>
<CardDescription>
<code>ghost/admin</code> is the original Ember client. It doesn&apos;t use Shade or any
<code>apps/ember-admin</code> is the original Ember client. It doesn&apos;t use Shade or any

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use the same Ember path in the KPI card.

Line 260 now says apps/ember-admin, but the overview card at lines 101-103 still says ghost/admin. Update that card copy so the dashboard does not report two paths for the same app.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/shade/src/docs/adoption-dashboard.stories.tsx` at line 260, Update the
overview KPI card copy near the existing “ghost/admin” text to use
“apps/ember-admin”, matching the adoption-dashboard documentation at line 260.
Keep the card’s surrounding content and formatting unchanged.

export interface ShadeAppProps extends React.HTMLProps<HTMLDivElement> {
darkMode: boolean;
fetchKoenigLexical: null;
fetchKoenigLexical: FetchKoenigLexical | null;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
rg -n -C2 'interface ShadeAppProps|fetchKoenigLexical' \
  apps/shade/types/shade-app.d.ts \
  apps/shade/src/shade-app.tsx

Repository: TryGhost/Ghost

Length of output: 1783


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== FetchKoenigLexical definitions/usages in source =="
rg -n 'FetchKoenigLexical|typeFetchKoenigLexical|fetchKoenigLexical' apps/shade/src apps/admin/src/app-root.tsx

echo
echo "== Relevant shade-app.tsx =="
cat -n apps/shade/src/shade-app.tsx | sed -n '1,80p'

echo
echo "== Relevant admin app-root.tsx =="
cat -n apps/admin/src/app-root.tsx | sed -n '1,220p'

echo
echo "== FetchKoenigLexical declaration in shade declarations? =="
rg -n -C2 'FetchKoenigLexical' apps/shade/types

Repository: TryGhost/Ghost

Length of output: 4904


Keep fetchKoenigLexical consistent between ShadeAppProps and ShadeProviderProps.

apps/shade/types/shade-app.d.ts exposes fetchKoenigLexical: null in ShadeAppProps, but consumers pass a FetchKoenigLexical loader via apps/admin/src/app-root.tsx:18. Update ShadeAppProps.fetchKoenigLexical to FetchKoenigLexical | null so the published contract matches ShadeProviderProps.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/shade/src/shade-app.tsx` at line 14, Update the fetchKoenigLexical
property in the ShadeAppProps type to use FetchKoenigLexical | null, matching
ShadeProviderProps and allowing the loader passed by app-root consumers while
preserving nullability.

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.

1 participant