paperclip/ui/src/components
Devin Foley 548721248e
fix(ui): keep latest issue document revision current (#3342)
## Thinking Path

> - Paperclip orchestrates AI agents for zero-human companies.
> - Board users and agents collaborate on issue-scoped documents such as
plans and revisions need to be trustworthy because they are the audit
trail for those artifacts.
> - The issue document UI now supports revision history and restore, so
the UI has to distinguish the current revision from historical revisions
correctly even while multiple queries are refreshing.
> - In `PAPA-72`, the newest content could appear under an older
revision label because the current document snapshot and the
revision-history query could temporarily disagree after an edit.
> - That made the UI treat the newest revision like a historical restore
target, which is the opposite of the intended behavior.
> - This pull request derives one authoritative revision view from both
sources, sorts revisions newest-first, and keeps the freshest revision
marked current.
> - The benefit is that revision history stays stable and trustworthy
immediately after edits instead of briefly presenting the newest content
as an older revision.

## What Changed

- Added a `document-revisions` helper that merges the current document
snapshot with fetched revision history into one normalized revision
state.
- Updated `IssueDocumentsSection` to render from that normalized state
instead of trusting either query in isolation.
- Added focused tests covering the current-revision selection and
ordering behavior.

## Verification

- `pnpm -r typecheck`
- `pnpm build`
- Targeted revision tests passed locally.
- Manual reviewer check:
  - Open an issue document with revision history.
  - Edit and save the document.
  - Immediately open the revision selector.
- Confirm the newest revision remains marked current and older revisions
remain the restore targets.

## Risks

- Low risk. The change is isolated to issue document revision
presentation in the UI.
- Main risk is merging the current snapshot with fetched history
incorrectly for edge cases, which is why the helper has focused unit
coverage.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [ ] 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
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] I will address all Greptile and reviewer comments before
requesting merge
2026-04-10 17:14:06 -07:00
..
transcript Refine issue workflow surfaces and live updates 2026-04-09 10:26:17 -05:00
ui fix(ui): avoid issue detail ref update loops 2026-04-09 06:18:05 -05:00
AccountingModelCard.tsx feat(costs): add billing, quota, and budget control plane 2026-03-16 15:11:01 -05:00
ActiveAgentsPanel.tsx Refine issue workflow surfaces and live updates 2026-04-09 10:26:17 -05:00
ActivityCharts.tsx refactor: rename packages to @paperclipai and CLI binary to paperclipai 2026-03-03 08:45:26 -06:00
ActivityRow.tsx Track blocker and review activity events 2026-04-09 06:16:41 -05:00
agent-config-defaults.ts fix(ui): polish issue detail timelines and attachments 2026-04-02 11:51:40 -05:00
agent-config-primitives.tsx Unify all toggle switches into a single responsive ToggleSwitch component 2026-04-04 17:48:54 -05:00
AgentActionButtons.tsx Redesign routines UI to match issue page design language 2026-03-19 15:05:32 -05:00
AgentConfigForm.tsx Disable timer heartbeats by default for new agents 2026-04-09 06:16:05 -05:00
AgentIconPicker.tsx Fix markdown mention chips 2026-03-23 16:57:27 -05:00
AgentProperties.tsx feat(adapters): external adapter plugin system with dynamic UI parser 2026-04-03 21:11:20 +01:00
ApprovalCard.tsx Polish board approval card styling 2026-04-06 21:24:44 -05:00
ApprovalPayload.test.tsx Polish board approval card styling 2026-04-06 21:24:44 -05:00
ApprovalPayload.tsx Polish board approval card styling 2026-04-06 21:24:44 -05:00
AsciiArtAnimation.tsx feat(ui): reconcile backup UI changes with current routing and interaction features 2026-03-02 16:44:03 -06:00
BillerSpendCard.tsx feat(costs): add billing, quota, and budget control plane 2026-03-16 15:11:01 -05:00
BreadcrumbBar.tsx Fix plugin launchers initialization by adding enabled flag based on companyId 2026-03-14 15:35:01 -07:00
BudgetIncidentCard.tsx feat(costs): add billing, quota, and budget control plane 2026-03-16 15:11:01 -05:00
BudgetPolicyCard.tsx Add budget tabs and sidebar budget indicators 2026-03-16 15:11:01 -05:00
BudgetSidebarMarker.tsx Add budget tabs and sidebar budget indicators 2026-03-16 15:11:01 -05:00
ClaudeSubscriptionPanel.tsx feat(costs): add billing, quota, and budget control plane 2026-03-16 15:11:01 -05:00
CodexSubscriptionPanel.tsx feat(costs): add billing, quota, and budget control plane 2026-03-16 15:11:01 -05:00
CommandPalette.tsx Speed up issue search 2026-04-06 21:25:41 -05:00
CommentThread.test.tsx Improve mobile comment copy button feedback 2026-04-09 06:18:05 -05:00
CommentThread.tsx Refine issue workflow surfaces and live updates 2026-04-09 10:26:17 -05:00
CompanyPatternIcon.tsx Add support for company logos, including schema adjustments, validation, assets handling, and UI display enhancements. 2026-03-06 16:39:35 -05:00
CompanyRail.tsx Restrict sidebar reordering to mouse input 2026-03-29 10:57:34 -05:00
CompanySwitcher.tsx feat(ui): reconcile backup UI changes with current routing and interaction features 2026-03-02 16:44:03 -06:00
CopyText.tsx fix: copy button fallback for non-secure contexts (#2472) 2026-04-01 20:16:52 -07:00
DevRestartBanner.tsx fix: address greptile follow-up feedback 2026-03-20 13:18:29 -05:00
DocumentDiffModal.tsx refactor(ui): inline document diff rendering 2026-04-06 21:43:19 -05:00
EmptyState.tsx Polish UI components and rework AgentConfigForm 2026-02-18 10:43:25 -06:00
EntityRow.tsx feat(ui): reconcile backup UI changes with current routing and interaction features 2026-03-02 16:44:03 -06:00
EnvVarEditor.tsx Add project-level environment variables 2026-04-06 21:23:30 -05:00
ExecutionParticipantPicker.tsx Move reviewer/approver pickers to inline header pills 2026-04-07 17:43:10 -05:00
ExecutionWorkspaceCloseDialog.tsx Fix horizontal scroll overflow in close workspace modal 2026-04-04 17:48:54 -05:00
FilterBar.tsx Add shared UI primitives, contexts, and reusable components 2026-02-17 09:57:00 -06:00
FinanceBillerCard.tsx feat(costs): add billing, quota, and budget control plane 2026-03-16 15:11:01 -05:00
FinanceKindCard.tsx feat(costs): add billing, quota, and budget control plane 2026-03-16 15:11:01 -05:00
FinanceTimelineCard.tsx feat(costs): add billing, quota, and budget control plane 2026-03-16 15:11:01 -05:00
GoalProperties.tsx refactor: rename packages to @paperclipai and CLI binary to paperclipai 2026-03-03 08:45:26 -06:00
GoalTree.tsx fix(ui): render sub-goals in goal detail tree 2026-03-04 20:20:21 -07:00
HermesIcon.tsx feat(hermes): upgrade hermes-paperclip-adapter + UI adapter + skills + detectModel 2026-03-28 01:34:48 +01:00
Identity.tsx Fix xs avatar alignment and dashboard task row layout 2026-02-20 11:35:59 -06:00
ImageGalleryModal.tsx fix(ui): polish issue detail timelines and attachments 2026-04-02 11:51:40 -05:00
InlineEditor.test.tsx fix: allow to remove project description (#2338) 2026-04-06 13:18:38 -07:00
InlineEditor.tsx Support dropping non-image files onto markdown editor as attachments 2026-04-06 21:24:12 -05:00
InlineEntitySelector.tsx Add draft routine defaults and run-time overrides 2026-04-09 10:19:52 -05:00
InstanceSidebar.tsx Refine issue workflow surfaces and live updates 2026-04-09 10:26:17 -05:00
IssueChatThread.test.tsx Guard issue chat against assistant-ui crashes 2026-04-09 06:21:14 -05:00
IssueChatThread.tsx Refine issue workflow surfaces and live updates 2026-04-09 10:26:17 -05:00
IssueColumns.tsx Polish shared issue columns trigger styling 2026-04-09 06:18:05 -05:00
IssueDocumentsSection.test.tsx fix(ui): keep latest issue document revision current (#3342) 2026-04-10 17:14:06 -07:00
IssueDocumentsSection.tsx fix(ui): keep latest issue document revision current (#3342) 2026-04-10 17:14:06 -07:00
IssueFiltersPopover.tsx Refine issue workflow surfaces and live updates 2026-04-09 10:26:17 -05:00
IssueProperties.test.tsx Add explicit review start action in issue sidebar 2026-04-09 06:21:14 -05:00
IssueProperties.tsx Add explicit review start action in issue sidebar 2026-04-09 06:21:14 -05:00
IssueRow.test.tsx fix(ui): keep issue breadcrumb context out of the URL 2026-04-06 21:24:12 -05:00
IssueRow.tsx Refine issue workflow surfaces and live updates 2026-04-09 10:26:17 -05:00
IssuesList.test.tsx Refine issue workflow surfaces and live updates 2026-04-09 10:26:17 -05:00
IssuesList.tsx Refine issue workflow surfaces and live updates 2026-04-09 10:26:17 -05:00
IssuesQuicklook.tsx Refine issue workflow surfaces and live updates 2026-04-09 10:26:17 -05:00
IssueWorkspaceCard.test.tsx Improve issue detail load stability 2026-04-09 06:21:14 -05:00
IssueWorkspaceCard.tsx Improve issue detail load stability 2026-04-09 06:21:14 -05:00
JsonSchemaForm.tsx Add plugin framework and settings UI 2026-03-13 16:22:34 -05:00
KanbanBoard.tsx Update ui/src/components/KanbanBoard.tsx 2026-04-03 23:37:12 +09:00
KeyboardShortcutsCheatsheet.tsx Add issue detail shortcut for comment composer 2026-04-09 06:18:27 -05:00
Layout.tsx Refine issue workflow surfaces and live updates 2026-04-09 10:26:17 -05:00
LiveRunWidget.tsx Refine issue workflow surfaces and live updates 2026-04-09 10:26:17 -05:00
MarkdownBody.test.tsx Add skill slash-command autocomplete 2026-04-04 17:48:54 -05:00
MarkdownBody.tsx feat(ui): open gallery when clicking images in chat messages 2026-04-09 06:18:26 -05:00
MarkdownEditor.test.tsx Refine issue workflow surfaces and live updates 2026-04-09 10:26:17 -05:00
MarkdownEditor.tsx Refine issue workflow surfaces and live updates 2026-04-09 10:26:17 -05:00
MetricCard.tsx ui: apply interface polish from design article review 2026-03-11 08:20:24 -05:00
MobileBottomNav.tsx Refine issue workflow surfaces and live updates 2026-04-09 10:26:17 -05:00
NewAgentDialog.tsx feat(adapters): external adapter plugin system with dynamic UI parser 2026-04-03 21:11:20 +01:00
NewGoalDialog.tsx fix(ui): make goal description area scrollable in create dialog 2026-04-03 23:19:50 +09:00
NewIssueDialog.test.tsx Merge pull request #3222 from paperclipai/pap-1266-issue-workflow 2026-04-09 14:52:16 -05:00
NewIssueDialog.tsx Refine issue workflow surfaces and live updates 2026-04-09 10:26:17 -05:00
NewProjectDialog.tsx refactor: rename URL validators to looksLikeRepoUrl 2026-04-01 23:21:22 +00:00
OnboardingWizard.tsx Disable timer heartbeats by default for new agents 2026-04-09 06:16:05 -05:00
OpenCodeLogoIcon.tsx Add OpenCode provider integration and strict model selection 2026-03-05 15:24:20 +01:00
OutputFeedbackButtons.tsx Refine issue chat activity and message chrome 2026-04-08 06:02:34 -05:00
PackageFileTree.tsx Add routine support to recurring task portability 2026-03-23 16:57:38 -05:00
PageSkeleton.tsx feat(ui): reconcile backup UI changes with current routing and interaction features 2026-03-02 16:44:03 -06:00
PageTabBar.tsx Refine project and agent configuration UI 2026-03-10 10:58:43 -05:00
PathInstructionsModal.tsx refactor(ui): extract ChoosePathButton into reusable PathInstructionsModal 2026-03-02 16:08:59 -06:00
PriorityIcon.tsx refactor(ui): standardize status/priority colors and improve text legibility 2026-02-23 19:52:43 -06:00
ProjectProperties.tsx Add project-level environment variables 2026-04-06 21:23:30 -05:00
PropertiesPanel.tsx ui: add animations to properties panel toggle 2026-03-03 15:06:42 -06:00
ProviderQuotaCard.tsx feat(costs): add billing, quota, and budget control plane 2026-03-16 15:11:01 -05:00
QuotaBar.tsx feat(ui): add resource and usage dashboard (/usage route) 2026-03-16 15:08:54 -05:00
ReportsToPicker.tsx refactor: improve layout and truncation in ReportsToPicker 2026-03-20 20:33:36 +00:00
RoutineRunVariablesDialog.test.tsx Add draft routine defaults and run-time overrides 2026-04-09 10:19:52 -05:00
RoutineRunVariablesDialog.tsx Add draft routine defaults and run-time overrides 2026-04-09 10:19:52 -05:00
RoutineVariablesEditor.tsx Support routine variables in titles 2026-04-09 06:16:05 -05:00
RunChatSurface.tsx Reuse chat-style run feed on dashboard 2026-04-08 06:02:34 -05:00
RunInvocationCard.test.tsx feat(adapters): external adapter plugin system with dynamic UI parser 2026-04-03 21:11:20 +01:00
ScheduleEditor.tsx Fix schedule time picker: cleaner hour labels, hide selectors for every-minute 2026-03-19 17:29:09 -05:00
ScrollToBottom.tsx Offset scroll-to-bottom button when properties panel is open 2026-04-06 21:24:44 -05:00
Sidebar.tsx Add Beta badge to Routines page and sidebar nav 2026-03-20 13:10:45 -05:00
SidebarAgents.tsx Keep sidebar ordering with portability branch 2026-03-23 17:02:43 -05:00
SidebarNavItem.tsx Add Beta badge to Routines page and sidebar nav 2026-03-20 13:10:45 -05:00
SidebarProjects.tsx Restrict sidebar reordering to mouse input 2026-03-29 10:57:34 -05:00
SidebarSection.tsx Remove collapsible behavior from sidebar Work and Company sections 2026-02-20 15:08:03 -06:00
StatusBadge.tsx fix(ui): prevent status badge pills from wrapping text 2026-02-23 20:16:17 -06:00
StatusIcon.tsx refactor(ui): standardize status/priority colors and improve text legibility 2026-02-23 19:52:43 -06:00
SwipeToArchive.test.tsx Add dark mode inbox selection color 2026-03-30 14:14:14 -05:00
SwipeToArchive.tsx Add dark mode inbox selection color 2026-03-30 14:14:14 -05:00
ToastViewport.tsx feat(ui): reconcile backup UI changes with current routing and interaction features 2026-03-02 16:44:03 -06:00
WorktreeBanner.tsx Make worktree banner name clickable to copy to clipboard 2026-04-09 06:18:05 -05:00