Bug 464224

Summary: Inconsistent tab behavior when reopening session
Product: [Applications] kate Reporter: alyssa
Component: sessionsAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: groszdanielpub, lassi.vaatamoinen, nate, rs_rs_rs_rs_rs, soltesz.andras, waqar.17a
Priority: NOR    
Version First Reported In: 24.05.1   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Comparison of my Kate session before closing and reopening versus after.

Description alyssa 2023-01-13 02:45:42 UTC
Created attachment 155251 [details]
Comparison of my Kate session before closing and reopening versus after.

SUMMARY

I've got Kate set to load the last used session on startup, and to automatically save and restore newly-created unsaved files. Thus, when I close and reopen my Kate window, both saved and unsaved files I had open pre-close will remain available post-open.

However, there's an inconsistency in whether or not they appear in tabs upon reopening. The saved files reopen as tabs; the unsaved files, however, *don't* reopen as tabs on launch, instead needing to be clicked into via Quick Open or via the Documents sidebar interface in order to be reopened.


STEPS TO REPRODUCE

1. In Settings > Configure Kate... > Session, check "Load last used session" in the Application Startup Behavior box and "Newly-created unsaved files" in the Application Startup/Shutdown Behavior box.
2. Start a session.
3. Create a file with some text in it, in one tab, and save it somewhere as Test.txt. Create another file with some text in it, in another tab, and *don't* save it anywhere, leaving it in the interface as Untitled.
3. Close Kate.
4. Open Kate.


OBSERVED RESULT

On reopening, Test.txt will be open in a tab. Untitled, however, will *not* be open in a tab, despite having been reopened alongside Test.txt; it will only be visible in non-tab interface areas, such as Quick Open and the Documents sidebar panel. (If clicked into via one of those panels, it will then open as a tab as normal, and will at that point resist being re-closed without saving.)


EXPECTED RESULT

On reopening, both Test.txt and Untitled should be open in tabs, same as they both were on closing.


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux, Plasma 5.26.5
KDE Plasma Version: 5.26.5
KDE Frameworks Version: 5.101.0
Qt Version: 5.15.8


ADDITIONAL INFORMATION

I've attached a before/after screenshot, contrasting the state of the interface before closing and after reopening my Kate session, in case it's helpful helpful in clarifying the nature of the inconsistency. (If things were consistent, the before half and the after half would be ~identical.)
Comment 1 Bug Janitor Service 2023-02-27 05:31:49 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/1131
Comment 2 _rs 2023-04-26 08:45:21 UTC
Bug is still there in the latest stable Kate, 23.04.0
Comment 3 Waqar Ahmed 2023-11-17 08:18:31 UTC
*** Bug 470000 has been marked as a duplicate of this bug. ***
Comment 4 Grósz Dániel 2024-04-08 03:09:19 UTC
Newly created, unsaved files still don't get tabs when reopening the session on 24.02.1. They appear in the Documents sidebar and the contents are preserved, they just don't appear on the tab bar until opened from the Documents sidebar.

I haven't encountered Bug 470000 (marked a duplicate of this one but not exactly the same) where extra,  empty "Untitled (2)" etc. tabs are created instead.
Comment 5 Lassi Väätämöinen 2024-06-30 11:34:39 UTC
I actually noticed something possibly related, when reopening a session with multiple "Untitled (X)" documets
- Documents -pane in the sidebar listed total of 15 "Unttitled (X)" documents
- Tabswitcher (Ctrl+Tab) listed also correctly 15 "Untitled (X)" documents/tabs.

BUT: only 3 tabs actually open/visible in the main window tab area. When I switched to the hidden Documents-pane or Tabswitcher,  the tabs also were crearted into the window
Comment 6 Waqar Ahmed 2024-09-18 18:22:13 UTC
Fixed with https://invent.kde.org/utilities/kate/-/merge_requests/1578