Skip to content

Commit ee0365a

Browse files
committed
Update default browser viewport size to 1280x800
1 parent c7aaee1 commit ee0365a

File tree

11 files changed

+23
-23
lines changed

11 files changed

+23
-23
lines changed

src/core/Cline.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export class Cline {
8282
diffStrategy?: DiffStrategy
8383
diffEnabled: boolean = false
8484
fuzzyMatchThreshold: number = 1.0
85-
browserViewportSize: string = "900x600" // Default viewport size
85+
browserViewportSize: string = "1280x800" // Default viewport size
8686

8787
apiConversationHistory: (Anthropic.MessageParam & { ts?: number })[] = []
8888
clineMessages: ClineMessage[] = []

src/core/__tests__/Cline.browser.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ describe("Cline Browser Integration", () => {
5555
requestDelaySeconds: 0,
5656
screenshotQuality: 75,
5757
terminalOutputLineLimit: 1000,
58-
browserViewportSize: "900x600", // Default viewport size
58+
browserViewportSize: "1280x800", // Default viewport size
5959
}),
6060
postMessageToWebview: jest.fn(),
6161
postStateToWebview: jest.fn(),
@@ -103,7 +103,7 @@ describe("Cline Browser Integration", () => {
103103
it("should initialize browser session with default viewport size", async () => {
104104
const testCline = await createTestCline()
105105
expect(mockBrowserSession.setOnViewportChange).toHaveBeenCalled()
106-
expect((testCline as any).browserViewportSize).toBe("900x600") // Default size
106+
expect((testCline as any).browserViewportSize).toBe("1280x800") // Default size
107107
await testCline.abortTask()
108108
})
109109

src/core/prompts/__tests__/__snapshots__/system.test.ts.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,7 @@ Example: Requesting to write to frontend-config.json
11041104
Description: Request to interact with a Puppeteer-controlled browser. Every action, except \`close\`, will be responded to with a screenshot of the browser's current state, along with any new console logs. You may only perform one browser action per message, and wait for the user's response including a screenshot and logs to determine the next action.
11051105
- The sequence of actions **must always start with** launching the browser at a URL, and **must always end with** closing the browser. If you need to visit a new URL that is not possible to navigate to from the current webpage, you must first close the browser, then launch again at the new URL.
11061106
- While the browser is active, only the \`browser_action\` tool can be used. No other tools should be called during this time. You may proceed to use other tools only after closing the browser. For example if you run into an error and need to fix a file, you must close the browser, then use other tools to make the necessary changes, then re-launch the browser to verify the result.
1107-
- The browser window has a resolution of **900x600** pixels. When performing any click actions, ensure the coordinates are within this resolution range.
1107+
- The browser window has a resolution of **1280x800** pixels. When performing any click actions, ensure the coordinates are within this resolution range.
11081108
- Before clicking on any elements such as icons, links, or buttons, you must consult the provided screenshot of the page to determine the coordinates of the element. The click should be targeted at the **center of the element**, not on its edges.
11091109
Parameters:
11101110
- action: (required) The action to perform. The available actions are:
@@ -1126,7 +1126,7 @@ Parameters:
11261126
- Example: \`<action>close</action>\`
11271127
- url: (optional) Use this for providing the URL for the \`launch\` action.
11281128
* Example: <url>https://example.com</url>
1129-
- coordinate: (optional) The X and Y coordinates for the \`click\` action. Coordinates should be within the **900x600** resolution.
1129+
- coordinate: (optional) The X and Y coordinates for the \`click\` action. Coordinates should be within the **1280x800** resolution.
11301130
* Example: <coordinate>450,300</coordinate>
11311131
- text: (optional) Use this for providing the text for the \`type\` action.
11321132
* Example: <text>Hello, world!</text>
@@ -2225,7 +2225,7 @@ Example: Requesting to write to frontend-config.json
22252225
Description: Request to interact with a Puppeteer-controlled browser. Every action, except \`close\`, will be responded to with a screenshot of the browser's current state, along with any new console logs. You may only perform one browser action per message, and wait for the user's response including a screenshot and logs to determine the next action.
22262226
- The sequence of actions **must always start with** launching the browser at a URL, and **must always end with** closing the browser. If you need to visit a new URL that is not possible to navigate to from the current webpage, you must first close the browser, then launch again at the new URL.
22272227
- While the browser is active, only the \`browser_action\` tool can be used. No other tools should be called during this time. You may proceed to use other tools only after closing the browser. For example if you run into an error and need to fix a file, you must close the browser, then use other tools to make the necessary changes, then re-launch the browser to verify the result.
2228-
- The browser window has a resolution of **900x600** pixels. When performing any click actions, ensure the coordinates are within this resolution range.
2228+
- The browser window has a resolution of **1280x800** pixels. When performing any click actions, ensure the coordinates are within this resolution range.
22292229
- Before clicking on any elements such as icons, links, or buttons, you must consult the provided screenshot of the page to determine the coordinates of the element. The click should be targeted at the **center of the element**, not on its edges.
22302230
Parameters:
22312231
- action: (required) The action to perform. The available actions are:
@@ -2247,7 +2247,7 @@ Parameters:
22472247
- Example: \`<action>close</action>\`
22482248
- url: (optional) Use this for providing the URL for the \`launch\` action.
22492249
* Example: <url>https://example.com</url>
2250-
- coordinate: (optional) The X and Y coordinates for the \`click\` action. Coordinates should be within the **900x600** resolution.
2250+
- coordinate: (optional) The X and Y coordinates for the \`click\` action. Coordinates should be within the **1280x800** resolution.
22512251
* Example: <coordinate>450,300</coordinate>
22522252
- text: (optional) Use this for providing the text for the \`type\` action.
22532253
* Example: <text>Hello, world!</text>

src/core/prompts/__tests__/system.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ describe("SYSTEM_PROMPT", () => {
191191
true, // supportsComputerUse
192192
undefined, // mcpHub
193193
undefined, // diffStrategy
194-
"900x600", // browserViewportSize
194+
"1280x800", // browserViewportSize
195195
defaultModeSlug, // mode
196196
undefined, // customModePrompts
197197
undefined, // customModes,

src/core/prompts/tools/__tests__/browser-action.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe("getBrowserActionDescription", () => {
88
defaultArgs = {
99
cwd: "/test/path",
1010
supportsComputerUse: true,
11-
browserViewportSize: "900x600",
11+
browserViewportSize: "1280x800",
1212
diffStrategy: undefined,
1313
mcpHub: undefined,
1414
toolOptions: {},

src/core/webview/ClineProvider.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
10121012
await this.postStateToWebview()
10131013
break
10141014
case "browserViewportSize":
1015-
const browserViewportSize = message.text ?? "900x600"
1015+
const browserViewportSize = message.text ?? "1280x800"
10161016
await this.updateGlobalState("browserViewportSize", browserViewportSize)
10171017
await this.postStateToWebview()
10181018
break
@@ -1534,7 +1534,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
15341534
apiConfiguration.openRouterModelInfo?.supportsComputerUse ?? false,
15351535
mcpEnabled ? this.mcpHub : undefined,
15361536
diffStrategy,
1537-
browserViewportSize ?? "900x600",
1537+
browserViewportSize ?? "1280x800",
15381538
mode,
15391539
customModePrompts,
15401540
customModes,
@@ -2390,7 +2390,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
23902390
shouldShowAnnouncement: lastShownAnnouncementId !== this.latestAnnouncementId,
23912391
allowedCommands,
23922392
soundVolume: soundVolume ?? 0.5,
2393-
browserViewportSize: browserViewportSize ?? "900x600",
2393+
browserViewportSize: browserViewportSize ?? "1280x800",
23942394
screenshotQuality: screenshotQuality ?? 75,
23952395
preferredLanguage: preferredLanguage ?? "English",
23962396
writeDelayMs: writeDelayMs ?? 1000,
@@ -2705,7 +2705,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
27052705
diffEnabled: diffEnabled ?? true,
27062706
checkpointsEnabled: checkpointsEnabled ?? false,
27072707
soundVolume,
2708-
browserViewportSize: browserViewportSize ?? "900x600",
2708+
browserViewportSize: browserViewportSize ?? "1280x800",
27092709
screenshotQuality: screenshotQuality ?? 75,
27102710
fuzzyMatchThreshold: fuzzyMatchThreshold ?? 1.0,
27112711
writeDelayMs: writeDelayMs ?? 1000,

src/core/webview/__tests__/ClineProvider.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ describe("ClineProvider", () => {
342342
diffEnabled: false,
343343
checkpointsEnabled: false,
344344
writeDelayMs: 1000,
345-
browserViewportSize: "900x600",
345+
browserViewportSize: "1280x800",
346346
fuzzyMatchThreshold: 1.0,
347347
mcpEnabled: true,
348348
enableMcpServerCreation: false,
@@ -1021,7 +1021,7 @@ describe("ClineProvider", () => {
10211021
mode: "code",
10221022
enableMcpServerCreation: true,
10231023
mcpEnabled: false,
1024-
browserViewportSize: "900x600",
1024+
browserViewportSize: "1280x800",
10251025
experimentalDiffStrategy: true,
10261026
diffEnabled: true,
10271027
fuzzyMatchThreshold: 0.8,
@@ -1046,7 +1046,7 @@ describe("ClineProvider", () => {
10461046
// diffStrategy
10471047
getToolDescription: expect.any(Function),
10481048
}),
1049-
"900x600", // browserViewportSize
1049+
"1280x800", // browserViewportSize
10501050
"code", // mode
10511051
{}, // customModePrompts
10521052
{}, // customModes
@@ -1073,7 +1073,7 @@ describe("ClineProvider", () => {
10731073
customModePrompts: {},
10741074
mode: "code",
10751075
mcpEnabled: false,
1076-
browserViewportSize: "900x600",
1076+
browserViewportSize: "1280x800",
10771077
experimentalDiffStrategy: true,
10781078
diffEnabled: false,
10791079
fuzzyMatchThreshold: 0.8,
@@ -1099,7 +1099,7 @@ describe("ClineProvider", () => {
10991099
// diffStrategy
11001100
getToolDescription: expect.any(Function),
11011101
}),
1102-
"900x600", // browserViewportSize
1102+
"1280x800", // browserViewportSize
11031103
"code", // mode
11041104
{}, // customModePrompts
11051105
{}, // customModes
@@ -1124,7 +1124,7 @@ describe("ClineProvider", () => {
11241124
mode: "architect",
11251125
enableMcpServerCreation: false,
11261126
mcpEnabled: false,
1127-
browserViewportSize: "900x600",
1127+
browserViewportSize: "1280x800",
11281128
experiments: experimentDefault,
11291129
} as any)
11301130

src/services/browser/BrowserSession.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export class BrowserSession {
2121
private currentMousePosition?: string
2222
private sessionTimeout?: NodeJS.Timeout
2323
private readonly SESSION_TIMEOUT = 30 * 60 * 1000 // 30 minutes
24-
private viewportSize: string = "900x600" // Default viewport size
24+
private viewportSize: string = "1280x800" // Default viewport size
2525

2626
constructor(context: vscode.ExtensionContext) {
2727
this.context = context

src/services/browser/__tests__/BrowserSession.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ describe("BrowserSession", () => {
244244
})
245245

246246
it("should get current viewport size", () => {
247-
expect(browserSession.getViewportSize()).toBe("900x600") // Default size
247+
expect(browserSession.getViewportSize()).toBe("1280x800") // Default size
248248
})
249249
})
250250

webview-ui/src/components/chat/BrowserSessionRow.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const BrowserSessionRow = memo((props: BrowserSessionRowProps) => {
2929
const [maxActionHeight, setMaxActionHeight] = useState(0)
3030
const [consoleLogsExpanded, setConsoleLogsExpanded] = useState(false)
3131

32-
const { browserViewportSize = "900x600" } = useExtensionState()
32+
const { browserViewportSize = "1280x800" } = useExtensionState()
3333
const [viewportWidth, viewportHeight] = browserViewportSize.split("x").map(Number)
3434
const aspectRatio = ((viewportHeight / viewportWidth) * 100).toFixed(2)
3535
const defaultMousePosition = `${Math.round(viewportWidth / 2)},${Math.round(viewportHeight / 2)}`

0 commit comments

Comments
 (0)