fix(files): only highlight accessible workspace file links - #11090
Open
cryppadotta wants to merge 3 commits into
Open
fix(files): only highlight accessible workspace file links#11090cryppadotta wants to merge 3 commits into
cryppadotta wants to merge 3 commits into
Conversation
Co-Authored-By: Paperclip <noreply@paperclip.ing>
Auto-detected workspace file paths in task comments were promoted to file-viewer chips purely on path shape, so missing, denied, ambiguous, remote, and non-previewable references looked actionable and failed on click. Chips now render only after the server confirms the current board session can open that exact reference: - Add an issue-scoped availability registry on the file-viewer provider. References found while rendering markdown are deduplicated by [workspace, projectId, workspaceId, path] (matching the server's dedup key), coalesced into one request per event-loop burst, chunked only above the 100-query cap, and never re-requested once cached or pending. - Cache batches on the shared issue file-resource query key with the viewer's existing 30s stale window, so invalidating the issue's file resources forces a recheck; new comments check only unseen references. - Turn remarkWorkspaceFileRefs into a factory taking a resolver. Pending, unavailable, denied, unsupported, remote, ambiguous, unmatched, and batch-error references fail closed to ordinary inline code with no icon, chip styling, button role, tooltip, or provisional link. Explicit markdown links stay ordinary links. - Bind openable chips to the resolved workspace selector and, for project workspaces, the resolved project/workspace IDs, so the click reuses the target that passed preflight instead of repeating auto discovery. Co-Authored-By: Paperclip <noreply@paperclip.ing>
Co-Authored-By: Paperclip <noreply@paperclip.ing>
Contributor
Author
|
@greptile review |
1 similar comment
Contributor
Author
|
@greptile review |
Contributor
Author
|
@greptileai review this |
Contributor
Author
|
@greptile-apps review |
Contributor
Author
|
@greptile 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.
Thinking Path
Linked Issues or Issue Description
What happened?
Task comments promoted path-shaped inline code to file chips before Paperclip checked the file. A chip could point to a missing, denied, ambiguous, remote, or non-previewable file. The action then failed after the user selected it.
Expected behavior
Paperclip must show a file chip only after the server confirms that the current board session can open the exact file reference. All other path-shaped text must stay ordinary inline code.
Steps to reproduce
Paperclip version or commit
19be4cf927and earlier.Deployment mode
Local dev and self-hosted server.
Access context
Board user.
What Changed
Verification
pnpm exec vitest run packages/shared/src/workspace-file-resource.test.ts server/src/__tests__/file-resources.test.ts ui/src/components/MarkdownBody.test.tsx ui/src/components/WorkspaceFileMarkdownBody.availability.test.tsx ui/src/lib/remark-workspace-file-refs.test.ts ui/src/lib/workspace-file-availability.test.ts— 93 passed, 35 skipped.pnpm check:token-gates— clean.pnpm -r typecheck— passed.pnpm build— passed.pnpm test:run— all server and UI groups passed. One unchanged CLI test saw the run-injected static AWS credentials and expected only its localAWS_PROFILE. The same test passed, 8 of 8, after removing onlyAWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEYfrom its process environment.Risks
Model Used
Checklist
Fixes: #/Closes #/Refs #OR (b) described the issue in-PR following the relevant issue template#NNN/github.com/paperclipai/paperclipURLs)docs/...,fix/...) and contains no internal Paperclip ticket id or instance-derived details