Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions packages/review-editor/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ interface DiffData {
files: DiffFile[];
rawPatch: string;
gitRef: string;
origin?: 'opencode' | 'claude-code';
origin?: 'opencode' | 'claude-code' | 'pi';
diffType?: string;
gitContext?: GitContext;
sharingEnabled?: boolean;
Expand Down Expand Up @@ -139,7 +139,7 @@ const ReviewApp: React.FC = () => {
const [copyFeedback, setCopyFeedback] = useState<string | null>(null);
const [viewedFiles, setViewedFiles] = useState<Set<string>>(new Set());
const [hideViewedFiles, setHideViewedFiles] = useState(false);
const [origin, setOrigin] = useState<'opencode' | 'claude-code' | null>(null);
const [origin, setOrigin] = useState<'opencode' | 'claude-code' | 'pi' | null>(null);
const [diffType, setDiffType] = useState<string>('uncommitted');
const [gitContext, setGitContext] = useState<GitContext | null>(null);
const [isLoadingDiff, setIsLoadingDiff] = useState(false);
Expand Down Expand Up @@ -214,7 +214,7 @@ const ReviewApp: React.FC = () => {
.then((data: {
rawPatch: string;
gitRef: string;
origin?: 'opencode' | 'claude-code';
origin?: 'opencode' | 'claude-code' | 'pi';
diffType?: string;
gitContext?: GitContext;
sharingEnabled?: boolean;
Expand Down Expand Up @@ -615,9 +615,11 @@ const ReviewApp: React.FC = () => {
<span className={`text-[10px] px-1.5 py-0.5 rounded font-medium hidden md:inline ${
origin === 'claude-code'
? 'bg-orange-500/15 text-orange-400'
: 'bg-zinc-500/20 text-zinc-400'
: origin === 'pi'
? 'bg-violet-500/15 text-violet-400'
: 'bg-zinc-500/20 text-zinc-400'
}`}>
{origin === 'claude-code' ? 'Claude Code' : 'OpenCode'}
{origin === 'claude-code' ? 'Claude Code' : origin === 'pi' ? 'Pi' : 'OpenCode'}
</span>
)}
{repoInfo && (
Expand Down Expand Up @@ -991,10 +993,10 @@ const ReviewApp: React.FC = () => {
title={submitted === 'approved' ? 'Changes Approved' : 'Feedback Sent'}
subtitle={
submitted === 'approved'
? `${origin === 'claude-code' ? 'Claude Code' : 'OpenCode'} will proceed with the changes.`
: `${origin === 'claude-code' ? 'Claude Code' : 'OpenCode'} will address your review feedback.`
? `${origin === 'claude-code' ? 'Claude Code' : origin === 'pi' ? 'Pi' : 'OpenCode'} will proceed with the changes.`
: `${origin === 'claude-code' ? 'Claude Code' : origin === 'pi' ? 'Pi' : 'OpenCode'} will address your review feedback.`
}
agentLabel={origin === 'claude-code' ? 'Claude Code' : 'OpenCode'}
agentLabel={origin === 'claude-code' ? 'Claude Code' : origin === 'pi' ? 'Pi' : 'OpenCode'}
/>

{/* Update notification */}
Expand Down
2 changes: 1 addition & 1 deletion packages/server/annotate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export interface AnnotateServerOptions {
/** HTML content to serve for the UI */
htmlContent: string;
/** Origin identifier for UI customization */
origin?: "opencode" | "claude-code";
origin?: "opencode" | "claude-code" | "pi";
/** Whether URL sharing is enabled (default: true) */
sharingEnabled?: boolean;
/** Custom base URL for share links */
Expand Down
2 changes: 1 addition & 1 deletion packages/server/review.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export interface ReviewServerOptions {
/** HTML content to serve for the UI */
htmlContent: string;
/** Origin identifier for UI customization */
origin?: "opencode" | "claude-code";
origin?: "opencode" | "claude-code" | "pi";
/** Current diff type being displayed */
diffType?: DiffType;
/** Git context with branch info and available diff options */
Expand Down
14 changes: 11 additions & 3 deletions packages/ui/components/UpdateBanner.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React, { useState } from 'react';
import { useUpdateCheck } from '../hooks/useUpdateCheck';

const INSTALL_COMMAND = 'curl -fsSL https://plannotator.ai/install.sh | bash';
const DEFAULT_INSTALL_COMMAND = 'curl -fsSL https://plannotator.ai/install.sh | bash';
const PI_INSTALL_COMMAND = 'pi install npm:@plannotator/pi-extension';

interface UpdateBannerProps {
origin?: 'claude-code' | 'opencode' | 'pi' | null;
Expand All @@ -16,13 +17,15 @@ export const UpdateBanner: React.FC<UpdateBannerProps> = ({ origin }) => {
const urlParams = new URLSearchParams(window.location.search);
const previewOrigin = urlParams.get('preview-origin');
const effectiveOrigin = previewOrigin || origin;
const isPi = effectiveOrigin === 'pi';
const isOpenCode = effectiveOrigin === 'opencode';
const installCommand = isPi ? PI_INSTALL_COMMAND : DEFAULT_INSTALL_COMMAND;

if (!updateInfo?.updateAvailable || dismissed) return null;

const handleCopy = async () => {
try {
await navigator.clipboard.writeText(INSTALL_COMMAND);
await navigator.clipboard.writeText(installCommand);
setCopied(true);
setTimeout(() => setCopied(false), 2000);
} catch (e) {
Expand Down Expand Up @@ -76,12 +79,17 @@ export const UpdateBanner: React.FC<UpdateBannerProps> = ({ origin }) => {
You have {updateInfo.currentVersion}
</p>

{/* OpenCode extra instructions */}
{/* Agent-specific extra instructions */}
{isOpenCode && (
<p className="text-xs text-muted-foreground mt-3">
Run the install script, then restart OpenCode.
</p>
)}
{isPi && (
<p className="text-xs text-muted-foreground mt-3">
Run the install command, then restart Pi.
</p>
)}

<div className="mt-4 flex items-center gap-2">
<button
Expand Down
8 changes: 8 additions & 0 deletions scripts/install.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,14 @@ echo }
echo Updated plugin hooks at !PLUGIN_HOOKS!
)

REM Update Pi extension if pi is installed
where pi >nul 2>&1
if !ERRORLEVEL! equ 0 (
echo Updating Pi extension...
pi install npm:@plannotator/pi-extension
echo Pi extension updated.
)

REM Install /review slash command
if defined CLAUDE_CONFIG_DIR (
set "CLAUDE_COMMANDS_DIR=%CLAUDE_CONFIG_DIR%\commands"
Expand Down
7 changes: 7 additions & 0 deletions scripts/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ if (Test-Path $pluginHooks) {
Remove-Item -Recurse -Force "$env:USERPROFILE\.cache\opencode\node_modules\@plannotator" -ErrorAction SilentlyContinue
Remove-Item -Recurse -Force "$env:USERPROFILE\.bun\install\cache\@plannotator" -ErrorAction SilentlyContinue

# Update Pi extension if pi is installed
if (Get-Command pi -ErrorAction SilentlyContinue) {
Write-Host "Updating Pi extension..."
pi install npm:@plannotator/pi-extension
Write-Host "Pi extension updated."
}

# Install Claude Code slash command
$claudeCommandsDir = if ($env:CLAUDE_CONFIG_DIR) { "$env:CLAUDE_CONFIG_DIR\commands" } else { "$env:USERPROFILE\.claude\commands" }
New-Item -ItemType Directory -Force -Path $claudeCommandsDir | Out-Null
Expand Down
7 changes: 7 additions & 0 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ fi
# Clear any cached OpenCode plugin to force fresh download on next run
rm -rf "$HOME/.cache/opencode/node_modules/@plannotator" "$HOME/.bun/install/cache/@plannotator" 2>/dev/null || true

# Update Pi extension if pi is installed
if command -v pi &>/dev/null; then
echo "Updating Pi extension..."
pi install npm:@plannotator/pi-extension
echo "Pi extension updated."
fi

# Install /review slash command
CLAUDE_COMMANDS_DIR="${CLAUDE_CONFIG_DIR:-$HOME/.claude}/commands"
mkdir -p "$CLAUDE_COMMANDS_DIR"
Expand Down