GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(browser): confirm before clearing browsing data by Hona · Pull Request #65124 · anomalyco/opencode

Conversation

@Hona

@Hona Hona commented Nov 20, 2026

Copy link
Copy Markdown
Member

Why

  • The gap: the red Clear browsing data button in Settings › Browser › Advanced acted at one click. It signs the person out of every site and deletes the history, and nothing brings that back.
  • Now: it asks first. Nothing is cleared until the dialog's red button is pressed.
Before: one click clears After: the button asks
The Browser data row with the red Clear browsing data button Clear browsing data? This signs you out of all sites and deletes history in OpenCode, leaving your other browsers untouched. Cancel, Clear data

The dialog

  • The app's own confirmation, ctx.dialogs.confirm({ danger: true }): a title, one line, Cancel and a red Clear data at the right end. No close button, as the app's other confirmations.
  • It opens on Cancel, so Enter does not clear by accident. Cancel, Escape and a click outside clear nothing, and the row is as it was.
  • The question is a state of the jobs machine, so a clear asks wherever it is started from and runs once:
stateDiagram-v2
  idle --> confirming: started(clear) / confirm
  confirming --> idle: answered(no) · Cancel, Escape, click outside
  confirming --> running: answered(yes) / run
  idle --> running: started(any other job) / run
  running --> idle: finished · failed · timed-out / notify
Loading
// What a job deletes cannot be brought back, so it asks first, wherever it was started from.
if (deletes(event.job))
  return { state: { status: "confirming", attempt, job: event.job, last: state.last }, effects: [{ type: "confirm", attempt, job: event.job }] }

Unchanged

  • What is cleared, the job, its timeout, the busy red button while it runs, and the row's result and failure lines. One line's words change: "Cleared sign-ins and site data, but history could not be cleared."
  • The site information's per-site Clear and the menu's Clear history are smaller actions and still act at once.
  • No new setting.

Tests

  • jobs-machine.test.ts: the question opens without a call to main; a no restores the surface; a yes runs once however often the button or the answer is pressed; stale answers, an answer after the surface went, a failure and a timeout.
  • browser-settings.spec.ts: through the app's real dialog, main gets no clear after Cancel, Escape, Enter on Cancel and a click outside, and exactly one after a double press on Clear data; focus opens on Cancel; the history-kept and failed lines.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Hona added 2 commits November 20, 2026 19:22
@Hona
fix(browser): confirm before clearing browsing data
320107f
The red button in Settings > Browser cleared cookies, site data, saved files, HTTP sign-ins and the history at one click. It now asks first, in the app's own confirmation dialog, which opens on Cancel. The jobs machine holds the question as a state, so a clear asks wherever it is started from, runs once, and a no leaves the surface as it was.
@Hona
Merge remote-tracking branch 'origin/dev' into browser-clear-confirm
ba6544d
opencodejr[bot]
opencodejr Bot reviewed Nov 20, 2026
View reviewed changes

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks sound. Clicking the red button now opens the app's own confirmation dialog first, and only Clear data runs the clear.

I checked it with the new jobs-machine tests (9 pass) and the Playwright component spec (12/12 pass). The spec drives the real PluginConfirmDialog: Cancel, Escape, Enter on Cancel and a click outside never call main's clear, and a double press on Clear data calls it exactly once. tsc -b passes for packages/gui-plugins.

Putting the question in the jobs state machine covers every place that can start a clear. An answer to an old question, or one after the page has gone, is ignored, and the dialog closes with the page that asked.

Public API unchanged: this only uses the existing ctx.dialogs.confirm, and everything else is internal to the browser plugin.

No concerns.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Hona
Hona merged commit bfee96a into dev Nov 20, 2026
26 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@Hona
Hona deleted the browser-clear-confirm branch November 20, 2026 12:03
huuhabn pushed a commit to huuhabn/opencode that referenced this pull request Nov 20, 2026
@Hona Huu Ha
fix(browser): confirm before clearing browsing data (anomalyco#65124)
345daf0
@BrewTestBot BrewTestBot mentioned this pull request Nov 23, 2026
opencode 2.4.0 Homebrew/homebrew-core#327368
Merged
@amrkmn amrkmn mentioned this pull request Nov 23, 2026
opencode 2.4.0 amrkmn/homebrew-tap#1251
Closed
1 task
@github-actions github-actions Bot mentioned this pull request Nov 23, 2026
feat: opencode release v2.4.0 sprisa/opencode-server#95
Merged
@scottames-github-bot scottames-github-bot Bot mentioned this pull request Nov 27, 2026
chore(deps): update ⬆️ mise-packages scottames/dots#1181
Merged
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@opencodejr opencodejr[bot] opencodejr[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@Hona
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.