GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||
GeezerVison is showing github.com — fix(app): keep the unsent draft when New session is clicked in the inbox by hearnadam · Pull Request #65518 · anomalyco/opencode Conversation
|
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 72 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Reviewed by reading the code; not verified in a running app. The change only affects the web/desktop app's Inbox layout, which I couldn't drive here. tsc -b in packages/app passes, and the titlebar and tabs unit tests pass.
The public API is unchanged.
The approach is reasonable, but two behaviours need a look before merge (see inline comments):
The known limit (drafts restored from disk aren't detected) means some drafts can still end up out of reach. Showing drafts in the Inbox sidebar would avoid this whole class of problem. That's only a thought, not a request for this PR.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| const openNewTab = () => { | ||
| const kept = | ||
| settings.appearance.tabLayout() === "inbox" | ||
| ? tabsStore.findLast((tab) => { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This picks the newest draft with content from any server or project. openDraft places a new draft in the current session's or draft's server and directory (or the home selection). So clicking New session while viewing a session in project B can reopen a draft from project A on another server. Could the search be limited to drafts in the same server/directory that openDraft would use for the current route?
When a draft with content exists, this always selects it. If you're already on that draft, New session (button and tab.new) does nothing, and in the Inbox layout there's no other way to start a second, empty draft. Should this fall through to openDraft(uuid()) when kept is the current tab, or skip the current tab when searching?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.