Open
Conversation
Signed-off-by: itvi-1234 <rjsumit71@gmail.com>
Contributor
Author
|
Hi @jdesrosiers , Could you please review this PR 🚀 |
jdesrosiers
requested changes
Mar 27, 2026
src/routes/+page.svelte
Outdated
Comment on lines
+37
to
+61
| try { | ||
| const uriObj = new URL(uri); | ||
| const baseObj = new URL(baseUri); | ||
|
|
||
| if (uriObj.origin === baseObj.origin) { | ||
| const uriParts = uriObj.pathname.split('/'); | ||
| const baseParts = baseObj.pathname.split('/'); | ||
| baseParts.pop(); | ||
|
|
||
| let i = 0; | ||
| while (i < uriParts.length && i < baseParts.length && uriParts[i] === baseParts[i]) { | ||
| i++; | ||
| } | ||
|
|
||
| let rel = ""; | ||
| for (let j = i; j < baseParts.length; j++) { | ||
| rel += "../"; | ||
| } | ||
| rel += uriParts.slice(i).join('/'); | ||
| if (uriObj.hash) rel += uriObj.hash; | ||
| label = rel; | ||
| } | ||
| } catch (_e) { | ||
| // Ignore invalid URIs | ||
| } |
Collaborator
There was a problem hiding this comment.
Use toRelativeIri from @hyperjump/uri.
src/routes/+page.svelte
Outdated
| // Ignore invalid URIs | ||
| } | ||
|
|
||
| label = label.replace(/\.(json|yaml|yml)$/i, ""); |
Collaborator
There was a problem hiding this comment.
If it's *.schema.json|yaml|whatever, it should remove the .schema also.
src/routes/+page.svelte
Outdated
Comment on lines
+68
to
+70
| if (label.length > 30) { | ||
| label = label.slice(0, 15) + "…" + label.slice(-10); | ||
| } |
Collaborator
There was a problem hiding this comment.
30 characters is much too long. Try 20. I don't think including the first characters necessary. Just the ellipsis and the last 20 or so characters should be enough. The most identifying information is usually at the end of the path.
src/routes/+page.svelte
Outdated
Comment on lines
+120
to
+168
| const externalId = selectedSchema === 0 ? schemaUrl : ""; | ||
| const externalId = index === 0 ? schemaUrl : ""; |
Signed-off-by: itvi-1234 <rjsumit71@gmail.com>
Contributor
Author
|
Hi @jdesrosiers , I have made some fixes , Could you please review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Done custom tab renaming
Screenshots: