Skip to content

Conversation

@SeanCassiere
Copy link
Member

@SeanCassiere SeanCassiere commented Mar 22, 2025

Fixes an issue with the code-explorer dying when it couldn't resolve to child directories within the examplePath.

For example, when trying to start fetching the contents for examples/react/pagination/src, where the leaf /src directory did not exist, the whole application would simply fail.

To fix this, the contents will always be fetched from the contents API from the base of the examplePath (i.e. examples/react/pagination). From there on, once the contents have been fetched, the logic in determineStartingFilePath will resolve it to the correct starting file-path to have correct file opened in the explorer.

This results in a UI change, where the contents of the file-tree will differ from the existing implementation.

Important

The default opened/"starting file" will remain the same for users.

Old:
image

New:
image

@netlify
Copy link

netlify bot commented Mar 22, 2025

Deploy Preview for tanstack ready!

Name Link
🔨 Latest commit bc161e4
🔍 Latest deploy log https://app.netlify.com/sites/tanstack/deploys/67df2a7edd868e0008571310
😎 Deploy Preview https://deploy-preview-376--tanstack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 48 (🟢 up 15 from production)
Accessibility: 95 (no change from production)
Best Practices: 83 (🔴 down 9 from production)
SEO: 77 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@SeanCassiere SeanCassiere marked this pull request as ready for review March 22, 2025 21:30
}
const res = await fetch(
`https://api.github.com/repos/${repo}/contents/${startingPath}?=${branch}`,
`https://api.github.com/repos/${repo}/contents/${startingPath}?ref=${branch}`,
Copy link
Member Author

@SeanCassiere SeanCassiere Mar 22, 2025

Choose a reason for hiding this comment

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

This is what caused index.tsx to show up even though the actual file in the repo (under the target branch) was index.js.

@KevinVandy KevinVandy merged commit 8dc52df into main Mar 23, 2025
6 checks passed
@KevinVandy KevinVandy deleted the fix/code-explorer-starting-point branch March 23, 2025 02:09
LeCarbonator pushed a commit to LeCarbonator/tanstack.com that referenced this pull request Jan 11, 2026
…ack#376)

* underlying bug of not passing the branch ref

* re-enable dev/prod behaviour

* display contents from root but find the starting file

* better comments for future adventurers
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