Skip to content

fix(web): open assistant workspace links in-app - #351

Open
Rinat S (rsolmano) wants to merge 9 commits into
mainfrom
fix/chat-workspace-links
Open

fix(web): open assistant workspace links in-app#351
Rinat S (rsolmano) wants to merge 9 commits into
mainfrom
fix/chat-workspace-links

Conversation

@rsolmano

@rsolmano Rinat S (rsolmano) commented Aug 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fix assistant-authored relative Markdown links so workspace evidence opens as a file tab in the active ThinkRail workbench instead of resolving against the browser origin and loading another SPA instance.

Changes

  • add an assistant-only Markdown link adapter that routes validated workspace-contained paths through the existing ChatTurnView file-open callback
  • reuse the structured-tool path canonicalizer, decode percent-encoded paths before containment checks, and fail closed for malformed encoding or encoded traversal
  • render accepted workspace targets as in-app button controls without a raw href; keep external URLs, protocol-relative URLs, fragments, rejected paths, and links without workspace context as safe new-tab anchors
  • keep the generic Markdown primitive props-driven and preserve a stable renderer identity across workbench focus rerenders
  • add unit and browser regression coverage for classification, containment, native-navigation prevention, and opening the preview file tab

Deliberately excluded: no protocol-version enforcement, transport change, legacy layout RPC compatibility, or other layout behavior is included in this follow-up.

Testing

  • bun run e2e — 302 passed across 8 shards
  • bun run e2e -- e2e/tool-file-links.spec.ts — 2 passed
  • bun run test — all 14 package tasks passed; server 845/845
  • bun test apps/web/src/chat/assistantLinks.test.tsx apps/web/src/chat/tools/ToolFileLinks.test.ts — 7 passed
  • bun run check:deps && bun run check:boundaries && bun run check:seams — all OK
  • bun run lint — passed with six pre-existing unused-suppression warnings
  • bun run typecheck — 14/14 tasks passed
  • isolated manual browser validation — the assistant workspace control opened README.md as a preview tab while external and rejected targets remained browser links

Screenshots

Before: relative assistant link is a browser anchor

Before — relative assistant link

Activating it opens another ThinkRail SPA at /README.md instead of the file:

Before — SPA fallback

After: workspace target is an in-app control

After — workspace file control

Activating it opens the existing workbench's README.md preview tab:

After — README preview

ThinkRail-Todo: 01a052bd-94dc-7921-b0ce-d561c74f094a/t_80a9b99c517a
ThinkRail-Todo: 01a052bd-94dc-7921-b0ce-d561c74f094a/t_94aa4f1bf4cf
ThinkRail-Todo: 01a052bd-94dc-7921-b0ce-d561c74f094a/t_e420a5e12eb5

@jetbrains-air jetbrains-air 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.

Approved — ready to merge.

@rsolmano
Rinat S (rsolmano) enabled auto-merge (squash) August 30, 2026 16:59

@jetbrains-air jetbrains-air 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.

Approved — ready to merge.

@jetbrains-air jetbrains-air 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.

Requesting changes — please address the blocking inline finding.

Comment thread apps/web/src/chat/assistantLinks.tsx Outdated

@jetbrains-air jetbrains-air 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.

Requesting changes — please address the blocking inline findings.

Comment thread apps/web/src/chat/assistantLinks.tsx Outdated

@jetbrains-air jetbrains-air 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.

Requesting changes — please address the blocking inline finding.

Comment thread apps/web/src/chat/fileTargets.ts

@jetbrains-air jetbrains-air 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.

Approved — ready to merge.

@jetbrains-air jetbrains-air 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.

Approved — ready to merge.

@rsolmano
Rinat S (rsolmano) added this pull request to the merge queue Sep 1, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Sep 1, 2026
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.

2 participants