Commit Graph

343 Commits

Author SHA1 Message Date
Michael Ramos e46815d8ea feat: named image references and annotate command (#147)
* feat: named image references and annotate command (#67, #109)

Add human-readable names to image attachments throughout the annotation
pipeline, and add a new `plannotator annotate <file.md>` command for
annotating arbitrary markdown files.

Image names: ImageAttachment type replaces plain string paths, upload
endpoints return originalName, editable name inputs under thumbnails,
[name] path format in exported feedback, backward-compatible sharing.

Annotate command: new server module reusing plan editor HTML with
mode:"annotate", CLI subcommand, slash commands for Claude Code and
OpenCode, annotate mode UI (hides Approve, shows Send Annotations).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor: move image name input to ImageAnnotator screen

The name input now appears on the full-screen annotator modal that opens
immediately when uploading/pasting an image, pre-populated from the
filename. Removes the disruptive inline name editing from thumbnails.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: stale closure in paste handler, update CLAUDE.md for new features

Fix race condition where globalAttachments was captured as empty array
in the paste event listener (missing dependency). Also update CLAUDE.md
to document ImageAttachment type, annotate server/flow, updated sharing
format with image support, and new slash commands.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 20:23:49 -08:00
Michael Ramos 0b47dd54a7 feat: add configurable share URL for self-hosted portals (#146)
Add PLANNOTATOR_SHARE_URL env var so users can point share links at
their own self-hosted portal instance instead of share.plannotator.ai.
Threads the base URL through the same path as sharingEnabled: env var →
server options → API response → editor state → useSharing hook →
generateShareUrl(). Includes self-hosting guide and documentation.

Closes #12

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 15:07:43 -08:00
Michael Ramos 2d7f7bf977 chore: bump version to 0.7.0
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 12:43:26 -08:00
Michael Ramos ef20bb62b7 feat: save to notes without approving (#127) (#132)
Decouple Obsidian/Bear saves from the approve/deny flow so users can
save plans to their notes app independently, then manually approve in
Claude Code (e.g. shift+tab for context clearing).

- Add POST /api/save-notes server endpoint
- Add "Notes" tab to Export dialog with per-integration save buttons
- Split Export button into button+dropdown with quick actions:
  Copy Share Link, Download Diff, Save to Obsidian/Bear
- Add Cmd/Ctrl+S keyboard shortcut with configurable default action
- Add "Default Save Action" setting in Settings > Saving
- New utility: defaultNotesApp.ts for cookie-based preference

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 11:28:09 -08:00
Michael Ramos fe293217e8 chore: bump version to 0.6.8
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 08:44:01 -08:00
Michael Ramos 48f53eed16 feat: display repo and branch info in plan document (#117)
* feat: display repo and branch info in plan document

Add subtle badge display in upper-left corner of plan document showing:
- Repository name (org/repo from git remote, with fallbacks)
- Current branch with git branch icon

New modular repo.ts handles detection with fallback chain:
1. Parse org/repo from git remote origin
2. Fall back to git repo root directory name
3. Fall back to current working directory

Closes #104

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test: add --no-git flag to sandbox script

Allows testing repo info fallback behavior when not in a git repository.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 10:29:52 -08:00
Michael Ramos f01036949b chore: bump version to 0.6.7
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 12:10:23 -08:00
Michael Ramos c24e775292 fix: smart detection for agent switching in OpenCode (#96)
Closes #94
2026-01-19 11:07:22 -08:00
Michael Ramos 2832d70bd9 chore: bump version to 0.6.6
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 09:14:35 -08:00
Michael Ramos f1087efc7c chore: bump version to 0.6.5
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 14:42:02 -08:00
Michael Ramos 4ed4d15171 chore: bump version to 0.6.4 2026-01-15 20:55:54 -08:00
Michael Ramos b1883d38e8 fix(opencode): include HTML files in npm package
The `files` array in package.json was missing plannotator.html and
review-editor.html, causing them to be omitted from npm publishes.
This explains why users were stuck on old versions.

Also fixes incorrect cache path in docs and install script.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 10:04:26 -08:00
Michael Ramos dcc1ad108a chore: bump version to 0.6.2
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 07:54:14 -08:00
Michael Ramos 4dd67c1157 chore: bump version to 0.6.1
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 07:45:14 -08:00
Michael Ramos 131d1b9d0e feat: add config to disable URL sharing (#69)
Add deployment-level configuration to disable URL sharing for
security/privacy concerns.

Configuration methods:
- Claude Code: PLANNOTATOR_SHARE=disabled env var
- OpenCode: "share": "disabled" in opencode.json (primary), env var fallback

When disabled:
- Quick Share button hidden in annotation panel
- Share tab hidden in export modal (shows only Raw Diff)

Closes #69

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 13:12:37 -08:00
Pedro Paulo Pinheiro dos Santos ecbaf17e22 bugfix: Add WSL detection for browser opening utility (#74)
* bugfix: Add WSL detection for browser opening utility

* fix: add empty title param to Windows start command

The Windows `start` command interprets the first quoted argument as
a window title. Without an empty title `""`, paths with spaces like
"C:\Program Files\..." would be misinterpreted, causing custom
browser settings to fail silently.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Michael Ramos <mdramos8@gmail.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 09:33:46 -08:00
Michael Ramos 128417600d chore: bump version to 0.6.0
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 20:36:38 -08:00
Michael Ramos 0e07425116 feat: permission mode preservation for Claude Code hooks (#71)
* feat: add permission mode utility and setup dialog

Add cookie-based storage for permission mode preference with first-time
setup dialog for Claude Code users. Supports three modes:
- Auto-accept Edits (default)
- Bypass Permissions (equivalent to --dangerously-skip-permissions)
- Manual Approval

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat: integrate permission mode in editor and settings

- Show first-time setup dialog for Claude Code users
- Add permission mode dropdown to Settings (Claude Code only)
- Pass selected mode in approve request

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat: output updatedPermissions in hook response

Use Claude Code 2.1.7+ hook protocol to preserve permission mode after
plan approval. Extracts permission_mode from hook input, allows client
to override via request, and outputs setMode in updatedPermissions.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 20:31:23 -08:00
Michael Ramos 461437a1d6 fix: make agent automatically respond to code review feedback
Removed noReply flag so agent addresses feedback immediately

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 05:30:02 -08:00
Michael Ramos bcc84fd11e fix: remove agent_cycle from review to prevent wrong agent switch
session.prompt with agent parameter handles the switch correctly

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 05:26:52 -08:00
Michael Ramos 4d2481e812 fix: rebuild with correct version embedded in bundle
0.5.4 was published with stale build containing 0.5.2 version string

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 04:57:14 -08:00
Michael Ramos 806e5536d6 feat: unified install script for all platforms
- Add Windows PowerShell install script (install.ps1)
- Install slash commands for both Claude Code and OpenCode
- Update OpenCode README with install script instructions
- Simplify UpdateBanner to use same install command for both platforms

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 04:45:51 -08:00
Michael Ramos 1ee40ef144 fix: always open review UI, allow switching diff types
Remove early exit when no uncommitted changes - user can switch to
"Last commit" or other diff types via dropdown.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 20:16:07 -08:00
Michael Ramos e1153ebeac fix: add update banner to code review screen
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 20:10:52 -08:00
Michael Ramos a427405201 fix: code review UI improvements for v0.5.1
- Show correct origin badge (Claude Code orange, OpenCode gray)
- Always show file tree sidebar when diff options available
- Update README with v0.5.0 label

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 20:06:00 -08:00
Michael Ramos 41eecc4480 chore: bump version to 0.5.0 for release
- Update version in root, opencode-plugin, and server packages
- Add code review feature to README
- Build artifacts for release

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 19:41:42 -08:00
Michael Ramos 8019f73a44 Feat/code review system (#57)
## Summary
Complete code review system for reviewing git diffs with annotations.

### Features
- Interactive diff viewer with split/unified views
- Line-level annotation system
- Diff type selector (uncommitted, last commit, vs main branch)
- Dynamic default branch detection
- Empty state handling
- Simplified UX with streamlined feedback flow

Closes #51
Closes #56
2026-01-12 19:36:09 -08:00
Michael Ramos 459a089a96 Bump version to 0.4.16
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 09:39:33 -08:00
Michael Ramos c9a42af86a Bump version to 0.4.15
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 10:34:55 -08:00
Michael Ramos cee2c7ff4c feat: add PLANNOTATOR_BROWSER for browser selection (#48)
Allow users to specify which browser opens plan files via environment variable.
Default behavior unchanged - only activates when env var is set.

- macOS: Set to app name ("Google Chrome") or path
- Linux/Windows: Set to executable path

Closes #42
2026-01-09 10:18:54 -08:00
Michael Ramos 963332ca13 Bump version to 0.4.11
Fix stale build artifacts in npm package - version was showing 0.4.9 due to
pre-built HTML being copied before version bump.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 14:33:21 -08:00
Michael Ramos f4dcdbffd6 Bump version to 0.4.10
- Update CLAUDE.md with new APIs and file structure
- Remove unused helper functions (isAgentSwitchEnabled, isPlanSaveEnabled)
- Sync all package versions to 0.4.10

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 14:24:59 -08:00
Michael Ramos 710e18daff Add configurable agent switching for OpenCode (#40)
* Add configurable agent switching for OpenCode

Add a Settings UI option to configure agent switching behavior after plan
approval. Users can now choose to switch to the "build" agent (default) or
disable agent switching entirely. This is particularly useful for oh-my-opencode
users who have their own agent switching logic.

Changes:
- Add agentSwitch.ts utility for storing agent switch preference
- Add "Agent Switching" dropdown in Settings UI
- Pass agentSwitch setting through /api/approve to OpenCode plugin
- Conditionally perform agent switch based on user preference

Closes #37

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: TheOutdoorProgrammer <13936290+TheOutdoorProgrammer@users.noreply.github.com>

* Hide Agent Switching setting when not in OpenCode mode

* Add configurable plan saving settings

Users can now:
- Disable plan saving entirely via Settings toggle
- Set a custom save path (supports ~ for home directory)

Closes #36

* Widen Settings dialog to accommodate new options

* Move Save Plans setting below Identity section

* Make Obsidian Vault and Folder inputs side by side

* Move Agent Switching below Save Plans in Settings

---------

Co-authored-by: TheOutdoorProgrammer <13936290+TheOutdoorProgrammer@users.noreply.github.com>
2026-01-07 14:17:56 -08:00
Michael Ramos 4de46b5984 Add plan saving to ~/.plannotator/plans/
- New storage.ts module with cross-platform support (Windows/macOS/Linux)
- Save plan.md on server start
- Save plan.diff.md and plan-{approved,denied}.md on decision
- OpenCode plugin shows saved path in tool result
2026-01-06 19:46:28 -08:00
Michael Ramos e0261349ee Bump version to 0.4.8
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 19:11:15 -08:00
Michael Ramos 0ac49c24e4 Add "approve with notes" for OpenCode + Claude Code warning dialog
Features:
- OpenCode: annotations are sent on approval as implementation notes
- Claude Code: confirmation dialog warns annotations won't be sent
- Dialog includes links to upvote Claude Code issues #16001 #15755

Refactor:
- New reusable ConfirmDialog component

Closes #30

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 18:26:11 -08:00
Michael Ramos a3a0f8e64e Fix OpenCode agent switching race condition + adjust UI width
Agent switching:
- Use noReply: true with await to ensure user message is created
  before returning from tool
- Fixes race condition where message was created after loop exited

UI:
- Adjust plan viewer width to 832px (between 3xl and 4xl)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 15:55:07 -08:00
Michael Ramos 3f0a65e535 Widen plan viewer to max-w-4xl (896px)
Increases default width from 768px to 896px for better readability
while still fitting comfortably on laptop screens.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 15:30:32 -08:00
Michael Ramos 14e5ca08d2 Fix: only widen layout on 2xl screens (1536px+)
Removes xl breakpoint to keep narrow layout on all laptops.
Only widens on truly large external monitors.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 15:10:00 -08:00
Michael Ramos b546bf9b9d Fix agent switching: fire-and-forget session.prompt
Don't await session.prompt to avoid queuing issue.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 15:07:19 -08:00
Michael Ramos e8dd0b469c Fix responsive width for laptop screens
Restore max-w-3xl as default width, only widen on larger screens:
- Default: max-w-3xl (768px) for laptops
- xl (1280px+): max-w-5xl for external monitors
- 2xl (1536px+): max-w-6xl for large desktops

Bumps version to 0.4.3.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 14:47:13 -08:00
Michael Ramos 93dcbe55a8 Bump version to 0.4.2
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 14:28:57 -08:00
Michael Ramos 14e9aea0ec Fix/devcontainer & plan auto switching (opencode) (#31)
* Refactor: shared server package with PLANNOTATOR_REMOTE env var

- Create packages/server/ with shared server implementation
- Add PLANNOTATOR_REMOTE=1 env var for devcontainer/SSH mode
- Deprecate SSH_CONNECTION detection (still works with warning)
- Both Claude Code and OpenCode now use identical server logic
- OpenCode gains Obsidian/Bear integrations and remote detection
- Update documentation with environment variables section

Fixes #27

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Remove PLANNOTATOR_ORIGIN env var, fix onReady callback timing

- Remove PLANNOTATOR_ORIGIN hack from Claude Code hook (hardcode "claude-code")
- Fix onReady callback to pass port directly (was referencing undefined server)
- Create tests/manual/test-server.ts for testing either origin
- Update test-hook-2.sh to use new test server with opencode origin

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add devcontainer test setup, reduce logging verbosity

- Add tests/devcontainer/ with devcontainer.json for testing remote mode
- Add tests/opencode-local/ for local OpenCode testing
- Update package.json build script for proper bundling
- Remove verbose multi-line error messages, keep useful errors
- Clean up unused deprecationWarned variable

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add devcontainer support and documentation

- Add PLANNOTATOR_REMOTE env var for container/remote detection
- Remove console logging (silent operation)
- Add devcontainer.md with full setup instructions
- Add devcontainer section to OpenCode plugin README
- Add port-only test setup to reproduce common misconfiguration
- Update test devcontainers to forward port 4096 for opencode web
- Bump version to 0.4.1

Fixes #27

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Update CLAUDE.md: legacy SSH detection, not deprecated

Removed incorrect mention of deprecation warning - SSH_TTY/SSH_CONNECTION
detection is silent by design.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix OpenCode agent switching after plan approval

After approving a plan, the conversation context stayed in "plan" mode
even though the TUI showed "build". This caused edits to fail because
the plan agent has edit permissions denied.

The fix uses session.prompt() to inject a message with agent: "build",
which triggers a new agentic loop with proper build agent permissions.

Fixes #29

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 14:25:19 -08:00