Repository navigation
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. |
There was a problem hiding this comment.
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 reused draft is picked from any server or project, so New session can jump away from the project you're working in.
- While any draft has content, New session can no longer start an empty one. If you're already on that draft, the click does nothing.
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.
| const openNewTab = () => { | ||
| const kept = | ||
| settings.appearance.tabLayout() === "inbox" | ||
| ? tabsStore.findLast((tab) => { |
There was a problem hiding this comment.
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?
|
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. |
Issue for this PR
Closes #
Type of change
What does this PR do?
In the Inbox layout the sidebar doesn't show drafts. If you click New session, type something, open an existing session and then click New session again, the app makes a brand-new empty draft. The earlier draft keeps its text, but nothing in the UI can open it again.
In the Inbox layout,
openNewTabnow opens the newest draft that still has text, an attachment or a context item before making a new one. Other layouts are unchanged, because drafts show as tabs there.Known limit: the check only reads composer states already loaded in memory, so a draft saved in an earlier run and not opened since isn't found.
There's an alternative PR that shows drafts in the Inbox sidebar instead: #65525. Only one of the two should land.
How did you verify your code works?
tsc -binpackages/appI haven't run it in the app.
Screenshots / recordings
None (no visible UI change).
Checklist