-
Notifications
You must be signed in to change notification settings - Fork 12
Fix code-mode navigation of filedef links #3872
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fix code-mode navigation of filedef links #3872
Conversation
Preview deployments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes navigation of FileDef links in code mode by preventing automatic extension fallbacks for files that already have non-executable extensions. Previously, requests for files like .md would incorrectly attempt to add executable extensions or redirect.
Changes:
- Added
hasExtension()utility function to detect if a path contains a file extension - Modified realm file handling to skip extension fallbacks for non-executable files with extensions
- Updated code mode navigation to use
hasExtension()instead of checking only for.jsonextension
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/runtime-common/url.ts | Adds hasExtension() helper to detect file extensions in URLs or paths |
| packages/runtime-common/realm.ts | Updates file request handling to avoid fallback extensions for non-executable files that already have extensions |
| packages/realm-server/tests/card-source-endpoints-test.ts | Adds test verifying non-executable files (e.g., .md) are served without redirect |
| packages/host/tests/acceptance/code-submode/file-def-navigation-test.gts | Adds acceptance test for navigating to markdown files via FileDef links in code mode |
| packages/host/app/components/operator-mode/code-submode/module-inspector.gts | Updates card navigation to use hasExtension() for broader file type support |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Host Test Results 1 files ± 0 1 suites ±0 1h 38m 7s ⏱️ + 9m 20s Results for commit 8397b84. ± Comparison against base commit 743df5f. This pull request removes 1 and adds 214 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.