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
28 changes: 24 additions & 4 deletions apps/opencode-plugin/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,12 @@ export async function handleReviewCommand(
shareBaseUrl: getShareBaseUrl(),
htmlContent: reviewHtmlContent,
opencodeClient: client,
onReady: handleReviewServerReady,
onReady: (url, isRemote, port) => {
handleReviewServerReady(url, isRemote, port);
if (isRemote) {
client.app.log({ level: "info", message: `[Plannotator] Open in browser: ${url}` });
}
},
});

const result = await server.waitForDecision();
Expand Down Expand Up @@ -275,7 +280,12 @@ export async function handleAnnotateCommand(
pasteApiUrl: getPasteApiUrl(),
gate,
htmlContent,
onReady: handleAnnotateServerReady,
onReady: (url, isRemote, port) => {
handleAnnotateServerReady(url, isRemote, port);
if (isRemote) {
client.app.log({ level: "info", message: `[Plannotator] Open in browser: ${url}` });
}
},
});

const result = await server.waitForDecision();
Expand Down Expand Up @@ -376,7 +386,12 @@ export async function handleAnnotateLastCommand(
pasteApiUrl: getPasteApiUrl(),
gate,
htmlContent,
onReady: handleAnnotateServerReady,
onReady: (url, isRemote, port) => {
handleAnnotateServerReady(url, isRemote, port);
if (isRemote) {
client.app.log({ level: "info", message: `[Plannotator] Open in browser: ${url}` });
}
},
});

const result = await server.waitForDecision();
Expand Down Expand Up @@ -407,7 +422,12 @@ export async function handleArchiveCommand(
shareBaseUrl: getShareBaseUrl(),
pasteApiUrl: getPasteApiUrl(),
htmlContent,
onReady: handleServerReady,
onReady: (url, isRemote, port) => {
handleServerReady(url, isRemote, port);
if (isRemote) {
client.app.log({ level: "info", message: `[Plannotator] Open in browser: ${url}` });
}
},
});

if (server.waitForDone) {
Expand Down
3 changes: 3 additions & 0 deletions apps/opencode-plugin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,9 @@ Use /plannotator-last or /plannotator-annotate for manual review, or set workflo
opencodeClient: ctx.client,
onReady: async (url, isRemote, port) => {
handleServerReady(url, isRemote, port);
if (isRemote) {
ctx.client.app.log({ level: "info", message: `[Plannotator] Open in browser: ${url}` });
}
},
});

Expand Down
6 changes: 3 additions & 3 deletions apps/pi-extension/plannotator-browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
startReviewServer,
type DiffType,
} from "./server.js";
import { openBrowser } from "./server/network.js";
import { openBrowser, isRemoteSession } from "./server/network.js";
import { parsePRUrl, checkPRAuth, fetchPR } from "./server/pr.js";
import {
getMRLabel,
Expand Down Expand Up @@ -82,8 +82,8 @@ export function getStartupErrorMessage(err: unknown): string {

function openBrowserForServer(serverUrl: string, ctx: ExtensionContext): void {
const browserResult = openBrowser(serverUrl);
if (browserResult.isRemote) {
ctx.ui.notify(`Remote session. Open manually: ${browserResult.url}`, "info");
if (isRemoteSession()) {
ctx.ui.notify(`[Plannotator] ${serverUrl}`, "info");
} else if (!browserResult.opened) {
ctx.ui.notify(`Open this URL to review: ${serverUrl}`, "info");
}
Expand Down