Skip to content

fix: restore JSX indentation in design-principles.mdx#2266

Open
merchako wants to merge 3 commits into
mainfrom
docs/mdx-jsx-indentation
Open

fix: restore JSX indentation in design-principles.mdx#2266
merchako wants to merge 3 commits into
mainfrom
docs/mdx-jsx-indentation

Conversation

@merchako
Copy link
Copy Markdown
Contributor

@merchako merchako commented May 13, 2026

Summary

Context

This is the paranext-core half of a two-part change. The companion PR in ai-prompts adds a ## Storybook MDX Guidelines section to Code-Style-Guide.md documenting this convention, including an explicit note for LLMs and editors not to reformat MDX JSX blocks.

The style proposed (2-space block form, root element at 2 spaces, closing } at column 0) matches what TJ used when the file was originally written. Primary goal is reducing merge conflicts; secondary goal is readability. Happy to adjust if a different style is preferred — the important part is that something is documented.

Test plan

  • Open Storybook (cd lib/platform-bible-react && npm start) and verify the Guidelines/Design Principles page renders correctly
  • Confirm no TypeScript or lint errors

🤖 Generated with Claude Code


This change is Reviewable

…ilwind 4, new components) (#2207)

* Upgraded to React 19, Tailwind 4, new shadcn, build themes.data.json from index.css, cleaned up index.css, fonts.css, clarified data provider errors, added scripts to prepare for changing shadcn preset

* Apply shadcn preset via `npx shadcn apply --preset b6rt8cvlC` to re-add shadcn components from latest version as a new baseline

* chore: propagate shadcn preset CSS and package changes to extensions

* chore: re-apply project customizations to upgraded shadcn components

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Adjust platform to upgraded shadcn

chore: rebuild platform-bible-react dist and themes after shadcn upgrade

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

docs: add SKIPPED-CUSTOMIZATIONS.md for shadcn upgrade review

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Fixed rtl:tw: to tw:rtl:, fixed a few bugs with the shadcn components, fixed theme color stories not showing all the colors

Cleaned up radix imports, added spacing theme variable, fixed radius css variable usage

Moved new theme preset to
Paratext theme, fixed borders wrongly applying, misc cleanup

docs: add design spec for legacy HSL color var backwards compat

docs: add per-pass and total timing to legacy color var compat spec

docs: add React 19 backwards compatibility design spec

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

feat: add transformLegacyColorVars helper for backwards-compat hsl→var transform

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

feat: apply legacy hsl color var transform to WebView styles and content on load

Attempt to make React 19 and Tailwind 4 backwards-compatible with old extensions

Clean up, fix core storybook

Reverted skipLibCheck to false, applied lots of fixes accordingly

Fixed yalc messing up package-lock.json

fix: address review findings from /review-paratext

- Re-export public types `SelectTriggerProps` and `DropdownMenu*Props`
  (9 type aliases) that were dropped by the upstream shadcn baseline
- Fix `handleDataProviderSubscriptionError` log regression: discriminate
  three contexts ('retrieve-after-update' | 'retrieve-immediate' | 'callback')
  with a switch + exhaustiveness check; restores per-path log messages
- Remove unused `sheet.tsx` + the just-scaffolded story (YAGNI; arrived
  as a side effect of the shadcn preset apply, not exposed in index.ts)
- Remove stale AI-generated `CUSTOMIZATIONS.md`; update upgrade-shadcn
  workflow to require regeneration via `/shadcn-customizations` if missing
- Add 48 tests for `apply-shadcn-preset.ts` helpers + 6 fixture-based
  end-to-end pipeline tests; fix latent regex bug in `processLayerBase`
  (`\s+$` → `\s*$`) that produced `}}` instead of `}\n}` in the common case
- Add 6 tests for new `platform-dock-layout-storage.util.ts` exports
  (`findFirstWebViewDefinitionByType`, `loadLayout`)
- Fix pre-existing typo'd Tailwind classes in `tabs-vertical.tsx`
  (`tw:flex-fit`, `tw:mlk-items-center`, bare `overflow-clip`)
- Rename `util.test.ts` → `utils.test.ts` to match implementation filename
- Remove unused `yjs` and `scheduler` devDependencies; refresh lockfile
- Add storybook variants for badge ghost/link/blueIndicator/mutedIndicator
- Rebuild platform-bible-react dist artifacts

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* feat: add /add-shadcn-component command and supporting script

- Extract shared shadcn file-transform helpers into shadcn-transform-utils.ts
  (used by both apply-shadcn-preset.ts and the new add-shadcn-component.ts)
- Add scripts/add-shadcn-component.ts: adds a single shadcn component,
  applies standard file transforms, runs format and lint-fix, and
  auto-commits the baseline (matches apply-shadcn-preset.ts pattern).
  Takes <component> <preset> as args.
- Add npm 'add-shadcn-component' script
- Fix get-latest-preset
- Add fast path to cn() compat shim: when the resolved class string
  contains no `tw-` prefix (the dominant all-TW4 case), skip the
  per-token normalize/restore round-trip and call
  extendTailwindMerge({ prefix: 'tw' }) directly. Brings the all-TW4
  case from ~8x slower than baseline to within ~1.5x; TW3-containing
  strings still take the full slow path so dedup remains correct.

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
The shadcn/ui upgrade (ac37eda) stripped 2-space indentation from JSX
blocks inside preview={} props, leaving them flush-left. This restores
the original indentation style.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@merchako merchako force-pushed the docs/mdx-jsx-indentation branch from ee47089 to 8d1f8c9 Compare May 13, 2026 19:31
Copy link
Copy Markdown
Member

@tjcouch-sil tjcouch-sil left a comment

Choose a reason for hiding this comment

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

Oops! Sorry. Thanks!
:lgtm:

@tjcouch-sil reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved.

…flicts-HGvrS

# Conflicts:
#	lib/platform-bible-react/src/stories/guidelines/design-principles.mdx
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.

3 participants