Skip to content

feat(pages): add a tabs widget whose tabs hold their own widgets - #3217

Open
rubenvdlinde wants to merge 19 commits into
feat/noid/start-page-uifrom
feat/noid/tabs-widget-ui
Open

rubenvdlinde wants to merge 19 commits into
feat/noid/start-page-uifrom
feat/noid/tabs-widget-ui

Conversation

@rubenvdlinde

@rubenvdlinde rubenvdlinde commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Part of #3099, on top of #3216 (start page). The UI of the tabs widget from #3212: several grids in the room of one, each tab holding its own widgets, tables and views included. The tab strip and the description button come from #3091 by @taiebot, who is co-author of the commit; here they live in a widget instead of on the start page.

Like #3212, this can be dropped without affecting the others if the model of #3212 isn't wanted.

Size: 680 lines: 466 code and 214 tests.

What changes

  • The tab strip follows the tabs pattern: one tab stop, the arrow keys, Home and End, Enter or Space.
  • The tabs are edited in a tab editor instead of a text field: add, rename, move and remove, at most 20. Removing a tab moves its widgets onto the page.
  • Each tab's grid follows the page's column mode. A tab mounts the first time it's opened and then stays mounted.
  • In edit mode each tab has "Add widget to this tab", and its widgets are dragged, resized, configured and removed like any other, also from their menu. Saving sends parentIndex and parentTab for the widgets in a tab. Removing a tabs widget removes the widgets in its tabs. The widget dialog doesn't offer Tabs inside a tab.
  • A table or view widget shows the description of its table or view behind a "Show description" button (aria-expanded, aria-controls) instead of above the rows, so tables in a widget keep their room.

How it was tested

On Nextcloud 34 with PostgreSQL:

  • Playwright context-tabs-widget.spec.ts: tabs with a text and a table, the keyboard, the description button; adding a widget to a tab in edit mode and finding it after a reload. context-grid-pages.spec.ts again.
  • Cypress component tests TabsWidget.cy.js (one grid per tab, keyboard, saving with parentIndex) and CollapsibleDescription.cy.js
  • npm run lint, npm run stylelint and npm run build
  • no PHP changes

Known gap: dragging a widget inside a tab with the mouse doesn't move it yet; the drag is taken by the grid of the page (GridStack nested in GridStack). Moving and resizing from the widget's menu works inside tabs, and dragging on the page itself works. This needs fixing before this pull request leaves draft.

🖼️ Screenshots

Desktop (1400 px) Phone (420 px)
A tabs widget
A tab with a description
Editing the tabs

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed
  • 🔙 Backport requests are created or not needed: /backport to stableX.X
  • 📅 Milestone is set
  • 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@AndyScherzinger AndyScherzinger left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Review focused on performance, accessibility, security, clean code and architecture. The UI checks ran on a dev instance (MariaDB) with the frontend built from this PR, on pages with tabs widgets set up through the API. They covered axe-core 4.14 on a page with a tabs widget (only the four rules of the table grid that main already has, tracked separately), the tabs with the keyboard (arrows, Home, End, Enter work), the heading levels, saving, configuring, adding to a tab, narrow tabs widgets at 1920 px, and tab switches with a table in a tab.

