paperclip/ui/src/lib
Devin Foley 8145141c55
Fix external issue URL rewriting in markdown (#4558)
## Thinking Path

> - Paperclip orchestrates AI agents for zero-human companies.
> - Issue and comment rendering is part of the board UI where humans
supervise and inspect agent work.
> - External Paperclip issue URLs can appear in comments as references
to other runs, review threads, or remote test environments.
> - Those links must preserve their full destination, including origin,
port, and `#comment-...` fragments, or the operator is taken to the
wrong place.
> - The bug here was that absolute `http(s)` issue URLs were being
normalized into internal `/issues/...` routes in the markdown path.
> - This pull request stops rewriting absolute URLs while keeping
internal issue-reference behavior for relative paths and identifiers.
> - The benefit is that authored external links now navigate exactly
where the operator expects, especially for remote test and
comment-deep-link workflows.

## What Changed

- Stopped `ui/src/lib/issue-reference.ts` from treating absolute
`http(s)` URLs as internal issue paths.
- Added defense-in-depth in `ui/src/lib/mention-chips.ts` so absolute
`http(s)` URLs are never reclassified as issue mention chips.
- Updated `ui/src/lib/issue-reference.test.ts` to cover absolute
Paperclip URLs with preserved origin, port, and comment hash.
- Updated `ui/src/components/MarkdownBody.test.tsx` to assert the
reported URL renders as an external link, not an internal `/issues/...`
href.

## Verification

- `pnpm exec vitest run ui/src/lib/issue-reference.test.ts
ui/src/components/MarkdownBody.test.tsx`
- Expected result: `2` files passed, `37` tests passed.
- Manual spot-check from the issue report path: a URL like
`http://remote.example.test:3103/PAPA/issues/PAPA-115#comment-...`
should remain an external link with its full destination preserved.

## Risks

- Low risk. The change narrows when Paperclip rewrites URLs, so the main
risk is if some existing workflow depended on absolute `http(s)`
Paperclip URLs being converted into internal issue links. The added
regression coverage is aimed at preventing that from regressing
silently.

## Model Used

- OpenAI Codex local agent via Paperclip `codex_local`
- Backing model family: GPT-5-based Codex runtime
- Exact backend model ID/version: not exposed by this adapter/runtime
surface
- Context window: not exposed by this adapter/runtime surface
- Capabilities used: tool use, shell command execution, code editing,
git operations, and local test execution

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [ ] If this change affects the UI, I have included before/after
screenshots
- [ ] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [ ] I will address all Greptile and reviewer comments before
requesting merge
2026-04-26 17:19:23 -07:00
..
activity-format.test.ts Track blocker and review activity events 2026-04-09 06:16:41 -05:00
activity-format.ts feat: implement multi-user access and invite flows (#3784) 2026-04-17 09:44:19 -05:00
agent-config-patch.test.ts fix(ui): persist cleared agent env bindings on save 2026-04-09 17:50:14 +00:00
agent-config-patch.ts fix(ui): persist cleared agent env bindings on save 2026-04-09 17:50:14 +00:00
agent-icons.ts Fix markdown mention chips 2026-03-23 16:57:27 -05:00
agent-order.ts Preserve sidebar order in company portability 2026-03-23 16:57:59 -05:00
agent-skills-state.test.ts Add unmanaged skill provenance to agent skills 2026-03-18 14:21:50 -05:00
agent-skills-state.ts Add unmanaged skill provenance to agent skills 2026-03-18 14:21:50 -05:00
assignees.test.ts Polish issue chat actions and overflow 2026-04-08 06:02:34 -05:00
assignees.ts feat: implement multi-user access and invite flows (#3784) 2026-04-17 09:44:19 -05:00
color-contrast.ts fix: improve pill contrast by using WCAG contrast ratios on composited backgrounds 2026-03-23 16:57:27 -05:00
comment-submit-draft.test.ts Fix optimistic comment draft clearing 2026-03-30 14:14:36 -05:00
comment-submit-draft.ts Fix optimistic comment draft clearing 2026-03-30 14:14:36 -05:00
company-export-selection.test.ts Default recurring task exports to checked 2026-03-23 16:57:38 -05:00
company-export-selection.ts Default recurring task exports to checked 2026-03-23 16:57:38 -05:00
company-members.test.ts feat: implement multi-user access and invite flows (#3784) 2026-04-17 09:44:19 -05:00
company-members.ts feat: implement multi-user access and invite flows (#3784) 2026-04-17 09:44:19 -05:00
company-page-memory.ts Add browser-based board CLI auth flow 2026-03-23 08:46:05 -05:00
company-portability-sidebar.test.ts Add SSH environment support (#4358) 2026-04-23 19:15:22 -07:00
company-portability-sidebar.ts Preserve sidebar order in company portability 2026-03-23 16:57:59 -05:00
company-routes.test.ts feat: implement multi-user access and invite flows (#3784) 2026-04-17 09:44:19 -05:00
company-routes.ts [codex] Improve workspace navigation and runtime UI (#4089) 2026-04-20 06:14:32 -05:00
company-selection.test.ts Fix manual company switch route sync 2026-03-13 09:47:01 -05:00
company-selection.ts Fix manual company switch route sync 2026-03-13 09:47:01 -05:00
document-revisions.test.ts fix(ui): keep latest issue document revision current (#3342) 2026-04-10 17:14:06 -07:00
document-revisions.ts fix(ui): keep latest issue document revision current (#3342) 2026-04-10 17:14:06 -07:00
groupBy.ts Add shared UI primitives, contexts, and reusable components 2026-02-17 09:57:00 -06:00
inbox.test.ts [codex] Add runtime lifecycle recovery and live issue visibility (#4419) 2026-04-24 15:50:32 -05:00
inbox.ts [codex] Add runtime lifecycle recovery and live issue visibility (#4419) 2026-04-24 15:50:32 -05:00
instance-settings.test.ts Add username log censor setting 2026-03-20 08:50:00 -05:00
instance-settings.ts Add username log censor setting 2026-03-20 08:50:00 -05:00
invite-memory.ts feat: implement multi-user access and invite flows (#3784) 2026-04-17 09:44:19 -05:00
issue-chat-messages.test.ts [codex] Add structured issue-thread interactions (#4244) 2026-04-21 20:15:11 -05:00
issue-chat-messages.ts [codex] Add runtime lifecycle recovery and live issue visibility (#4419) 2026-04-24 15:50:32 -05:00
issue-chat-scroll.test.ts [codex] Improve issue detail and issue-list UX (#3678) 2026-04-14 12:50:48 -05:00
issue-chat-scroll.ts [codex] Improve issue detail and issue-list UX (#3678) 2026-04-14 12:50:48 -05:00
issue-detail-subissues.test.ts Present ordered sub-issues as a workflow checklist (#4523) 2026-04-26 07:36:49 -05:00
issue-detail-subissues.ts Present ordered sub-issues as a workflow checklist (#4523) 2026-04-26 07:36:49 -05:00
issue-execution-policy.ts fix execution policy decision persistence 2026-04-07 17:43:10 -05:00
issue-filters.test.ts [codex] Add runtime lifecycle recovery and live issue visibility (#4419) 2026-04-24 15:50:32 -05:00
issue-filters.ts [codex] Add runtime lifecycle recovery and live issue visibility (#4419) 2026-04-24 15:50:32 -05:00
issue-properties-panel-key.test.ts [codex] Polish issue board workflows (#4224) 2026-04-21 12:25:34 -05:00
issue-properties-panel-key.ts [codex] Polish issue board workflows (#4224) 2026-04-21 12:25:34 -05:00
issue-reference.test.ts Fix external issue URL rewriting in markdown (#4558) 2026-04-26 17:19:23 -07:00
issue-reference.ts Fix external issue URL rewriting in markdown (#4558) 2026-04-26 17:19:23 -07:00
issue-thread-interactions.test.ts [codex] Add structured issue-thread interactions (#4244) 2026-04-21 20:15:11 -05:00
issue-thread-interactions.ts [codex] Add structured issue-thread interactions (#4244) 2026-04-21 20:15:11 -05:00
issue-timeline-events.test.ts [codex] Add runtime lifecycle recovery and live issue visibility (#4419) 2026-04-24 15:50:32 -05:00
issue-timeline-events.ts [codex] Add runtime lifecycle recovery and live issue visibility (#4419) 2026-04-24 15:50:32 -05:00
issue-tree.test.ts [codex] Improve issue thread review flow (#4381) 2026-04-24 08:02:45 -05:00
issue-tree.ts [codex] Improve issue thread review flow (#4381) 2026-04-24 08:02:45 -05:00
issueActiveRun.test.ts Fix stale issue live-run state 2026-04-12 20:41:31 -05:00
issueActiveRun.ts Fix stale issue live-run state 2026-04-12 20:41:31 -05:00
issueChatTranscriptRuns.test.ts Refine issue workflow surfaces and live updates 2026-04-09 10:26:17 -05:00
issueChatTranscriptRuns.ts [codex] Add runtime lifecycle recovery and live issue visibility (#4419) 2026-04-24 15:50:32 -05:00
issueDetailBreadcrumb.test.ts Refine issue workflow surfaces and live updates 2026-04-09 10:26:17 -05:00
issueDetailBreadcrumb.ts [codex] Add runtime lifecycle recovery and live issue visibility (#4419) 2026-04-24 15:50:32 -05:00
issueDetailCache.test.ts Fix rebased issue detail prefetch typing 2026-04-12 21:18:57 -05:00
issueDetailCache.ts [codex] harden authenticated routes and issue editor reliability (#3741) 2026-04-15 08:41:15 -05:00
issueDetailQuery.test.tsx [codex] harden authenticated routes and issue editor reliability (#3741) 2026-04-15 08:41:15 -05:00
keyboardShortcuts.test.ts [codex] Improve workspace runtime and navigation ergonomics (#3680) 2026-04-14 12:57:11 -05:00
keyboardShortcuts.ts [codex] Improve workspace runtime and navigation ergonomics (#3680) 2026-04-14 12:57:11 -05:00
legacy-agent-config.test.ts Hide deprecated agent working directory by default 2026-03-20 07:04:41 -05:00
legacy-agent-config.ts Hide deprecated agent working directory by default 2026-03-20 07:04:41 -05:00
liveIssueIds.test.ts [codex] Add runtime lifecycle recovery and live issue visibility (#4419) 2026-04-24 15:50:32 -05:00
liveIssueIds.ts [codex] Add runtime lifecycle recovery and live issue visibility (#4419) 2026-04-24 15:50:32 -05:00
main-content-focus.test.ts Fix issue detail main-pane focus on navigation 2026-04-09 06:18:27 -05:00
main-content-focus.ts Fix issue detail main-pane focus on navigation 2026-04-09 06:18:27 -05:00
markdownPaste.test.ts Fix markdown paste handling in document editor (#2572) 2026-04-03 08:50:48 -07:00
markdownPaste.ts Fix markdown paste handling in document editor (#2572) 2026-04-03 08:50:48 -07:00
mention-aware-link-node.test.ts Extract mention-aware link node helper and add tests 2026-03-23 20:46:19 -05:00
mention-aware-link-node.ts Refine issue workflow surfaces and live updates 2026-04-09 10:26:17 -05:00
mention-chips.ts Fix external issue URL rewriting in markdown (#4558) 2026-04-26 17:19:23 -07:00
mention-deletion.test.ts Fix atomic markdown mention deletion 2026-03-23 16:57:27 -05:00
mention-deletion.ts Fix atomic markdown mention deletion 2026-03-23 16:57:27 -05:00
model-utils.ts Fix remaining OpenCode review comments 2026-03-05 16:07:12 +01:00
navigation-scroll.test.ts Reset scroll on issue detail navigation 2026-04-12 21:14:12 -05:00
navigation-scroll.ts Reset scroll on issue detail navigation 2026-04-12 21:14:12 -05:00
new-agent-hire-payload.test.ts Add SSH environment support (#4358) 2026-04-23 19:15:22 -07:00
new-agent-hire-payload.ts Add SSH environment support (#4358) 2026-04-23 19:15:22 -07:00
new-agent-runtime-config.test.ts [codex] Improve agent runtime recovery and governance (#4086) 2026-04-20 06:19:48 -05:00
new-agent-runtime-config.ts [codex] Improve agent runtime recovery and governance (#4086) 2026-04-20 06:19:48 -05:00
normalize-markdown.test.ts fix: autoformat pasted markdown in inline editor (#2673) 2026-04-04 11:21:27 -07:00
normalize-markdown.ts fix: autoformat pasted markdown in inline editor (#2673) 2026-04-04 11:21:27 -07:00
onboarding-goal.test.ts Improve onboarding defaults and issue goal fallback 2026-03-12 08:50:31 -05:00
onboarding-goal.ts Improve onboarding defaults and issue goal fallback 2026-03-12 08:50:31 -05:00
onboarding-launch.test.ts Seed onboarding project and issue goal context 2026-03-24 11:48:59 -05:00
onboarding-launch.ts Seed onboarding project and issue goal context 2026-03-24 11:48:59 -05:00
onboarding-route.test.ts test: harden onboarding route coverage 2026-03-18 08:00:02 -05:00
onboarding-route.ts test: harden onboarding route coverage 2026-03-18 08:00:02 -05:00
optimistic-issue-comments.test.ts Fix disappearing issue comments (#4557) 2026-04-26 16:23:53 -07:00
optimistic-issue-comments.ts Fix disappearing issue comments (#4557) 2026-04-26 16:23:53 -07:00
optimistic-issue-runs.test.ts [codex] Polish issue board workflows (#4224) 2026-04-21 12:25:34 -05:00
optimistic-issue-runs.ts [codex] Polish issue board workflows (#4224) 2026-04-21 12:25:34 -05:00
paste-normalization.ts fix: autoformat pasted markdown in inline editor (#2673) 2026-04-04 11:21:27 -07:00
portable-files.ts Add company logo portability support 2026-03-19 07:24:04 -05:00
project-order.ts refactor: rename packages to @paperclipai and CLI binary to paperclipai 2026-03-03 08:45:26 -06:00
project-workspaces-tab.test.ts [codex] Improve workspace navigation and runtime UI (#4089) 2026-04-20 06:14:32 -05:00
project-workspaces-tab.ts [codex] Improve workspace navigation and runtime UI (#4089) 2026-04-20 06:14:32 -05:00
query-placeholder-data.test.tsx [codex] Improve issue detail and issue-list UX (#3678) 2026-04-14 12:50:48 -05:00
query-placeholder-data.ts [codex] Improve issue detail and issue-list UX (#3678) 2026-04-14 12:50:48 -05:00
queryKeys.ts [codex] Improve issue thread review flow (#4381) 2026-04-24 08:02:45 -05:00
recent-assignees.ts [codex] Polish issue and operator workflow UI (#4090) 2026-04-20 06:16:41 -05:00
recent-projects.ts [codex] Polish issue and operator workflow UI (#4090) 2026-04-20 06:16:41 -05:00
recent-selections.test.ts [codex] Polish issue and operator workflow UI (#4090) 2026-04-20 06:16:41 -05:00
recent-selections.ts [codex] Polish issue and operator workflow UI (#4090) 2026-04-20 06:16:41 -05:00
remark-soft-breaks.ts feat: polish issue thread markdown and references 2026-04-10 22:26:21 -05:00
router.tsx Sync/master post pap1497 followups 2026 04 15 (#3779) 2026-04-15 21:13:56 -05:00
routine-trigger-patch.test.ts fix: address greptile routine review 2026-03-20 16:26:29 -05:00
routine-trigger-patch.ts fix: address greptile routine review 2026-03-20 16:26:29 -05:00
runRetryState.test.ts [codex] Add runtime lifecycle recovery and live issue visibility (#4419) 2026-04-24 15:50:32 -05:00
runRetryState.ts [codex] Add runtime lifecycle recovery and live issue visibility (#4419) 2026-04-24 15:50:32 -05:00
status-colors.ts [codex] Harden heartbeat scheduling and runtime controls (#4223) 2026-04-21 12:24:11 -05:00
subIssueDefaults.test.ts [codex] Improve issue detail and issue-list UX (#3678) 2026-04-14 12:50:48 -05:00
subIssueDefaults.ts [codex] Improve issue detail and issue-list UX (#3678) 2026-04-14 12:50:48 -05:00
timeAgo.ts Add shared UI primitives, contexts, and reusable components 2026-02-17 09:57:00 -06:00
transcriptPresentation.test.ts Polish issue chat chain-of-thought rendering 2026-04-08 06:02:34 -05:00
transcriptPresentation.ts Polish issue chat chain-of-thought rendering 2026-04-08 06:02:34 -05:00
utils.ts [codex] Polish issue board workflows (#4224) 2026-04-21 12:25:34 -05:00
vite-watch.test.ts [codex] fix worktree dev dependency ergonomics (#3743) 2026-04-15 09:47:29 -05:00
vite-watch.ts [codex] fix worktree dev dependency ergonomics (#3743) 2026-04-15 09:47:29 -05:00
workflow-sort.test.ts Present ordered sub-issues as a workflow checklist (#4523) 2026-04-26 07:36:49 -05:00
workflow-sort.ts Present ordered sub-issues as a workflow checklist (#4523) 2026-04-26 07:36:49 -05:00
worktree-branding.ts Add worktree UI branding 2026-03-13 11:12:43 -05:00
zip.test.ts Handle directory entries in imported zip archives 2026-03-20 14:09:21 -05:00
zip.ts Handle directory entries in imported zip archives 2026-03-20 14:09:21 -05:00