Add browser pane element picker (#670)
* feat: add browser pane element picker Port the browser pane from PR #198 and route picked elements through workspace attachments so the context follows every agent composer in a workspace. Co-authored-by: Jason Kneen <jason.kneen@bouncingfish.com> * docs: document electron platform overlays * fix: harden browser pane navigation * fix: polish browser tab interactions * fix: route browser pane focus shortcuts --------- Co-authored-by: Jason Kneen <jason.kneen@bouncingfish.com>
This commit is contained in:
co-authored by
Jason Kneen
parent
34b95e7f01
commit
906205f97a
@@ -85,6 +85,17 @@ describe("prompt attachments", () => {
|
||||
).toContain("GitHub Issue #55: Issue");
|
||||
});
|
||||
|
||||
it("renders text attachments as their client-provided prompt text", () => {
|
||||
expect(
|
||||
renderPromptAttachmentAsText({
|
||||
type: "text",
|
||||
mimeType: "text/plain",
|
||||
title: "Browser element",
|
||||
text: "<browser-element>button.primary</browser-element>",
|
||||
}),
|
||||
).toBe("<browser-element>button.primary</browser-element>");
|
||||
});
|
||||
|
||||
it("returns undefined when firstAgentContext is empty", () => {
|
||||
expect(buildAgentBranchNameSeed(undefined)).toBeUndefined();
|
||||
expect(buildAgentBranchNameSeed({})).toBeUndefined();
|
||||
|
||||
@@ -24,6 +24,9 @@ export function renderPromptAttachmentAsText(attachment: AgentAttachment): strin
|
||||
}
|
||||
return lines.join("\n");
|
||||
}
|
||||
case "text": {
|
||||
return attachment.text;
|
||||
}
|
||||
case "review": {
|
||||
const lines = [`Paseo review attachment (${attachment.mode})`, `CWD: ${attachment.cwd}`];
|
||||
if (attachment.baseRef) {
|
||||
|
||||
@@ -727,6 +727,13 @@ export const GitHubIssueAttachmentSchema = z.object({
|
||||
body: z.string().nullable().optional(),
|
||||
});
|
||||
|
||||
export const TextAttachmentSchema = z.object({
|
||||
type: z.literal("text"),
|
||||
mimeType: z.literal("text/plain"),
|
||||
title: z.string().nullable().optional(),
|
||||
text: z.string(),
|
||||
});
|
||||
|
||||
export const ReviewAttachmentContextLineSchema = z.object({
|
||||
oldLineNumber: z.number().int().positive().nullable(),
|
||||
newLineNumber: z.number().int().positive().nullable(),
|
||||
@@ -758,6 +765,7 @@ export const ReviewAttachmentSchema = z.object({
|
||||
export const AgentAttachmentSchema = z.discriminatedUnion("type", [
|
||||
GitHubPrAttachmentSchema,
|
||||
GitHubIssueAttachmentSchema,
|
||||
TextAttachmentSchema,
|
||||
ReviewAttachmentSchema,
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user