Skip to content

Ask before closing a Workspace tab with unsaved edits #342

Open

Description

@abhishekgahlot2

Closing a file tab in the Workspace panel throws away edits that are not saved yet (typing from the last moment before autosave, or anything left after a failed save) without asking.

Where to start

  1. closeWorkpiece removes the tab without reading the dirty state the panel already tracks (workspaceDirtyRef), and the editor's autosave timer is cleared when the editor unmounts.
  2. When the tab has unsaved edits, save first or ask Save / Discard before closing.
  3. Pull the close decision into a small pure function and test it.

Code to look at:

Done when

  • Closing a tab with unsaved edits saves them or asks first.
  • Closing a clean tab still closes at once.
  • A unit test covers dirty and clean closes.

Free to try

Sign up free at app.useagent.org. New accounts get free model credits (GLM or Claude Opus, up to a limit) and free cloud sandbox time, enough to finish this task without paying or adding a key.

Send it a small task in plain words and watch it work. You'll see the screens this issue is about. The link in the sign-up email works for 24 hours. Not there? Check spam.

Stuck? Comment here with a screenshot and we'll help.

Keep private details out of here

This page is public. Don't post your real email, phone number, address, payment details, API keys, or screenshots that show any of them. Send anything private, including how you'd like to be paid, to [email protected] with a link to your comment here.

Claim it

Comment /take and the issue is assigned to you. First come, first served.

Rules

  • Use the app while you work, and put before and after screenshots or a short recording in your pull request. For backend or docs work, show the result end to end.
  • One change per pull request. Run the checks in CONTRIBUTING.md.
  • AI help is fine, blind AI output is not. You must understand, run and explain every line you submit.
  • Untested or generated pull requests, and pull requests on an issue someone else claimed, are closed without a reply and don't count for Hacktoberfest.

Activity

  1. sharmis-tp commented on Oct 21, 2026

    @sharmis-tp

    I'd like to take this one. I'd have closeWorkpiece read the dirty state already tracked in workspaceDirtyRef and save first or ask Save / Discard before closing, with the close decision pulled into a small pure function and unit tests for dirty, clean and failed-save tabs. When a tab has unsaved edits, would you prefer a silent save first or always asking Save / Discard?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghacktoberfestOpen for Hacktoberfest contributorshelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions