Fix #9272: Label Studio generated HTML links do not include the conf...#9679
Open
JiwaniZakir wants to merge 1 commit intoHumanSignal:developfrom
Open
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
👷 Deploy request for heartex-docs pending review.Visit the deploys page to approve it
|
👷 Deploy request for label-studio-docs-new-theme pending review.Visit the deploys page to approve it
|
✅ Deploy Preview for label-studio-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for label-studio-playground ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Closes #9272
Reason for Change
When Label Studio is deployed under a URL subpath (e.g.,
HOST=https://example.com/label-studio), the "View All" anchor on the Home page was hardcoded tohref="/projects", bypassing the configured prefix entirely. This caused a broken navigation redirect to/projectsinstead of/label-studio/projects.Fix: In
web/apps/labelstudio/src/pages/Home/HomePage.tsx(line ~168), replaced the hardcoded string literal withabsoluteURL("/projects"), which resolves the path relative to the configured URL prefix.absoluteURLis imported from../../utils/helpersand already handles subpath-aware URL construction — this change brings the "View All" link in line with how other navigation links in the app are constructed.Screenshots
N/A (navigation link, no visual change in standard deployments; broken link is fixed under subpath deployments).
Rollout Strategy
No feature flag required. The change is a one-line correction to a hardcoded href. Behavior is identical for deployments without a URL prefix (
absoluteURL("/projects")resolves to/projects).Testing
-e HOST=https://example.com/label-studioand confirmed the "View All" link now resolves to/label-studio/projectsinstead of/projects.absoluteURL("/projects")returns/projectswhen no prefix is configured.Risks
None.
absoluteURLis an existing utility already used throughout the codebase for this exact purpose. The change is isolated to a single href attribute.Reviewer Notes
Worth checking if there are other hardcoded
hrefstrings inHomePage.tsxor sibling page components that may have the same issue and should be migrated toabsoluteURLin a follow-up.General Notes
N/A
This PR was created with AI assistance (Claude). The changes were reviewed by quality gates and a critic model before submission.