Skip to content

Conversation

@jpwhiting
Copy link

@jpwhiting jpwhiting commented Dec 3, 2025

  • Resolves: #
  • Target version: master

Summary

TODO

Checklist

  • I have run make prettier-write and formatted the code.
  • All commits have Change-Id
  • I have run tests with make check
  • I have issued make run and manually verified that everything looks okay
  • Documentation (manuals or wiki) has been updated or is not required

@github-project-automation github-project-automation bot moved this to To Review in Collabora Online Dec 3, 2025
@jpwhiting jpwhiting changed the title Private/whiting/coda q tabbed UI coda-q: tabbed UI Dec 3, 2025
@jpwhiting jpwhiting mentioned this pull request Dec 3, 2025
6 tasks
@jpwhiting jpwhiting marked this pull request as draft December 3, 2025 17:54
@jpwhiting jpwhiting force-pushed the private/whiting/coda-q-tabbed-ui branch from c2cf130 to 64a2162 Compare December 3, 2025 19:08
@jpwhiting jpwhiting changed the base branch from distro/collabora/co-25.04 to distro/collabora/coda-25.04 December 3, 2025 19:08
@jpwhiting jpwhiting marked this pull request as ready for review December 3, 2025 19:08
@jpwhiting jpwhiting force-pushed the private/whiting/coda-q-tabbed-ui branch from 64a2162 to d68c2e1 Compare December 7, 2025 19:51
@jpwhiting jpwhiting force-pushed the private/whiting/coda-q-tabbed-ui branch from d68c2e1 to 0c009ee Compare December 16, 2025 17:40
@jpwhiting
Copy link
Author

@Quwex @mmeeks I've updated this branch a bit. I've added a "Gather windows" action to the various view menus and ribbon bar that gathers all tab widgets into one primary window. It should only be "active" when there are multiple documents open but in practice the menu item looks like it's always there. This works better than trying to drag the tabs back onto the tab bar area of other windows. I'll look into dropping on the whole window next, that should be doable, but wasn't working when I tried it last. Maybe something in the WebengineView is causing a problem there.

Copy link
Contributor

@stbergmann stbergmann left a comment

Choose a reason for hiding this comment

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

Just a quick first round of comments of what I noticed so far.

When I run qt/coda-qt,

  • and select "New - Blank Document" it just exits;
  • and "Open" and select one existing document, it opens two windows each containing that document;
  • and "Open" and multi-select two different documents, they are opened into different windows, not into multiple tabs (and one of them is opened in two windows again)

@jpwhiting jpwhiting force-pushed the private/whiting/coda-q-tabbed-ui branch from 0c009ee to 4cb75ed Compare December 18, 2025 22:45
@jpwhiting
Copy link
Author

Just a quick first round of comments of what I noticed so far.

When I run qt/coda-qt,

* and select "New - Blank Document" it just exits;

* and "Open" and select one existing document, it opens two windows each containing that document;

* and "Open" and multi-select two different documents, they are opened into different windows, not into multiple tabs (and one of them is opened in two windows again)

Yep, I fixed the first one, working on the second one, but am getting a segfault that this laptop is somehow struggling to open. I'll note here when the branch is ready. I've fixed most of the noted items but opening multiple documents is still a bit wrong. Hoping to get it all working well by end of day though.

@jpwhiting jpwhiting force-pushed the private/whiting/coda-q-tabbed-ui branch 2 times, most recently from c5ecaf7 to 708d18d Compare December 19, 2025 01:43
@jpwhiting
Copy link
Author

@stbergmann ok, I think I've addressed all the points you raised. Opening a new document and files all working as expected now. The double loading was from a merge conflict I mistakenly took duplicate code from. Anyway, give it a shot I think this is ready.

Copy link
Contributor

@stbergmann stbergmann left a comment

Choose a reason for hiding this comment

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

One thing I notice is that now we keep the small size of the initial "Collabora Office - Start" window and open new/existing documents in that small window size, instead of switching to a full-screen document window after showing the initial start window.

