Skip to content
This repository was archived by the owner on Oct 15, 2026. It is now read-only.

fix(frontend): preserve the app root path in share links - #3073

Open
ecoyoung wants to merge 1 commit into
Chainlit:mainfrom
ecoyoung:fix/share-root-path-3072
Open

ecoyoung wants to merge 1 commit into
Chainlit:mainfrom
ecoyoung:fix/share-root-path-3072

Conversation

@ecoyoung

@ecoyoung ecoyoung commented Oct 8, 2026 •

Copy link
Copy Markdown

Problem

Share links omit the app root path when Chainlit is served under a subpath. For example, /chat deployments generate /share/<id> instead of /chat/share/<id>.

Fix

Reuse getRouterBasename() in ShareDialog and remove the trailing slash before building the URL.

Scope

Package: @chainlit/app.

  • frontend/src/components/share/ShareDialog.tsx
  • frontend/tests/ShareDialog.spec.tsx

Tests

Added 7 cases covering root and nested paths, trailing slashes, displayed links, and clipboard copies for new and existing shares.

pnpm test (55 passed), pnpm lint, pnpm format-check, and pnpm type-check passed. Browser E2E tests were not run.

Fixes #3072.


Summary by cubic

Fixes share links dropping the app root path when Chainlit runs under a subpath, so /chat deployments now produce /chat/share/<id> instead of /share/<id>.

Reuses getRouterBasename() in ShareDialog and strips the trailing slash before building the share URL. Adds 7 unit test cases covering root and nested paths, trailing slashes, and clipboard copies for new and existing shares.

Written for commit ec6d9cc. Summary will update on new commits.

View guided diff

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 2 files

View guided diff | Re-trigger cubic

@ddl-h-morgan

Copy link
Copy Markdown

@dokterbob what is needed to get this merged?

This branch has not been deployed

No deployments
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Share dialog copies links without the app root path

2 participants