Fixed by this PR, confirmed on the instance: saving an unchanged page keeps the widgets in their tabs (raised on #3213), and "Configure widget" on a tabs widget opens a working dialog (raised on #3214). Removing the last tab moves its widgets into the new last tab, and "Add widget to this tab" doesn't offer the tabs type and returns focus to its button.

Security: nothing found. Tab titles and widget texts are rendered as text, and the server validates the tabs setting again.

Also seen here, from earlier PRs:

  • The "Tabs, one per line" field shows the placeholder "Leave an empty line between paragraphs" from SchemaForm (the risk raised on #3214).
  • After the "Configure widget" dialog closes, focus is on <body>: the menu item that opened it no longer exists (reproduced; the dialog is from #3214, the configure flow from #3215).
  • WidgetService::appendDataWidget (#3211) counts the widgets inside tabs when it places a table added later on the start page, which leaves a gap below a tabs widget; counting only widgets with no parent fixes it (code check only).

Comment thread src/modules/grid/widgets/TabsWidget.vue Resolved
Comment thread src/modules/grid/GridPage.vue Resolved
Comment thread src/modules/grid/widgets/TabsWidget.vue Resolved
Comment thread src/modules/grid/widgets/TabsWidget.vue Resolved
Comment thread src/modules/grid/widgets/TabsWidget.vue Resolved
Comment thread src/modules/grid/widgets/TabsWidget.vue Resolved
@github-actions

Copy link
Copy Markdown
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

@rubenvdlinde
rubenvdlinde force-pushed the feat/noid/tabs-widget-ui branch from 189a625 to b7a29d7 Compare November 25, 2026 09:47
@rubenvdlinde
rubenvdlinde force-pushed the feat/noid/tabs-widget-ui branch from b7a29d7 to 1f75170 Compare November 27, 2026 14:53
@rubenvdlinde
rubenvdlinde force-pushed the feat/noid/tabs-widget-ui branch from 1f75170 to 91ab65a Compare November 30, 2026 08:03
@blizzz blizzz added enhancement New feature or request 3. to review Waiting for reviews labels Nov 30, 2026
@blizzz blizzz added this to the v3 milestone Nov 30, 2026
rubenvdlinde and others added 19 commits November 30, 2026 11:54
A tabs widget puts several grids in the room of one: each tab holds its
own widgets, tables and views included. The tab strip follows the tabs
pattern for the keyboard, and in edit mode each tab can get widgets of
its own, saved with parentIndex and parentTab. A table or view widget
shows the description of its table or view behind a button.

Co-authored-by: taiebot <13300652+taiebot@users.noreply.github.com>
Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Ruben van der Linde <ruben@conduction.nl>
A data widget shows the title of its table in its own heading, the table inside no
longer repeats it.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Ruben van der Linde <ruben@conduction.nl>
…abs spec

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Ruben van der Linde <ruben@conduction.nl>
…mponent

The page and every tab of a tabs widget rendered their canvas and widgets with their
own copy of the same template, and each tabs widget built its own widget map. GridLevel
renders one level from what the page provides, with the widget map built once there,
so a new widget action is wired in one place. A data widget without a table now hides
outside edit mode in a tab as well.

Assisted-by: ClaudeCode:claude-opus-5-5

Signed-off-by: Ruben van der Linde <ruben@conduction.nl>
GridStack takes a grid created inside an item of another grid for its sub grid and
sends its changes to the outer grid, which looped between the two in edit mode after a
tab switch. The canvas of a tab now detaches from the page grid right after it starts.

Assisted-by: ClaudeCode:claude-opus-5-5

Signed-off-by: Ruben van der Linde <ruben@conduction.nl>
Assisted-by: ClaudeCode:claude-opus-5-5

Signed-off-by: Ruben van der Linde <ruben@conduction.nl>
…panel

The button switched between "Show description" and "Hide description" while
aria-expanded changed too, and every widget's button had the same name. It is called
"Description of <title>" now and leaves the state to aria-expanded. The panel stays
in the page once opened, so aria-controls only points to it while it exists.

Assisted-by: ClaudeCode:claude-opus-5-5

Signed-off-by: Ruben van der Linde <ruben@conduction.nl>
The canvas of a tab chose its columns from its own width, so a tabs widget narrower than
about two thirds of the page showed its widgets reflowed, without the steps to arrange
them and with a hint that no window fixes. A nested canvas now arranges whenever the
page canvas does and only reflows with it; only the page shows the hint.

Assisted-by: ClaudeCode:claude-opus-5-5

Signed-off-by: Ruben van der Linde <ruben@conduction.nl>
…dget

The tabs widget provided the heading level it had when it was created, so widgets in a
tab kept it after the tabs widget got or lost a title.

Assisted-by: ClaudeCode:claude-opus-5-5

Signed-off-by: Ruben van der Linde <ruben@conduction.nl>
Each tab switch destroyed the open tab and built the other, so a data widget in a tab
loaded its rows again behind a spinner and lost its sorting, filter, search and scroll
position. A tab is now mounted when it is first opened and kept with v-show, each with
its own tabpanel, so its canvas is also no longer created again on every switch.

Assisted-by: ClaudeCode:claude-opus-5-5

Signed-off-by: Ruben van der Linde <ruben@conduction.nl>
…usable

Every tab list was called "Tabs", so two tabs widgets could not be told apart; it takes
the title of the widget when it has one. The tab panel scrolls, so it gets tabindex 0 as
in the APG tabs example, which lets it scroll with the keyboard in Safari.

Assisted-by: ClaudeCode:claude-opus-5-5

Signed-off-by: Ruben van der Linde <ruben@conduction.nl>
The prompt to name the tabs could not show, since a tabs widget has at least one tab,
while an empty tab showed viewers an empty panel. An empty tab now tells viewers it is
empty and asks editors to add widgets to it.

Assisted-by: ClaudeCode:claude-opus-5-5

Signed-off-by: Ruben van der Linde <ruben@conduction.nl>
…widget

Both tab lists move the focus through one rovingTabTarget() helper, which leaves keys
with Alt, Ctrl or Meta to the browser and starts from the tab the key was pressed on.
The tabs widget keeps one tab in the tab order when its tabs change and returns to the
open tab when the focus leaves it; in both lists a click puts the clicked tab back in
the tab order.

Assisted-by: ClaudeCode:claude-opus-5-5

Signed-off-by: Ruben van der Linde <ruben@conduction.nl>
TableWrapper is only used by data widgets, which always collapse the description, so
its other branch goes. AddWidget no longer keeps the tabs type for a configured tabs
widget in a tab, which the server refuses, nor does configureWidget set the tab it
needed. The tabs widget reads its settings from its widget, and the ids come from the
widget key and useId() instead of counters at module level.

Assisted-by: ClaudeCode:claude-opus-5-5

Signed-off-by: Ruben van der Linde <ruben@conduction.nl>
…label

Assisted-by: ClaudeCode:claude-opus-5-5

Signed-off-by: Ruben van der Linde <ruben@conduction.nl>
The server keeps the tabs of a tabs widget as a list of {key, title} and a
widget in a tab names the key of its tab, so the tabs widget, the grid levels
and the save now use that key instead of a position. Renaming, reordering or
inserting a tab keeps every widget in its tab, and the open tab stays open.

A tab that is removed in the widget settings moves its widgets onto the page,
below the widgets already there, each tab's widgets keeping their places
relative to each other. Nothing is deleted without being seen, the move can be
undone by cancelling the page edit, and no second dialog opens inside the
widget dialog.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Ruben van der Linde <ruben@conduction.nl>
A setting of type `tabs` gets its own editor in the widget settings instead of
a textarea with one tab per line: add a tab, rename it, move it up or down and
remove it. The editor stops at the `maxItems` of the schema, says how many
tabs there are, and marks a title of blanks only by the rule of the server,
so no-break, ideographic and zero width spaces count as blank too. Every
button is named after its tab, a move or removal is announced in a live
region, and the focus stays on a working button or moves to the next tab.

A new tab gets a key of twelve hex digits right away, as the server makes
them, so widgets can be put in it before the page is saved.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Ruben van der Linde <ruben@conduction.nl>
Tabs stay mounted once opened, so the add button is looked up in the panel of the open
tab; the text widget is called "Text".

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Ruben van der Linde <ruben@conduction.nl>
…le name

The same rule as the grid pages spec: a filter on the text of the list
item also passes when the option is announced under another name.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Ruben van der Linde <ruben@conduction.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews AI assisted enhancement New feature or request feedback-requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants