mirror of
https://github.com/backnotprop/plannotator.git
synced 2026-09-14 14:17:26 +08:00
feat/opencode2-native-commands
731 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
b7af16a54c | fix: support underscore italics in markdown renderer (#504) | ||
|
|
dd04e6b1cd |
feat: add Conventional Comments support to code review (#501)
* feat: add Conventional Comments support to code review Add structured label system based on the Conventional Comments spec (conventionalcomments.org) to the code review annotation toolbar. - Label picker with 9 default labels (suggestion, nit, question, issue, praise, thought, note, todo, chore) shown above the comment textarea - Per-label blocking/non-blocking toggle for labels where severity is ambiguous (issue, suggestion, todo, chore) - Labels exported as `**label** (decoration): text` in markdown feedback, naturally readable on GitHub and machine-parseable - Label badges shown on inline annotations and sidebar cards - Settings tab (Comments) with: master on/off toggle, editable label list with add/remove/rename, per-label blocking decorator toggle, educational intro with spec link and example output - Feature is off by default, persisted via config store - Custom labels supported via settings (up to 12) For provenance purposes, this commit was AI assisted. * fix(review): address conventional comments review feedback Fix label clearing bug where editing an annotation to remove its conventional label silently preserved the old value. Fix parseCCLabels accepting 'non-blocking' as a truthy blocking value. Fix duplicate custom label identities when adding multiple labels. Prepend conventional prefix to platform PR/MR inline comments. For provenance purposes, this commit was AI assisted. * fix(server): persist conventionalComments setting to config.json All six server config handlers (bun plan/review/annotate + pi plan/review/annotate) now accept and save the conventionalComments boolean, so the setting survives server restarts. For provenance purposes, this commit was AI assisted. * fix: add conventionalComments to server config round-trip getServerConfig() was not returning the conventionalComments value from config.json, so the setting silently reset to false on cookie clear or new browser sessions. Also adds the field to the PlannotatorConfig interface so saveConfig() is properly typed. For provenance purposes, this commit was AI assisted. * fix: label display, export, and draft persistence for conventional comments - Remove slug derivation from label editing — store display text verbatim so badges and exports show what the user typed - Emit conventional prefix in export even when annotation has no prose text (suggestion-only annotations were losing their label) - Include conventionalLabel in draft save condition so label selection persists across file switches For provenance purposes, this commit was AI assisted. * fix: spec-compliant export format and empty label support - Wrap label + decorations + colon in markdown bold per the Conventional Comments spec examples (was bolding only the label) - Allow users to clear all labels — empty array no longer falls back to defaults in either the picker or the settings parser - Enable blocking decorator on the question label by default; the spec permits blocking questions and they sometimes are critical For provenance purposes, this commit was AI assisted. * fix: server-sync conventionalLabels and small cleanups - Sync conventionalLabels to ~/.plannotator/config.json so custom label configurations survive cookie clears and remote/SSH sessions, matching the persistence story for conventionalComments. Stored as a parsed array on disk; serialized as JSON string in the local config store to match the cookie format. - Remove no-op intermediate variable in handleSubmitAnnotation; pass conventionalLabel/decorations directly with proper coalescing per call path (edit preserves null, add coalesces to undefined). - Use index-prefixed key in the picker label list to avoid React warnings if duplicate labels ever exist. For provenance purposes, this commit was AI assisted. |
||
|
|
719fd96cad |
fix(review): show P4 added files in code review (#494)
P4 added files (p4 add) were not appearing in the review UI on Windows. The root cause was \r\n line endings from P4 command output — splitting on \n left \r in file paths, causing Bun.file() to fail silently. - Normalize \r\n to \n in runP4() stdout for all P4 commands - Strip \r\n from file content in getNewFileDiff() - Replace fragile index-based p4 where parsing with -ztag structured output, which is also more robust for stream depots and overlays Co-authored-by: yslee <yslee@abutton.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
d710284020 |
chore: bump version to 0.17.1
For provenance purposes, this commit was AI assisted. |
||
|
|
181d2a10d5 |
fix(pi): full PR review parity with Bun server (#503)
## Summary Full Pi PR review parity with Bun server, plus shared fixes and UI improvements. ### Pi PR Review (new) - Parse PR/MR URLs, authenticate, fetch metadata and diff - Create local worktree (same-repo) or shallow clone (cross-repo) for agent file access - Full server parity: all 27 feature areas audited and aligned ### Shared Fixes (Bun + Pi) - parseRemoteUrl: GitLab subgroup support, SSH+port, HTTPS non-standard port - Cross-repo clone: --hostname replaced with GH_HOST/GITLAB_HOST env vars - Cross-repo clone: shallow fetch depth 50 → 200 - Git Add button disabled in PR review mode (client-side) - DiffViewer: eliminate dark flash on file switch (sync theme init) ### UI - Resolved/Outdated toggle filters in PR comments tab For provenance purposes, this commit was AI assisted. |
||
|
|
e3f6fc8f45 |
fix: add mergeBaseSha to GitlabMRMetadata for type union compatibility
For provenance purposes, this commit was AI assisted. |
||
|
|
0e1ea9e363 |
fix(review): use merge-base SHA for PR file contents
gh pr diff computes diffs against the merge-base (common ancestor), but file contents were fetched at baseSha (base branch tip). When the base branch has moved since the branch point, line counts don't match the diff hunks, causing iterateOverDiff trailing context mismatch crashes. Fetch the merge-base SHA via GitHub's compare API and use it for old file contents. Added try/catch around processFile as a safety net. Fixed in both Bun and Pi servers. For provenance purposes, this commit was AI assisted. |
||
|
|
566df72f11 |
chore: bump version to 0.17.0
For provenance purposes, this commit was AI assisted. |
||
|
|
702c87853b |
feat(review): token-level code selection for annotations (#500)
* feat(review): token-level code selection for annotations Add the ability to click individual syntax tokens in the diff viewer to create annotations with precise code context. Uses Pierre v1.1.12's onTokenClick/onTokenEnter/onTokenLeave callbacks. - Click a token → toolbar opens with token text in header - Click same token again → deselects - Gutter line selection still works independently - Token metadata (charStart, charEnd, tokenText) stored on CodeAnnotation - Sidebar shows token badge, export includes token context For provenance purposes, this commit was AI assisted. * fix(review): token draft roundtrip, export precision, truncation alignment - Persist tokenSelection in drafts so token context survives file switches - Include char offsets in exported feedback for duplicate token disambiguation - Escape backticks in token text to prevent broken markdown fences - Align sidebar token truncation to 30 chars (matching toolbar header) For provenance purposes, this commit was AI assisted. |
||
|
|
b375a804b2 |
feat(review): AI review agents, local worktree, and UI polish (#491)
* feat(review): add Codex AI review agent with live logs, --local worktree, and panel UI
Hook up Codex as the first AI review agent in the code review system:
- Spawn `codex exec` with Codex's native review prompt and output schema
- Parse structured findings (ReviewOutputEvent) and push as external annotations
- Annotations appear inline in the diff viewer pinned to specific lines
- Review verdict (correct/incorrect + confidence + explanation) displayed in panel
Agent job infrastructure enhancements:
- Server-side command building via `buildCommand` callback (providers don't need frontend commands)
- Result ingestion via `onJobComplete` callback (reads output file, transforms findings)
- `addAnnotations` method on external annotation handler (bypasses HTTP for server-internal producers)
- Live stderr streaming via `job:log` SSE events with 200ms buffer-and-flush
- `cwd` and `summary` fields on AgentJobInfo
PR review with --local worktree:
- `plannotator review <PR_URL> --local` creates a temp git worktree with the PR branch
- Agent gets full local file access without touching the user's working tree
- Hybrid server mode: both prMetadata (platform features) and gitContext (local access)
- Automatic worktree cleanup on session end
- Runtime-agnostic worktree primitives in packages/shared/worktree.ts
Panel UI redesign:
- Findings | Logs tab system with underline-style tabs
- LiveLogViewer component with auto-scroll, truncation, and copy
- Review verdict card (correct/incorrect with confidence and explanation)
- Pending state with labeled "Review Verdict — Pending..." (not skeleton bars)
- Job card click opens detail panel directly (removed separate icon button)
- Dismissed annotation tracking (deleted annotations persist as "dismissed" in panel)
- Copy all annotations as formatted markdown
- Worktree badge in header with info dialog showing path
- CopyButton extended with inline variant for reuse
- ConfirmDialog extended with wide option
For provenance purposes, this commit was AI assisted.
* style(review): UX polish pass — visual quality improvements across code review UI
- VerdictCard: remove AI-template left-border, use background-only tint
- Inline annotations: 6px radius, subtle shadow, hover elevation, action button scale
- File tree: tighter indentation (4 + depth*10), reduced container padding
- Select dropdowns: normalized to 4px border-radius matching pierre diffs
- Dockview tabs: close button pushed to far right with margin-left auto, visible at 0.25 opacity
- PR icons moved from sidebar to header (next to PR link)
- AnnotationRow: translate-x hover feedback
- Border-radius normalized to `rounded` (4px) across all components
- Type scale consolidated: text-[8px]/[9px] → text-[10px], text-[11px] → text-xs
- Sidebar tab hit targets increased (px-2.5 py-1.5, w-4 icons)
- Sticky file group headers in annotation sidebar
- FileTree controls collapsed (worktree + diff selectors share one row)
- Tab micro-animations (transition-all duration-150)
- ScrollFade component for gradient indicators on scrollable containers
- Prose containment: max-w-2xl + px-6 padding on PR Summary/Comments/Checks panels
- MarkdownBody: leading-relaxed for comfortable reading
- PR Comments: surface lift (bg-muted/10), hover feedback, author font-semibold
- PR Checks: link affordance (text-primary, underline on hover, external link icon)
For provenance purposes, this commit was AI assisted.
* feat(review): PR comments panel — search, filter, collapse, navigation, and polish
Comments panel enhancements:
- Search: real-time text filter across author and body, match count display
- Keyboard navigation: j/k to move between comments, scroll-to-selected
- Sort: toggle between oldest/newest first
- Collapsible comments: click header to collapse, collapse/expand all controls
- Author exclusion filter: click authors to hide their comments (not inclusion)
- Comment actions: hover-reveal "View on GitHub" link + copy button (bottom-right)
- Review URLs: PRReview type now includes optional url field, populated from GitHub API
PR Summary fixes:
- Label contrast: use theme foreground color for label text instead of raw GitHub hex
- Linked issues: replaced broken hardcoded SVG with proper GitHub Octicons issue-opened icon
Data plumbing:
- platformUser exposed through ReviewStateContext for "Mine" filtering
- Panel wrapper changed to overflow-hidden for sticky toolbar support
- "Commented" review badge hidden (noise — only show Approved/Changes Requested/Dismissed)
For provenance purposes, this commit was AI assisted.
* feat(review): inline review threads with outdated/resolved state and diff hunk previews
PR Review Threads:
- Fetch inline code review comments via GitHub GraphQL (reviewThreads query)
- PRReviewThread and PRThreadComment types with isResolved, isOutdated, path, line, diffSide
- ThreadCard component: file/line context, Outdated/Resolved badges, nested replies
- Resolved/outdated threads: gradient fade on body with "Show full comment" expand
- GitLab: reviewThreads placeholder (TODO: parse DiffNote positions from notes)
DiffHunkPreview:
- Renders diff hunks using @pierre/diffs FileDiff component (read-only, compact)
- Full theme integration: reads computed CSS vars, injects via unsafeCSS (same as main DiffViewer)
- Respects user font settings from ReviewState context
- Handles bare GitHub diffHunk format (prepends synthetic file headers for pierre parsing)
Comments Panel Polish:
- Comment cards: bg-card + subtle shadow for depth and isolation from panel background
- Hover: shadow elevation (0_2px_6px) for interactive feedback
- Thread cards: dimmed shadow for resolved/outdated, full shadow for active
- Prose padding: px-8 (32px) across all dockview panels (Summary, Comments, Checks, Findings)
For provenance purposes, this commit was AI assisted.
* feat(review): Claude Code agent, cross-repo --local, render fixes
Claude Code review agent:
- claude-review.ts: prompt (adapted from code-review plugin), command builder
(dontAsk + granular allowedTools/disallowedTools), JSONL stream output parser
- Prompt sent via stdin (not argv) to avoid quoting/variadic flag conflicts
- stream-json --verbose for live JSONL streaming + final structured_output
- Same schema as Codex — transformReviewFindings is now provider-agnostic
Agent jobs infrastructure:
- stdout capture (captureStdout option) for providers that return results on stdout
- stdin prompt writing (stdinPrompt option) for providers that read prompt from stdin
- cwd override in buildCommand return for providers without -C flag
- await stdoutDone before onJobComplete to prevent drain race condition
- job.prompt field for transparent prompt display in detail panel
Cross-repo --local:
- Detect same-repo vs cross-repo via parseRemoteUrl comparison
- Cross-repo: shallow clone via gh/glab repo clone (--depth 1 --no-checkout + targeted fetch)
- Cross-repo uses platform diff (gh pr diff) for display, clone for agent file access
- Same-repo: existing worktree path unchanged
- Cleanup: rmSync for clones, worktree remove for same-repo
Performance: jobLogs context split
- Separate JobLogsContext to prevent high-frequency log SSE from re-rendering all panels
- Only ReviewAgentJobDetailPanel subscribes to JobLogsProvider
- Standard React pattern: split contexts by update frequency
Image error handling:
- SafeHtmlBlock component wraps dangerouslySetInnerHTML with img onerror handlers
- Broken images (expired GitHub JWTs) hide on first 404 instead of flickering
- Prevents console 404 flood from re-render retry loops
For provenance purposes, this commit was AI assisted.
* fix(review): decontaminate --local from diff pipeline, fix worktree setup, default local for PRs
The --local flag was setting gitContext from the worktree, which contaminated
the diff rendering pipeline — causing pierre "trailing context mismatch" errors
because /api/file-content read worktree files instead of using the GitHub API.
Root cause: gitContext serves two purposes — diff pipeline (file contents, diff
switching, staging) and agent sandbox (cwd for agent processes). These are now
properly separated via a new agentCwd option on ReviewServerOptions.
Changes:
- Add agentCwd to ReviewServerOptions, independent of gitContext
- Agent handler (getCwd, buildCommand, onJobComplete) prefers agentCwd
- Stop setting gitContext in --local PR path — diff pipeline untouched
- Revert band-aid !isPRMode guards (no longer needed)
- Fix same-repo worktree: fetch origin/<baseBranch> so agents see correct diff
- Fix cross-repo clone: create local branch at baseSha for git diff accuracy
- Fix FETCH_HEAD ordering: fetch base branch before PR head (createWorktree needs PR tip)
- Fix macOS path mismatch: realpathSync(tmpdir()) so agent paths strip correctly
- Change buildCodexReviewUserMessage signature from GitContext to focused options
- Make --local the default for PR/MR reviews (--no-local to opt out)
- Pass agentCwd to client for worktree badge display
For provenance purposes, this commit was AI assisted.
* style(review): unify panel headers, responsive buttons, dockview polish
- Unify all panel headers at 33px via --panel-header-h CSS variable
- FileHeader now uses shared variable instead of hardcoded 30px
- Dockview tab bar height, font size, and padding aligned with sidebars
- FileTree header uses fixed height instead of padding-based sizing
- Consistent border opacity (border-border/50) across all panels
- Consistent font weight (font-semibold) on all header labels
- Remove dockview tab focus outline (::after pseudo-element)
- Dockview tab close button pushed to right edge
- Tab bar void area uses muted background
- Top app header compacted from h-12 to py-1
- Sidebar footer: copy button and diff stats side by side
- FeedbackButton responsive labels (Send/Post at md, full labels at lg)
- Move ReviewAgentsIcon to packages/ui for shared use
- Agent empty state uses shared ReviewAgentsIcon instead of hardcoded SVG
- Sidebar header label truncates when narrow (tabs never clip)
- Detail panel prompt disclosures get proper spacing
- React.memo on PR tab components (PRSummaryTab, PRCommentsTab)
- Inline onerror on img tags for broken GitHub image handling
For provenance purposes, this commit was AI assisted.
* fix: type assertion for Bun stdin FileSink
Bun's proc.stdin is typed as `number | FileSink` but we need to call
.write() and .end() on it. Cast to FileSink to satisfy tsc --noEmit.
For provenance purposes, this commit was AI assisted.
* fix(review): XSS in sanitizeHtml, git flag injection, cross-repo ref mismatch
Security:
- Remove `onerror` from DOMPurify ALLOWED_ATTR — was allowing arbitrary JS
execution via PR descriptions containing `<img onerror="...">`. Replace
with SafeHtml component that attaches error handlers via useEffect + ref.
- Add `--` end-of-options separator to git fetch and git branch calls to
prevent flag injection via crafted branch names from API responses.
Bug fix:
- Cross-repo clones now create both local branch AND remote-tracking ref
(`refs/remotes/origin/<baseBranch>`) at baseSha, so agents can use either
`git diff main...HEAD` or `git diff origin/main...HEAD`.
Polish:
- Add copy button to verdict card in agent detail panel
- Remove hover:translate-x animation from finding rows
- Reduce file tree indent per level, remove extra file offset
- Add pr-action endpoint logging for debugging submit failures
For provenance purposes, this commit was AI assisted.
* chore: upgrade @pierre/diffs from 1.1.0-beta.19 to ^1.1.12
The beta pin was needed for processFile() API (expandable diff context),
which shipped in 1.1.0 stable on March 14. We were 13 releases behind.
Notable fixes in the upgrade path:
- 1.1.5: Fix diffAcceptRejectHunk with partial FileDiffMetadata
- 1.1.6: Patch parsing fix for renames and dotfiles
- 1.1.8: Fix maxLineDiffLength regression
May resolve intermittent "trailing context mismatch" errors in diff rendering.
For provenance purposes, this commit was AI assisted.
* fix(review): remove shell provider, flag injection, Claude log formatting, copy UX
Security:
- Remove shell provider from agent capabilities (unauthenticated RCE vector)
- Move `--` before prRepo in `gh repo clone` to prevent flag injection
Features:
- Wire up formatClaudeLogEvent — Claude live logs now show readable text
instead of raw JSONL
- Sidebar annotations: copy + delete buttons appear on hover (no overlap)
- Agent finding rows: copy button on hover (progressive disclosure)
- Verdict card: copy button pushed to the right
- File tree: reduced indent per level, files aligned with folders
Infra:
- PR action endpoint logging for debugging submit failures
For provenance purposes, this commit was AI assisted.
* fix: validate repo identifier to prevent flag injection in gh repo clone
The `--` separator in `gh repo clone` separates gh args from git args,
not positional args from flags. Using `--` before prRepo would break
the git flags. Instead, validate that the repo identifier doesn't start
with `-` to prevent flag injection via crafted PR URLs.
For provenance purposes, this commit was AI assisted.
* feat(review): Claude-specific review model with severity, reasoning, and multi-agent prompt
Claude review agent now has its own schema, prompt, and transform — separate
from Codex's P0-P3 priority model. Each provider uses its natural review style.
Schema changes:
- Claude findings use severity (important/nit/pre_existing) instead of priority (0-3)
- Flat structure: file, line, end_line instead of nested code_location
- description (single field) instead of title + body
- reasoning field captures the validation chain per finding
- summary with counts instead of overall_correctness/confidence
Prompt: Converges the open-source Claude Code review prompt with the remote
review service model. 4 parallel agents (Bug+Regression at Opus, Security at
Opus, Code Quality at Sonnet, Guideline Compliance at Haiku), validation step,
deduplication, severity classification. CLAUDE.md and REVIEW.md awareness.
UI: Severity markers (colored dots) on finding rows. Collapsible reasoning
section via <details>. New optional severity/reasoning fields on CodeAnnotation
and the external annotation store — backward compatible, only set by Claude.
Transform: transformClaudeFindings normalizes Claude output into the shared
annotation format. Codex path (transformReviewFindings) is completely untouched.
For provenance purposes, this commit was AI assisted.
* fix: use bg-amber-500 for nit severity dot (bg-warning may not be defined)
For provenance purposes, this commit was AI assisted.
* fix: security hardening, debug cleanup, deduplication, Pi mirroring, findings UX
Security:
- Add -- separator to ensureObjectAvailable git fetch (worktree.ts)
- Validate baseBranch against path traversal (..) before git ref operations
- Use process.once('exit') instead of process.on for worktree cleanup
Debug:
- Gate debugLog behind PLANNOTATOR_DEBUG env var (no more unconditional writes)
- Remove PARSE_OUTPUT_RAW dump that logged full JSON output to disk
Deduplication:
- Extract toRelativePath to packages/server/path-utils.ts (was duplicated
in codex-review.ts and claude-review.ts)
Pi extension:
- Remove shell provider from capabilities
- Add buildCommand callback to AgentJobHandlerOptions
- POST handler calls buildCommand for server-side command synthesis
UI:
- Findings sorted by severity (important → nit → pre_existing)
- Severity legend under findings header (colored dots)
- Reasoning always visible (not collapsible) — fixes click navigation bug
where <details> captured click events and broke annotation linkage
- Full finding text shown (removed line-clamp-2 truncation)
- Sidebar annotation hover actions aligned to the right
- DiffHunkPreview: cancel requestAnimationFrame on unmount
For provenance purposes, this commit was AI assisted.
* fix: move toRelativePath import to top of claude-review.ts
For provenance purposes, this commit was AI assisted.
* fix: same-repo detection compares host, platform-aware comment links, remove design docs
- Same-repo detection now compares both owner/repo AND hostname from the
git remote URL against prMetadata.host. Prevents false positives on
GitHub Enterprise where different instances share org/repo names.
- "View on GitHub" label in PR comments tab now shows "View on GitLab"
for GitLab MR comments based on the comment URL.
- Remove internal design docs (PR_LOCAL_WORKTREE.md, AGENT_LIVE_LOGS.md)
that were development artifacts, not user-facing documentation.
For provenance purposes, this commit was AI assisted.
* fix(review): show severity markers and reasoning in inline diff annotations
The severity and reasoning fields from Claude findings were only visible in
the agent detail panel, not in the inline diff annotations. Now:
- DiffAnnotationMetadata carries severity and reasoning fields
- DiffViewer passes them through when mapping annotations
- InlineAnnotation renders colored severity dot and reasoning text
For provenance purposes, this commit was AI assisted.
* fix: prefix Claude findings text with [severity] tag
Findings now show as "[important] description", "[nit] description",
"[pre_existing] description" — consistent with Codex's [P0]/[P1] tags.
For provenance purposes, this commit was AI assisted.
* feat(pi): full agent review mirroring — stdin, stdout, live logs, result ingestion
Pi extension agent-jobs handler now mirrors the Bun server's full capabilities:
- stdin piping for Claude prompt delivery
- stdout capture for Claude JSONL stream parsing
- Live stderr streaming with 200ms buffer-and-flush for job:log events
- Claude JSONL formatting via vendored formatClaudeLogEvent
- onJobComplete callback for result parsing and annotation push
- Full buildCommand integration in POST handler
- jobOutputPaths tracking with cleanup on kill
Pi serverReview.ts now wires buildCommand and onJobComplete with the same
logic as the Bun review server — Codex and Claude commands are built
server-side, results are parsed and transformed into external annotations.
Runtime compatibility: replaced Bun.file/Bun.write in codex-review.ts with
node:fs/promises equivalents (writeFile, readFile, existsSync) that work on
both Bun and Node. Verified Bun build passes.
Vendoring: vendor.sh now copies codex-review.ts, claude-review.ts, and
path-utils.ts from packages/server/ with import path rewriting for the
generated/ layout.
Also: Review Prompt label, px-8 padding on agent detail header/tabs/logs.
For provenance purposes, this commit was AI assisted.
* fix: remove duplicate isPRMode declaration in Pi serverReview.ts
For provenance purposes, this commit was AI assisted.
* fix: include reasoning in all copy and feedback export paths
- exportReviewFeedback: appends **Reasoning:** after finding text
- Per-finding copy button: appends reasoning to copy text
- Sidebar annotation copy: appends reasoning to copy text
This ensures reasoning flows through Copy All, Send Feedback, and
individual copy actions — not just the visual rendering.
For provenance purposes, this commit was AI assisted.
* fix: six verified findings — navigation, dedup, cleanup, copy, diff match, Windows paths
1. openDiffFile: clicking a finding now navigates to the correct file
before selecting the annotation (was silently selecting in wrong file)
2. SEVERITY_STYLES: extracted to packages/ui/types.ts as shared constant,
imported in both ReviewAgentJobDetailPanel and InlineAnnotation
(was duplicated with per-render rebuild in InlineAnnotation)
3. killJob: added jobOutputPaths.delete calls to match Pi's version
(was leaking two strings per killed job)
4. CommentActions: replaced hand-rolled copy with CopyButton inline
variant (was reimplementing useState/clipboard/setTimeout pattern)
5. Branch mode prompt: changed from three-dot to two-dot to match
the UI's actual diff computation (agent was reviewing different diff)
6. toRelativePath: uses path.relative + forward-slash normalization
for Windows compatibility (was string prefix matching with / only)
For provenance purposes, this commit was AI assisted.
* perf: wrap ReviewSidebar in React.memo to prevent re-renders during log streaming
Every job:log SSE event triggers setJobLogs in useAgentJobs, which re-renders
App.tsx. Without memo, the sidebar re-renders on every event (~5/sec) even
though its props (agentJobs.jobs, capabilities, callbacks) haven't changed.
This caused visible flickering when a review tab was open during agent runs.
React.memo shallow-compares props — all sidebar props are stable references
(jobs array only changes on status events, callbacks are useCallback-wrapped),
so the sidebar correctly skips re-renders during log streaming.
For provenance purposes, this commit was AI assisted.
* fix(security): remove find/ls/cat from Claude allowed tools, add glab CLI
Security: Bash(find:*) allowed find -exec to spawn arbitrary subprocesses
that bypassed --disallowedTools. Removed find, ls, and cat — Claude has
Glob, Read, and Grep built-in which cover file access without shell exec.
Feature: Added glab mr view/diff/list and glab api to allowed tools so
Claude can inspect GitLab MR context in remote-mode reviews.
For provenance purposes, this commit was AI assisted.
* fix: Pi addAnnotations, Pi stdout drain, cross-repo exit codes
Pi extension:
- Add addAnnotations() to external-annotations.ts return object —
serverReview.ts calls it when agent jobs complete but the method
was missing (build/runtime error)
- Change proc.on('exit') to proc.on('close') in agent-jobs.ts —
Node's 'exit' fires before stdio streams drain, so stdoutBuf could
be incomplete when onJobComplete parses Claude's JSONL result
Cross-repo --local:
- Check git checkout FETCH_HEAD exit code — throw if it fails so the
outer catch falls back to remote-only with a clear warning
- Log warning if baseSha fetch fails (non-fatal, agents just can't
diff locally)
For provenance purposes, this commit was AI assisted.
* fix: FETCH_HEAD ordering, Pi worktree-aware cwd, SEVERITY_ORDER hoisted
Critical:
- Move ensureObjectAvailable before PR head fetch — it can overwrite
FETCH_HEAD if baseSha needs fetching, causing createWorktree to
check out the base commit instead of the PR head
- Pi serverReview.ts: extract resolveAgentCwd() helper used by getCwd,
buildCommand, and onJobComplete — was bypassing worktree-aware path
resolution, causing agents to run in wrong directory
Cleanup:
- Hoist SEVERITY_ORDER to module scope in ReviewAgentJobDetailPanel
(was recreated inside component body on every render)
For provenance purposes, this commit was AI assisted.
* fix: Bun/Pi parity — provider default, annotation error logging
- Bun agent-jobs: change provider default from "shell" to "" (shell was
removed from capabilities, default should match Pi)
- Pi serverReview: log errors from addAnnotations in onJobComplete
(Bun logs them, Pi was silently ignoring)
For provenance purposes, this commit was AI assisted.
* docs: add AI Code Review Agents guide with full prompt transparency
New docs page covering:
- Overview of Codex and Claude review agents
- How findings work (severity/priority, reasoning, navigation)
- Local worktree behavior (same-repo vs cross-repo)
- Full transparency section with:
- Claude multi-agent pipeline prompt (all 6 steps)
- Claude command and allowed/blocked tools
- Codex review prompt and command
- Both output schemas (Claude severity + Codex priority)
- Security notes (read-only, no network, local execution, no commenting)
- Customization via CLAUDE.md and REVIEW.md
For provenance purposes, this commit was AI assisted.
* docs: add provenance links for Claude and Codex review integrations
Credit Anthropic's Claude Code Review service, the open-source
code-review plugin, and OpenAI's Codex CLI as the foundations
for our review agent integrations.
For provenance purposes, this commit was AI assisted.
* fix: temp clone leak, j/k key conflict, thread header null line
- Cross-repo: clean up localPath in catch block when fetch/checkout
fails after clone succeeds (directory was leaking in /tmp)
- Remove j/k/arrow keyboard navigation from PR comments panel —
these shortcuts belong to the file tree only, both registering
global handlers caused double-navigation
- Thread header null guard: check thread.line before building range
label to prevent "L12–null" for outdated GitHub threads
For provenance purposes, this commit was AI assisted.
* fix: hoist localPath for catch-block scope, validate baseSha format
The previous rmSync(localPath) in the catch block was dead code —
const declarations inside try are not in scope in catch (separate
lexical environments per ECMAScript spec). The ReferenceError was
silently swallowed by the inner try/catch, so temp directories
still leaked on failed fetch/checkout.
Fix: hoist `let localPath` before the try block so it's accessible
in catch. Guard with `if (localPath)` since the error could occur
before assignment.
Also: validate baseSha is a hex SHA (40-64 chars) to prevent git
flag injection via crafted API responses. Validate baseBranch
rejects both '..' and '-' prefixes.
For provenance purposes, this commit was AI assisted.
* docs: rewrite AI Code Review guide for clarity and readability
Restructured for a technical audience: shorter paragraphs, cleaner
tables, removed em-dashes and filler prose, tightened the pipeline
diagram, streamlined security section into scannable single-line items.
For provenance purposes, this commit was AI assisted.
* docs: rewrite transparency section with exact prompts and commands
Replaced summarized/paraphrased transparency section with the actual
prompts, commands, schemas, and tool allowlists as they exist in the
code. One short security note at the top, then raw content.
For provenance purposes, this commit was AI assisted.
* docs: add mini TOC to transparency section
For provenance purposes, this commit was AI assisted.
* fix: stdout drain hang, Codex verdict override, Claude parse logging, memo removal
Critical:
- Race stdoutDone against 2s timeout after proc.exited — prevents
permanent job hang when Bun's ReadableStream doesn't close after
process exit. The process is dead; 2s is a cleanup deadline.
Bug fix:
- Codex verdict: override to "Issues Found" when P0/P1 findings exist,
regardless of the freeform overall_correctness string. Prevents green
"Correct" badge when Codex says "mostly correct but has issues."
P2/P3-only findings still trust Codex's verdict.
Observability:
- Log Claude parse failures with buffer size and last 200 bytes so we
can diagnose empty-findings cases.
Performance:
- Remove React.memo from ReviewSidebar — was blocking legitimate
re-renders (job status, findings) to prevent cosmetic log flickering.
The tradeoff was wrong.
Docs:
- Remove "shell" from CLAUDE.md capabilities table (provider was removed).
For provenance purposes, this commit was AI assisted.
* fix: type assertions for Bun ReadableStream async iteration
Bun's proc.stdout/stderr support for-await at runtime but TypeScript's
ReadableStream type doesn't declare [Symbol.asyncIterator]. Cast through
unknown to AsyncIterable<Uint8Array> — standard Bun workaround, same
pattern as the FileSink cast for stdin.
For provenance purposes, this commit was AI assisted.
|
||
|
|
70b0cfb34e |
fix(annotate): support @ markdown file references (#488)
OpenCode can pass annotate targets as @file references, so resolve markdown paths with an @ fallback only after the primary lookup misses. This preserves real @-prefixed filenames while making @README.md and quoted @ inputs resolve reliably. |
||
|
|
03b3bdd011 | feat(review): add merge-base diff option for PR-style diffs (#485) | ||
|
|
d850b78ba6 |
fix: handle markdown hard line breaks and list continuations (#483)
* fix: handle markdown hard line breaks and list continuation lines List items with indented continuation lines (no blank line separator) now merge into the preceding bullet instead of becoming orphan paragraphs. InlineMarkdown now converts two-trailing-space and backslash line breaks into <br> elements. Synced to the diff view's InlineMarkdown copy. Closes #482 For provenance purposes, this commit was AI assisted. * fix: allow bold/italic to span across hard line breaks Changed bold/italic regexes from .+? to [\s\S]+? so emphasis can match across newlines (per CommonMark spec). Moved hard break check after all ^-anchored inline patterns so bold/italic get first crack, then the recursive InlineMarkdown call inside <strong>/<em> handles the break. For provenance purposes, this commit was AI assisted. |
||
|
|
26364543b2 | fix(remote): support explicit local override (#481) | ||
|
|
70ad54dd70 |
chore: bump version to 0.16.7
For provenance purposes, this commit was AI assisted. |
||
|
|
1800c24d80 |
feat(gemini): add Gemini CLI plan review integration
* feat(gemini): add Gemini CLI plan review integration Adds a new `apps/gemini-hook/` adapter that enables Plannotator plan review for Gemini CLI users via the BeforeTool hook system. The adapter reads the plan file from disk (Gemini provides a path, not inline content), delegates to the shared @plannotator/server for the browser-based review UI, and translates the decision back into Gemini's hook output format. Requires an upstream fix (google-gemini/gemini-cli#21802) that makes `decision = "allow"` user policies work for exit_plan_mode, allowing hooks to replace the built-in TUI approval dialog. Includes: - apps/gemini-hook/server/index.ts — stdin/stdout adapter - apps/gemini-hook/hooks/ — policy TOML + settings snippet - scripts/install.sh — Gemini binary download, policy install, settings config For provenance purposes, this commit was AI assisted. * refactor(gemini): use single binary with auto-detection instead of separate app Removes apps/gemini-hook/ — the plannotator binary now auto-detects Gemini CLI from stdin (plan_path = file on disk) vs Claude Code (plan = inline content) and branches input parsing + output formatting. Config fixtures live in apps/gemini/ (policy TOML + settings snippet). Install script gates on ~/.gemini existing so Claude-only users are unaffected. For provenance purposes, this commit was AI assisted. * test(gemini): add manual sandbox script for Gemini CLI integration Three modes: - --simulate: pipes BeforeTool JSON to hook, tests approve/deny output - (default): runs local patched Gemini build - --nightly: installs Gemini nightly and runs it Backs up and restores ~/.gemini config on exit. For provenance purposes, this commit was AI assisted. * feat(gemini): add slash commands, marketing tab, and docs for Gemini CLI - Add /plannotator-review and /plannotator-annotate slash commands (.toml) - Install Gemini slash commands in all three install scripts (sh, ps1, cmd) - Add Gemini tab to marketing landing page with icon - Add Gemini CLI to top-level README install section - Create apps/gemini/README.md with full setup and usage docs - Remove stale dev:gemini script and regenerate bun.lock For provenance purposes, this commit was AI assisted. * fix(gemini): merge hook into existing settings.json instead of printing instructions When ~/.gemini/settings.json already exists, use node to JSON-merge the BeforeTool hook config rather than asking the user to do it manually. Falls back to instructions only if node is unavailable. For provenance purposes, this commit was AI assisted. * fix(gemini): handle plan_filename rename and fix scoping bug Gemini CLI nightly renamed plan_path to plan_filename in exit_plan_mode. Accept both field names for forward/backward compatibility. Reconstruct full plan path from transcript_path + session_id + plans/ + filename. Also hoist planFilename variable out of try block so it's accessible in the deny output path (was causing ReferenceError). For provenance purposes, this commit was AI assisted. * fix(gemini): dim approve button when annotations exist for Gemini CLI Gemini's hook runner ignores systemMessage on the allow path, so approve-with-feedback is silently dropped — same limitation as Claude Code. Extend the existing UI gate to also apply for gemini-cli origin. For provenance purposes, this commit was AI assisted. * fix(gemini): add AGENT_CONFIG entry and fix sandbox simulate mode Register "gemini-cli" in AGENT_CONFIG so the UI shows "Gemini CLI" with proper badge styling instead of generic "Coding Agent" fallback. Update sandbox simulate mode to match production input format: use plan_filename instead of plan_path, include transcript_path, and simulate the Gemini directory structure for path reconstruction. For provenance purposes, this commit was AI assisted. |
||
|
|
a48fd8afb5 |
chore: bump version to 0.16.6
For provenance purposes, this commit was AI assisted. |
||
|
|
e642e25124 |
feat: add Perforce (P4) pending changelist diff support (#472)
* feat: add Perforce pending changelist diff support for code review Introduce P4 support alongside existing Git backend via a VCS dispatch layer (vcs.ts). Detects Git vs Perforce workspace automatically and routes diff/file-content operations to the appropriate backend. - Add p4-default and p4-changelist:<N> DiffType variants - Add P4 runtime (p4.ts): workspace detection with TTL cache, changelist context, unified diff conversion, binary file exclusion, batch p4 where - Add VCS dispatch layer (vcs.ts): auto-detect Git/P4, unified API - Update review server and CLI entry point to use VCS dispatch - Filter empty changelists from dropdown, disable staging for P4 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: introduce VcsProvider interface for extensible VCS support Replace hardcoded Git/P4 dispatch with a provider-based architecture. Each VCS implements VcsProvider interface and registers in a providers array — adding a new VCS only requires implementing the interface. - Define VcsProvider with detect, ownsDiffType, getContext, runDiff, getFileContents, and optional stageFile/unstageFile/resolveCwd - Create gitProvider and p4Provider as concrete implementations - Replace isP4DiffType/gitAddFile/gitResetFile in review.ts with provider-based canStageFiles/stageFile/unstageFile/resolveVcsCwd - Remove VCS-specific branching from review server endpoints Note: GitContext interface is not renamed to VcsContext in this commit. The rename touches too many files across the codebase (Pi extension, OpenCode plugin, shared types, tests) and should be handled as a separate pull request to keep the diff reviewable. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: rtsummit <rtsummit@abutton.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
2c5ebb5ad1 |
feat(review): prefill suggested code textarea with selected code (#470)
When user clicks "Add suggested code" button in an annotation comment, the textarea is now pre-filled with the original selected code, allowing them to edit from there instead of typing from scratch. The cursor is positioned at the end of the prefilled text using requestAnimationFrame to ensure proper focus after state updates. |
||
|
|
ada0d5f9c5 | fix(review): expand file tree folders by default on initial render (#473) (#474) | ||
|
|
ee8d181cf9 |
fix(review): hide annotation toolbar when suggestion modal is open (#469)
Prevent stacking dialogs by hiding the AnnotationToolbar when the SuggestionModal (expanded editor) is open, avoiding the original dialog from overlaying the fullpage dialog. |
||
|
|
070f75f804 |
chore: bump version to 0.16.5
For provenance purposes, this commit was AI assisted. |
||
|
|
9ae034d2ea |
fix(ui): right resize handle no longer covers scrollbar (#354) (#465)
Commit
|
||
|
|
6735266d66 | chore: bump version to 0.16.4 | ||
|
|
68418e2a35 |
feat(review): add dockview center workspace (#453)
* chore(review): add dockview-react dependency * feat(review): add dockview center workspace * fix(review): stabilize diff search navigation * feat(review): add progressive file search UI * feat(review): streamline header controls * fix(review): portal annotation toolbar * refactor(review): streamline header and action menus * fix(review): make file header responsive * fix(review): align split diff drag handle * chore(review): hide review agents sidebar * fix(review): remount diff viewer on file switch * fix(review): wrap inline diff comments |
||
|
|
f8d4969e73 |
feat(hook): improvement hook context injection for planning (#459)
* feat(shared): add improvement hook reader utility Adds a runtime-agnostic module for reading improvement hook files from ~/.plannotator/hooks/. Uses a hardcoded base path with an allowlist of known hook files and a 50KB size cap to prevent runaway context injection. Designed for cross-harness reuse (Claude Code, OpenCode, Pi, etc.). For provenance purposes, this commit was AI assisted. * feat(hook): wire up improve-context PreToolUse hook for EnterPlanMode Adds a PreToolUse hook on EnterPlanMode that injects corrective planning instructions into Claude's context at plan mode entry. The new `plannotator improve-context` subcommand reads the improvement hook file and returns additionalContext, or silently passes through if no file exists. For provenance purposes, this commit was AI assisted. * fix(skill): update compound skill improvement hook path Moves the improvement hook file path from ~/.plannotator/compound/ to ~/.plannotator/hooks/compound/ to namespace hook-injectable files separately from other plannotator data. For provenance purposes, this commit was AI assisted. * fix(shared): add legacy path fallback for improvement hook reader Users who ran the compound skill before the path migration have their improvement hook file at ~/.plannotator/compound/ instead of the new ~/.plannotator/hooks/compound/ path. Add a fallback that checks the legacy path only when the new path is absent — if the new path exists but is invalid (empty, oversized), no fallback occurs to prevent resurrecting stale instructions. Includes tests for new-path-wins, legacy-fallback, and invalid-new-blocks-legacy scenarios. For provenance purposes, this commit was AI assisted. |
||
|
|
588b6a4de7 |
feat(review): support GitHub Enterprise and fix self-hosted GitLab MR diffs (#460)
* feat(review): support GitHub Enterprise and fix self-hosted GitLab MR diffs Add `host` field to GitHub PR types and update URL parsing to accept any host with `/pull/` pattern, enabling GitHub Enterprise Server URLs like `ghe.company.com/owner/repo/pull/123`. All 8 `gh` CLI functions now pass `--hostname` (for `gh api`/`gh auth`) and `HOST/OWNER/REPO` (for `gh pr`) when targeting non-github.com hosts. Replace broken `glab mr diff --hostname` invocation (glab mr subcommands don't support --hostname) with `glab api .../diffs` which does. Diffs are now reconstructed from structured API response instead of heuristic parsing of bare diff output. Closes #348 Closes #457 For provenance purposes, this commit was AI assisted. * fix(review): remove destructive regex from GitLab paginated JSON parser glab api --paginate already returns a single merged JSON array, so the regex that replaced ][ with , was unnecessary and could corrupt diff content containing array indexing patterns like arr[i][j]. For provenance purposes, this commit was AI assisted. |
||
|
|
46fa92712c |
feat: add Clean Contrast, Code Fork, and Midnight themes (#454)
Three new themes derived from Cursor's color palettes. Code Fork supports both dark and light modes; Clean Contrast and Midnight are dark-only. For provenance purposes, this commit was AI assisted. |
||
|
|
41f78295ba | Reset review scroll on file switch (#452) | ||
|
|
cce877d3c4 |
fix(review): resolve repo root for untracked file discovery (#450)
git ls-files scopes to the CWD subtree and returns CWD-relative paths, unlike git diff HEAD which covers the full repo with root-relative paths. When the hook process inherits a subdirectory CWD, untracked files outside that subtree are silently dropped and paths for files inside it are wrong. Resolve the repo root via rev-parse --show-toplevel and use it as the CWD for both git ls-files and git diff --no-index in getUntrackedFileDiffs. Fixes #449 |
||
|
|
d8a67beb1c |
feat: agentic review — background job runner with SSE streaming (#443)
* feat(server): add agent job manager with process lifecycle and SSE streaming
Introduces the backend for agentic review — a server-agnostic job runner
that spawns agent processes, monitors their lifecycle via proc.exited, and
broadcasts status updates over a dedicated SSE stream.
New files:
- packages/shared/agent-jobs.ts: runtime-agnostic types, SSE helpers, state machine
- packages/server/agent-jobs.ts: Bun HTTP adapter with spawn/kill/SSE/REST routes
Wired into the review server with late-bound serverUrl, killAll on stop
and process exit for defense-in-depth cleanup. Capability detection via
Bun.which() for Claude Code, Codex CLI, and shell.
For provenance purposes, this commit was AI assisted.
* feat(ui): add Review Agents tab with job management and live status
Adds the client-side UI for agentic review:
- useAgentJobs hook: SSE primary with polling fallback, capabilities fetch
- AgentsTab: shared component with provider dropdown, job cards, kill controls
- ReviewAgentsIcon: magnifying glass with cog icon
- ReviewPanel: new "Review Agents" tab conditional on detected capabilities
- App.tsx: initializes hook and passes props to ReviewPanel
Jobs show live elapsed time, status badges, annotation counts per source,
and expandable error details. Stub command (sleep 10-30s) for initial testing.
For provenance purposes, this commit was AI assisted.
* fix(server): narrow proc.stderr type to satisfy TS
Bun types proc.stderr as ReadableStream | number. Add typeof guard
to narrow before passing to Response constructor.
For provenance purposes, this commit was AI assisted.
* fix(server): prevent stdout deadlock, stderr pipe stall, and worktree cwd mismatch
- Change stdout from "pipe" to "ignore" — agents post findings via the
annotations API, not stdout. Unconsumed pipe buffer caused deadlock.
- Drain stderr continuously instead of reading after exit — prevents
pipe-full stall on chatty agents.
- Make agent getCwd worktree-aware using the same currentDiffType check
the AI endpoints use, so agents spawn in the correct checkout.
- Exclude 'agents' tab from PR context fetch guard in ReviewPanel.
For provenance purposes, this commit was AI assisted.
* feat(pi): mirror agent-job endpoints in Pi review server
Add apps/pi-extension/server/agent-jobs.ts — a Node.js port of the Bun
agent-jobs handler using child_process.spawn, res.write() SSE, and
execFileSync for capability detection.
Wire into serverReview.ts: route delegation, killAll in stop(),
process.on("exit") guard, worktree-aware getCwd, and serverUrl
late-binding. Add agent-jobs to vendor.sh for shared type vendoring.
For provenance purposes, this commit was AI assisted.
* fix(agents): harden agent jobs — listener leak, provider allowlist, Windows support, docs
- Use process.once instead of process.on to prevent exit listener accumulation
- Validate provider against known capabilities before spawning (rejects unknown providers)
- Use platform-aware which/where for CLI detection on Windows
- Broadcast jobs:cleared event from kill-all endpoint (was dead client code)
- Document all /api/agents/* endpoints in CLAUDE.md Review Server table
For provenance purposes, this commit was AI assisted.
* fix(agents): SSE ref reset, jobs:cleared divergence, exit listener cleanup
- Reset receivedSnapshotRef/fallbackRef on re-mount so polling fallback
activates correctly on subsequent tab switches
- Remove jobs:cleared broadcast from kill-all — killAll() already fires
individual job:completed events, so the UI shows status transitions
instead of going blank
- Store exit handler ref so stop() can removeListener, preventing
accumulation in long-lived hosts (OpenCode, Pi)
For provenance purposes, this commit was AI assisted.
|
||
|
|
fad822e6ca | chore: bump version to 0.16.2 | ||
|
|
ede10fef9c |
feat(ui): cross-file annotation visibility and adaptive navigation (#444)
- Shared CountBadge component replacing heavy TOC accent circles - Per-file annotation count badges in FileBrowser and VaultBrowser - Folder aggregate counts from descendant files - Summary header showing total annotations across files - Dot indicators on Files/Vault sidebar tabs when annotations exist - Adaptive back button text (file list / file / message / plan) - Cross-file annotation indicator in right panel with flash highlight - Fix directory prefix matching bug (startsWith without trailing slash) - Move flash animation CSS to shared theme stylesheet For provenance purposes, this commit was AI assisted. |
||
|
|
7435be0639 |
feat(ui): draggable comment popover and annotation toolbar (#442)
Makes the CommentPopover and AnnotationToolbar draggable by their headers via a shared `useDraggable` hook. Users can reposition popovers that land awkwardly near viewport edges. - New `useDraggable` hook reads rendered position via getBoundingClientRect on drag start - 3px movement threshold prevents interfering with button clicks - CommentPopover: suppresses scroll/resize tracking after drag, resets on anchor change - AnnotationToolbar: both comment and Ask AI modes are draggable - Clamps position to keep at least 50px visible on screen For provenance purposes, this commit was AI assisted. |
||
|
|
6b84ce4107 |
feat(review): custom diff font family and size overrides (#441)
* feat(review): custom font family and size overrides for code review diffs Add Code Font and Code Font Size settings to the review Display tab, letting users override the theme's monospace font in the diff viewer. Supports 9 fonts (Fira Code, Hack, IBM Plex Mono, Inconsolata, JetBrains Mono, Red Hat Mono, Roboto Mono, Source Code Pro, Atkinson Hyperlegible Mono) loaded on demand from Google Fonts / jsDelivr CDN. Font size uses a continuous slider (8–24px) with a Reset button. Settings persist via cookies and sync to ~/.plannotator/config.json under diffOptions.fontFamily / diffOptions.fontSize, matching the existing config pattern. For provenance purposes, this commit was AI assisted. * fix(review): line-height scaling, inline annotation font coverage, and comment card cleanup - Add line-height: 1.5 alongside font-size in Pierre shadow DOM so large sizes don't clip - Include .review-comment-body selectors in font override CSS so inline annotation code spans get the custom font - Simplify comment card: remove drop shadow, left border accent, translateX hover; use tight border with subtle hover For provenance purposes, this commit was AI assisted. |
||
|
|
b0980ef928 |
fix(opencode): remove verbose logs that flood the TUI (#440)
Remove writeRemoteShareLink stderr output from the OpenCode plugin — the base64 share URL was flooding the TUI on remote sessions. Also strip leftover console.log debug statements from the PR viewed files feature in the review server. Closes #435 For provenance purposes, this commit was AI assisted. |
||
|
|
a633e70597 | chore: bump version to 0.16.1 | ||
|
|
16756e082b | fix(server): keep external annotation SSE streams alive (#439) | ||
|
|
a88da925de | chore: bump version to 0.16.0 | ||
|
|
e0dd5783b2 |
fix(ui): type cleanse — fix stale types, missing initializer fields, React 19 compat
- CommentPopover: add width to position state type (was returned but not declared) - Settings: add missing ObsidianSettings fields (filenameSeparator, autoSave, vaultBrowserEnabled) - Settings: add missing planWidth to UIPreferences initializer - Viewer: use React.ElementType for dynamic heading tag - useLinkedDoc: use SidebarTab instead of string for sidebar.open - useActiveSection: accept RefObject<HTMLElement | null> (React 19) - useInputMethodSwitch: pass explicit undefined to useRef - package.json: add exports for config, ImageAnnotator, sidebar/*, plan-diff/* - types.d.ts: add __APP_VERSION__ global declaration For provenance purposes, this commit was AI assisted. |
||
|
|
14f8bdba62 |
feat: bot callback URL params with componentized toolbar buttons (#416)
Adds ?cb=<encoded_url>&ct=<token> URL params for bot-initiated plan review callbacks. When a bot posts a Plannotator share link with these params, Approve/Feedback buttons appear and POST the user's decision (with annotated plan URL) back to the bot. Changes: - callback.ts: parse callback config from URL search/hash params, execute POST - ToolbarButtons.tsx: extract shared FeedbackButton/ApproveButton components (6 instances → 2 components) - sharing.ts: strip ?cb=&ct= from hash before decompressing share payload - App.tsx: callback buttons gated on isSharedSession + shareUrl readiness - 19 tests covering config parsing, URL validation, presigned URL preservation, and POST execution Co-authored-by: aviadshiber <aviadshiber@users.noreply.github.com> For provenance purposes, this commit was AI assisted. |
||
|
|
4627f75426 |
feat: external annotations API with real-time SSE (#400)
Adds a general-purpose External Annotations API that allows external programs (linters, AI tools, security scanners) to push annotations into a live Plannotator session via HTTP, with real-time delivery over SSE. ## What's included - **Shared core** (`packages/shared/external-annotation.ts`): types, in-memory store, input validation, SSE serialization - **Server handlers**: Bun + Pi implementations with full CRUD (GET/POST/PATCH/DELETE) + SSE streaming - **Client hook** (`useExternalAnnotations`): EventSource with polling fallback, optimistic updates - **Editor integration**: two-array state model (local + external), content-aware dedup, ID-based routing - **Persistence**: source field preserved through share URLs and crash-recovery drafts - **Docs**: new Integrations category with API overview page, updated API reference ## API surface All three servers (plan, review, annotate) expose: - `GET /api/external-annotations/stream` - SSE stream - `GET /api/external-annotations` - JSON snapshot (polling fallback) - `POST /api/external-annotations` - Add annotations (single or batch) - `PATCH /api/external-annotations?id=` - Update fields - `DELETE /api/external-annotations` - Remove by id, source, or clear all For provenance purposes, this commit was AI assisted. |
||
|
|
9b69d17580 | test: cover PR/MR platform helpers (#426) | ||
|
|
2ae4f2a292 |
fix(parser): indented fences, trailing text, table detection, and escaped pipes (#429)
Three fixes to parseMarkdownToBlocks and one to table cell rendering: 1. Indented closing fences — allow leading whitespace so ` ``` ` inside list items closes the code block instead of swallowing to EOF. 2. Trailing text after closing fence — drop end-of-line anchor so ` ``` some text` still closes the block. 3. False table detection — require lines start with `|` instead of matching any line with 2+ pipe characters. 4. Escaped pipes in table cells — split on unescaped `|` only, so `\|` renders as a literal pipe instead of creating extra columns. Closes #427 For provenance purposes, this commit was AI assisted. |
||
|
|
9b016da4ae |
feat(review): diff display options with ConfigStore integration (#428)
* feat(config): add DiffOptions to PlannotatorConfig with deep-merge support Extends the server-side config system to support diff display options namespaced under `diffOptions` in ~/.plannotator/config.json. The saveConfig deep-merge ensures partial writes (e.g. changing only overflow) don't clobber sibling keys. For provenance purposes, this commit was AI assisted. * feat(server): accept diffOptions in POST /api/config handlers All six server handlers (plan, review, annotate x Bun + Pi) now whitelist diffOptions alongside displayName, forwarding it to saveConfig for deep-merged disk persistence. For provenance purposes, this commit was AI assisted. * feat(config): register diff display settings with deep-merge write batching Adds 6 diff option settings to the ConfigStore registry (diffStyle, diffOverflow, diffIndicators, diffLineDiffType, diffShowLineNumbers, diffShowBackground), all synced to disk under the diffOptions namespace. Fixes write batching for nested server keys — replaces Object.assign with deepMerge so rapid changes to multiple diff options within the 300ms debounce window don't clobber each other. Includes legacy cookie migration for the old review-diff-style key. For provenance purposes, this commit was AI assisted. * feat(review): wire diff display options through to @pierre/diffs Migrates diffStyle from raw cookie storage to ConfigStore. Reads all 6 diff options via useConfigValue and forwards them to FileDiff: overflow, diffIndicators, lineDiffType, disableLineNumbers, disableBackground. Adds a Scroll/Wrap toolbar toggle alongside the existing Split/Unified toggle. Disables the custom resizable split dragger in wrap mode since Pierre manages its own grid layout. Fixes the unsafeCSS grid override to only target scroll mode, preventing per-character wrapping in split view. For provenance purposes, this commit was AI assisted. * feat(review): add Display tab to review-mode Settings dialog Adds a Display tab when Settings is in review mode, exposing all 6 diff options: Diff Style, Line Overflow, Change Indicators, Inline Diff Granularity, Show Line Numbers, and Show Diff Background. Changes take effect immediately and persist via ConfigStore (cookie + disk). Extracts reusable SegmentedControl and ToggleSwitch helpers for the review display controls. For provenance purposes, this commit was AI assisted. * chore: update bun.lock For provenance purposes, this commit was AI assisted. * fix(review): reapply search highlights after display option changes Add new diff display props to the search highlight and scroll-to-match effect dependency arrays so highlights are restored after Pierre re-renders. For provenance purposes, this commit was AI assisted. |
||
|
|
a0a6edd323 |
feat: print support with export menu integration and keyboard shortcut (#420)
* feat: add print stylesheet for white paper output - Create packages/ui/styles/print.css with @media print rules - White background and black text for paper output - Monochrome code blocks for readability on white paper - Hide UI chrome (annotations, toolbars, sidebars) during print - Proper typography for headers, code, tables, lists, blockquotes - Page break rules to avoid orphaned content - Support for diagrams (Mermaid, Graphviz) in print - Import print.css in packages/ui/theme.css Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * feat: add Print button to toolbar - Add Print button next to Export button in plan editor toolbar - Triggers window.print() for native browser print dialog - Shows printer icon + 'Print' label (icon-only on mobile) - Tooltip: 'Print plan (Ctrl+P)' - Uses muted button styling consistent with other toolbar buttons Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: rewrite print.css selectors to match real DOM structure Code review found the original selectors used class names that don't exist in the actual component tree. Fixed: - Target header.sticky / header.h-12 (not generic 'header') - Target aside elements directly (SidebarContainer + AnnotationPanel) - Target .annotation-toolbar (portalled floating toolbar) - Target .fixed overlays (modals, export dialog) - Target article element (Viewer renders <article>, not <main>) - Target .bg-grid for background pattern removal - Flatten .h-screen height for print flow - Simplified hljs monochrome rule to [class*='hljs'] Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: print stylesheet — hide all toolbar UI, fix code block colors Issues fixed from user testing: - Header toolbar (Export/Print/Settings) now hidden via 'header' selector - AnnotationToolstrip (Select/Markup) hidden via '.flex-wrap' - Action buttons (Images/Comment/Copy) hidden via '.float-right' - Code block copy buttons hidden via '.group > button.absolute' - Fenced code blocks: override github-dark.css hljs theme to monochrome with light background (#f5f5f5) and dark text (#1a1a1a) - Inline code: solid light gray background with visible border - All text forced to solid black (override theme muted/foreground vars) - hljs span elements explicitly overridden for print Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: aggressive code block print overrides for dark theme - Override CSS custom properties (--muted, --foreground, etc.) in print - Use both background AND background-color on pre/code elements - Target pre[class], code[class], code.hljs with higher specificity - Explicitly list every hljs- class for monochrome override - Ensures github-dark.css hljs theme is fully overridden in print Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: use JS beforeprint/afterprint class for code block print styling Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: add visibilitychange fallback for Firefox print cleanup Firefox may not fire afterprint when print preview is closed without printing, leaving the .plannotator-print class stuck on <html>. This adds a visibilitychange listener that removes the class when the user returns to the page, plus cleanup on unmount. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * refactor: extract usePrintMode hook, replace brittle CSS selectors with data attributes - Extract print event listeners from App.tsx into packages/ui/hooks/usePrintMode.ts - Add data-print-region attributes to layout elements (root, content, document, article) - Add data-print-hide attribute to Viewer action buttons - Replace .h-screen, .flex-1.flex.overflow-hidden, .bg-card, .bg-grid, .float-right, .flex-wrap selectors with stable data-attribute and semantic element selectors - Follows existing hook patterns (useIsMobile, useDismissOnOutsideAndEscape, etc.) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: hide annotation toolstrip and repo badges in print output Added data-print-hide to the AnnotationToolstrip wrapper and the repo/branch badges div inside the article. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: collapse top whitespace gap in print output Zero out article padding, add margin/padding reset to data-print-hide elements, and collapse first h1 top margin for a tight print layout. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * feat: move print button into export menu and add Ctrl/Cmd+P shortcut * chore: remove accidentally introduced annotate command files Remove apps/hook/commands/annotate.md and apps/opencode-plugin/commands/annotate.md that were unintentionally added in the print-styling PR. For provenance purposes, this commit was AI assisted. --------- Co-authored-by: Yecats <Yecats@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Michael Ramos <mdramos8@gmail.com> |
||
|
|
08fcaaf086 |
feat: Interactive checkboxes with annotation tracking (#423)
* feat: interactive checkboxes — click to toggle with annotation Checkboxes in rendered markdown task lists are now clickable. Toggling is visual-only (does not modify source markdown) and automatically creates a comment annotation noting the change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: uncheck checkbox removes override and deletes annotation (undo) When toggling back to the original state, the checkbox override is deleted and the associated annotation is removed — acting as an undo. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: address all code review issues for checkbox feature 1. Fix annotation prefix collision: match on blockId field instead of string prefix to avoid block-1 matching block-10, block-11 etc. 2. Fix rapid toggle orphans: delete ALL existing checkbox annotations for the block before creating a new one, preventing duplicates. 3. Fix stale overrides: useEffect cleans up checkboxOverrides entries when their block IDs no longer exist in the current blocks array. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: use actionable annotation text for checkbox toggles Annotations now read 'Mark as completed: {item}' or 'Mark as not completed: {item}' so the AI knows to action on them. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: include section heading in checkbox annotation for disambiguation Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: revert checkbox override when annotation is deleted from panel When a user deletes a checkbox annotation via the annotation panel, the checkboxOverrides entry is now cleared so the checkbox reverts to its original visual state. Previously only toggling the checkbox itself would revert the override. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * refactor: extract removeAnnotation to avoid redundant override cleanup in checkbox toggle * refactor: extract useCheckboxOverrides hook from App.tsx --------- Co-authored-by: Yecats <Yecats@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> |
||
|
|
2d90d381c9 |
fix: Detect calling agent via env vars and centralize agent config (#418)
* fix: detect calling agent via env vars for correct badge display Add prioritized agent detection chain: CODEX_THREAD_ID (codex) > COPILOT_CLI (copilot-cli) > default (claude-code). All subcommands use the shared detectedOrigin constant. Display name updated from 'Copilot CLI' to 'GitHub Copilot'. TypeScript origin union type updated to include 'copilot-cli'. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * refactor: centralize agent config into @plannotator/shared/agents - Create packages/shared/agents.ts as single source of truth for Origin type, agent display names (AGENT_CONFIG), getAgentName(), and getAgentBadge() - Replace all inline origin type unions across 8 files with Origin import - Type detectedOrigin and ServerOptions.origin as Origin for compile-time safety - Add @plannotator/shared dependency to @plannotator/editor package.json - Adding a new agent is now a one-file change to AGENT_CONFIG Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: restore gitContext in startReviewServer call Accidentally removed alongside the origin refactor. Without it, local code reviews lose branch detection, diff-type switching, and CWD resolution. For provenance purposes, this commit was AI assisted. --------- Co-authored-by: Yecats <Yecats@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Michael Ramos <mdramos8@gmail.com> |
||
|
|
15af1c40eb |
Add GitHub Copilot CLI integration (#409)
* feat: add GitHub Copilot CLI integration Add full Copilot CLI support via a new plugin (apps/copilot/) with: - preToolUse hook intercepting exit_plan_mode for plan review - copilot-plan subcommand with correct permissionDecision output format - copilot-last subcommand parsing events.jsonl for last message annotation - Copilot CLI session parser (copilot-session.ts) - Plugin manifest, hooks.json, and slash commands - UI origin branding (blue badge for Copilot CLI) - Marketplace entry for plugin discovery - README install section Key design decisions: - Intercepts exit_plan_mode (not create) to avoid double-review - Uses sessionId (with fallback) to locate plan.md from session state - Follows Codex integration pattern: same CLI binary, new plugin dir Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: handle actual Copilot CLI preToolUse input format (toolCalls array) The Copilot CLI hook input uses { toolCalls: [{ name, args }] } format instead of the documented { toolName, toolArgs } format. The filter was checking event.toolName (always undefined), causing exit_plan_mode to pass through unintercepted. Now extracts tool name from either format. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Revert "fix: handle actual Copilot CLI preToolUse input format (toolCalls array)" This reverts commit b214bc02c58fc5d8f305b128457099afb2ea6ecc. * fix: use absolute path in hooks.json for reliable binary discovery The hook subprocess inherits the PATH from when Copilot CLI was started, which may not include the plannotator binary directory. Using the full absolute path via env vars ensures the hook always finds the binary. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Finishing the feature * fix: remove Copilot CLI plugin from Claude Code marketplace.json .claude-plugin/marketplace.json is for Claude Code's plugin marketplace. The Copilot CLI plugin has its own install path and doesn't belong here. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: align Copilot CLI plugin with official spec - Add .github/plugin/marketplace.json for Copilot CLI plugin discovery - Change allowed-tools from Bash() to shell() syntax in commands - Respect COPILOT_HOME env var in session path discovery - Update plugin.json version to 0.14.5 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Yecats <Yecats@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: stahaff <222254525+stahaff@users.noreply.github.com> |
||
|
|
9746344779 |
chore: bump version to 0.15.5
For provenance purposes, this commit was AI assisted. |