Skip to content

Conversation

@kentcdodds
Copy link
Member

@kentcdodds kentcdodds commented Jan 29, 2026

Use Playground app info for InlineFile components in Extras to ensure file links open in the Playground.


Open in Cursor Open in Web


Note

Low Risk
Low risk UI/UX change around editor link enablement; main risk is inadvertently disabling valid InlineFile links if playground/appName matching logic is wrong or loader data is missing.

Overview
Inline file editor links are now tied to the active Playground context. Extras’ MDX InlineFile links now resolve against the playground app (not the extra app) and are disabled with a tooltip until the playground is set to that extra.

Reusable disabled-state support was added to MDX inline-file rendering. createInlineFileComponent now accepts an optional getDisabledReason callback to render a consistent tooltip/disabled UI, and the exercise step InlineFile logic was updated to block playground opens until the playground matches the current step (with a small fix to render {children} properly when no app is available).

Written by Cursor Bugbot for commit 9e8a93e. This will update automatically on new commits. Configure here.

@cursor
Copy link

cursor bot commented Jan 29, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@nx-cloud
Copy link

nx-cloud bot commented Jan 29, 2026

View your CI Pipeline Execution ↗ for commit 9e8a93e

Command Status Duration Result
nx run-many --target typecheck ✅ Succeeded 10s View ↗
nx run-many --target build ✅ Succeeded <1s View ↗
nx lint ✅ Succeeded 23s View ↗

☁️ Nx Cloud last updated this comment at 2026-01-29 21:48:17 UTC

@kentcdodds kentcdodds marked this pull request as ready for review January 29, 2026 18:44
- Add fallback to data.extra when playground is null to preserve file link functionality
- Use specific properties in useMemo dependencies instead of entire playground object to prevent unnecessary re-computation

Co-authored-by: me <[email protected]>
@cursor
Copy link

cursor bot commented Jan 29, 2026

Bugbot Autofix resolved both of the 2 bugs found in the latest run.

  • ✅ Fixed: InlineFile disabled when no playground exists
    • Added fallback to data.extra properties when data.playground is null to preserve file link functionality.
  • ✅ Fixed: Imprecise useMemo dependency causes unnecessary re-computation
    • Changed useMemo dependency array from entire playground object to specific name and fullPath properties.

Add data.extra.name and data.extra.fullPath to the dependency array
to ensure the memo recomputes when navigating between extras without
a playground. Previously, when playground was null, the dependencies
remained [undefined, undefined], causing stale InlineFile closures.

Co-authored-by: me <[email protected]>
@cursor
Copy link

cursor bot commented Jan 29, 2026

Bugbot Autofix resolved the bug found in the latest run.

  • ✅ Fixed: Incomplete useMemo dependencies cause stale InlineFile closure
    • Added data.extra.name and data.extra.fullPath to the useMemo dependency array to ensure the memo recomputes when navigating between extras without a playground.

@cursor
Copy link

cursor bot commented Jan 29, 2026

Bugbot Autofix resolved the bug found in the latest run.

  • ✅ Fixed: InlineFile uses playground when app mismatch
    • Added check to ensure playground.appName matches extra.name before using playground info in InlineFile component, preventing file links from opening files in the wrong app directory.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

@kentcdodds kentcdodds merged commit f061239 into main Jan 29, 2026
10 checks passed
@kentcdodds kentcdodds deleted the cursor/extras-inline-file-opening-38cc branch January 29, 2026 22:06
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