(Also, I'm not sure whether we'll want to squash these ten commits when merging, or keep them. The first nine seem like a nice logical sequence that could be left as such, while the last "CODA-Q: Fix a few bugs in tabbed ui" is a bit of an outlier that might want to be merged into the respective commits it fixes? I'll leave the decision up to you.)

#include <QTimer>
#include <QUuid>

// (Temporary debug helper removed)
Copy link
Contributor

Choose a reason for hiding this comment

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

(this looks like a leftover comment that should be removed?)

Copy link
Author

Choose a reason for hiding this comment

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

Removed.

I fixed documents opening in the smaller starter screen just now. Added that fix to my last commit and removed that comment. I'm fine with squashing the whole branch to merge. If needed I can go through the exercise of splitting that last commit into the other relevant commits that they apply to, but squashing is fine with me and quicker/easier.

@jpwhiting jpwhiting force-pushed the private/whiting/coda-q-tabbed-ui branch 2 times, most recently from 36e214d to 60cdc46 Compare January 2, 2026 20:34
@Quwex
Copy link

Quwex commented Jan 6, 2026

Hi @jpwhiting testing the implementation, on GNOME there seems to be a few pixels width frame around the document at all times. That is more visible when Collabora Desktop is on dark mode. Would it be possible to have the tabs in general to react to the current theme of Collabora Desktop and maybe use the same colors?

image image

@Quwex
Copy link

Quwex commented Jan 6, 2026

Also Ctrl+W closes all the open tabs instead of the current one.

@jpwhiting
Copy link
Author

Hi @jpwhiting testing the implementation, on GNOME there seems to be a few pixels width frame around the document at all times. That is more visible when Collabora Desktop is on dark mode. Would it be possible to have the tabs in general to react to the current theme of Collabora Desktop and maybe use the same colors?
image image

Thanks for the feedback. That's interesting. I usually run plasma so didn't see that. I've just rebased my branch and changed ctrl-w to close only the current tab. I'll look into stlying the white line/border next and/or just removing that.

@jpwhiting
Copy link
Author

Also Ctrl+W closes all the open tabs instead of the current one.

Yep, fixed that just now, ctrl-w only closes the current tab now, pushing the changes one moment.

@jpwhiting jpwhiting force-pushed the private/whiting/coda-q-tabbed-ui branch from 60cdc46 to 2bb424c Compare January 6, 2026 17:00
@jpwhiting
Copy link
Author

@Quwex ok, I've removed the line around the window with a Qt stylesheet. It looks fine to me on GNOME now, but I don't use that much. let me know if I missed anything. (I'm not even sure how to choose a different desktop theme there, etc.)

@Quwex
Copy link

Quwex commented Jan 7, 2026

image

Yes the frame/line seems to be gone, thanks @jpwhiting!

To note, the tab styling still does not align with the system color scheme in GNOME (dark mode as seen in the title bar) nor with Collabora Desktop's dark mode styling.

Testing Ctrl+W, the behaviour seems to be unchanged here. When trying to close a tab, whole window ends up closing.
Keymapping of Ctrl+W was originally handled via the browser bits, where a "uno:CloseWin" message to Bridge:cool was received on Ctrl+W. My guess would be something goes south around qt/coda-qt.cpp:1022 where that is handled.

When a new document is opened, open in a new tab instead of
a separate window.
Adds a + button which invokes the new document dialog.
When the last tab is closed the application quits.
Show * when a file is modified.
When closing a tab if the file is modified ask user
to save, cancel, or discard.
Also make tabs movable.

Signed-off-by: Jeremy Whiting <[email protected]>
Change-Id: Iff748106caaf81253cfa6a6901e065d11396b716
Jeremy Whiting added 10 commits January 7, 2026 10:27
When a tab is dragged away create a new QMainWindow to hold the tab.
Use a helper function to create the + button on all QTabWidgets.
TODO: Implement merging tabs back into the same window via drag
and drop or menu actions.

Signed-off-by: Jeremy Whiting <[email protected]>
Change-Id: Ide6479f9d26feae521e6a2676fbf8efeee200850
Dragging a tab from one window can be dropped on another window
and it combines them back together.

Signed-off-by: Jeremy Whiting <[email protected]>
Change-Id: I0594feaffd835c8d15b10546b7442c18fcb9f95d
Instead of showing a functional but ugly "New Document" dialog
when + button is clicked. Open the backstage view.

Signed-off-by: Jeremy Whiting <[email protected]>
Change-Id: I16f3d542f702059957764f4061d72097073e7a2a
Make each WebView have it's own Window (Maybe these should be merged?)
Connect the + button clicked signal to the Window plusButtonClicked slot
which then tells the bridge of the tab that is currently showing (if
possible) to show it's backstage view.
If there's somehow no visible tab show the functional dialog instead.

Signed-off-by: Jeremy Whiting <[email protected]>
Change-Id: Ie59b110122bcee189a046ac21697f55f93c96ddd
Instead of just asking if we should save/discard/cancel prompt
for each modified file if it should be saved, discarded, or cancel
closing.

Signed-off-by: Jeremy Whiting <[email protected]>
Change-Id: I1dc6cbfa05e15ee4515559c2f5863475d67c2f84
When only 1 tab/document is open in a window hide the tab bar for now.
NOTE: This removes the drop target for merging windows back together,
but that can be fixed separately with a "Merge all windows" menu item
or similar.

Signed-off-by: Jeremy Whiting <[email protected]>
Change-Id: Id46651e41d4239332f7db7fc6a7cb4b03206562b
Depending on the mime type of the current tab/document
show x-office-(document|spreadsheet|presentation|drawing).svg

Signed-off-by: Jeremy Whiting <[email protected]>
Change-Id: If47389df617fcdfc4cd56f5b8473d66dcbc12eb5
When Gather Windows is triggered gather all tabs from separate
windows into one primary window.
Adds a windowCount method to only enable the Gather Windows
action if there are multiple tabs.

Signed-off-by: Jeremy Whiting <[email protected]>
Change-Id: I82798bcac466d5a6b4dbcd6e0ea5d1b69a7b7552
- Properly close the starter tab instead of a whole window.
- Open new documents in new tabs instead of a new window by default.
- Never open or create documents in the starter screen.

Signed-off-by: Jeremy Whiting <[email protected]>
Change-Id: I5a91c768b6e10b7cdf353ae74480277bc616e90f
To prevent a white line appearing around the whole document/window
on GNOME hide the border around the tabwidget completely.
Also use a light theme or dark theme depending on the system theme
for the tabs themselves.

Signed-off-by: Jeremy Whiting <[email protected]>
Change-Id: I112ffeda99082ffc6ba234c1f91faec2d4361b1e
@jpwhiting jpwhiting force-pushed the private/whiting/coda-q-tabbed-ui branch from 7ef7e23 to 9128b12 Compare January 7, 2026 17:27
@jpwhiting
Copy link
Author

image

Yes the frame/line seems to be gone, thanks @jpwhiting!

To note, the tab styling still does not align with the system color scheme in GNOME (dark mode as seen in the title bar) nor with Collabora Desktop's dark mode styling.

Testing Ctrl+W, the behaviour seems to be unchanged here. When trying to close a tab, whole window ends up closing. Keymapping of Ctrl+W was originally handled via the browser bits, where a "uno:CloseWin" message to Bridge:cool was received on Ctrl+W. My guess would be something goes south around qt/coda-qt.cpp:1022 where that is handled.

Ok, I removed my commit that tried to handle ctrl-w on the Qt side since that somehow is only working on plasma. I took a quick stab at fixing the code in qt/coda-qt.cpp that handles closewin uno message, but didn't get it working. I guess that will be up to you now since I'm off the project.

I also changed the last commit that just removed the border to also use a light or dark theme depending on the system theme. That works fine in plasma but I've no idea how to set the gnome theme to test on gnome. I'll leave that to you also but it should work I guess since it uses portalPrefersDark() from WebView.

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

Labels

None yet

Projects

Status: To Review

Development

Successfully merging this pull request may close these issues.

3 participants