Repository navigation
Todo
Labels
enhancementNew feature or request
Description
Is your feature request related to a problem? Please describe.
- Grouping widgets is the most common layout need after tabs. The tabs widget (feat(pages): let widgets sit in the tabs of a tabs widget #3212) already lets a widget name its parent; the container uses the same parent link without tabs.
Why this is needed
- Builders need to move and resize a group of widgets as one; today the only grouping is the tabs widget in review (feat(pages): let widgets sit in the tabs of a tabs widget #3212).
- buildiq parity: container is one of buildiq's presentational widgets (feature comparison, section 3).
- Plan: part of the step "copy of the keep widgets", target sprint 6. It reuses the parent link of feat(pages): let widgets sit in the tabs of a tabs widget #3212 (
parent_idandparent_tabontables_contexts_widget), so it lands after that pull request. Acceptance path 2 depends on it.
Describe the solution you'd like
- A widget that holds other widgets in its own grid, with an optional title and border, so a part of a page can be moved and resized as one.
Diagram
classDiagram
class Page {
tables_contexts_page
slug
version
}
class Widget {
tables_contexts_widget
type
gridX, gridY, gridWidth, gridHeight
settings
parentId
parentTab
}
class Container {
type container, new
title
border
}
class Tabs {
type tabs, from #3212
tabs
}
Page "1" --> "*" Widget : holds
Widget <|-- Container
Widget <|-- Tabs
Container "1" --> "*" Widget : parentId
Tabs "1" --> "*" Widget : parentId and parentTab
Acceptance Criteria
- Listed by
GET /api/2/widget-typeswith its settings schema. - A widget inside a container names the container as its parent, the way a widget names a tab in feat(pages): let widgets sit in the tabs of a tabs widget #3212.
- Deleting a container deletes the widgets inside it, after a confirmation.
- Containers do not nest in containers or tabs.
- Export and import keep the parent links.
- Unit tests, a Playwright spec that moves a filled container.
- Settings are stored as JSON text in the
settingstext column oftables_contexts_widget(at most 60000 bytes,GridWidgetTypes::SETTINGS_MAX_BYTES), not in a database JSON column, as advised on Grid pages in applications (frontend) #3099. Nothing is filtered or sorted on them. - Widgets are saved through the page route
PATCH api/2/contexts/{contextId}/pages/{pageId}, which declares#[RequirePermission]for managing the application, and the service checks the same right before it writes. A test saves a page with the new widget as a reader of the application and expects 403, as learned in the review of feat(contexts): give applications a menu with its own API #3135. - No new database column: the container reuses
parent_idof feat(pages): let widgets sit in the tabs of a tabs widget #3212, so no migration of its own. Deleting a container deletes its widgets in the same transaction as the container. - The bordered container uses
NcCard(feat: add NcCard component nextcloud-libraries/nextcloud-vue#9144). A title on the container is not repeated inside it (jancborchardt on Grid pages in applications (frontend) #3099). At phone width its grid stacks to one column. - Usable at 360 px wide: nothing cut off and no horizontal scroll of the page. Every action works with the keyboard alone.
Components
- CnContainerWidget (keep, week 44): the container widget type, copied as is: its own grid with an optional title and border.
Out of scope
- Nesting containers in containers or in tabs.
- Collapsible containers.
- Any change to the tabs widget (feat(pages): let widgets sit in the tabs of a tabs widget #3212).
Describe alternatives you've considered
Questions for maintainers
- A separate container type, or a tabs widget with one tab and no tab bar? Options: (a) a separate type on the parent link of feat(pages): let widgets sit in the tabs of a tabs widget #3212, (b) a setting on the tabs widget. We would go with (a): it maps one to one to buildiq's container, and the tabs widget keeps one behaviour.
- What happens to the widgets inside when a container is deleted? Options: (a) deleted with it, after a confirmation that says how many, (b) moved onto the page. We would go with (a), as the draft says, because (b) drops widgets in places the builder did not choose.
Additional context
Linking to other objects
- Object: a widget that holds other widgets through the parent link.
- Today: the only link between widgets is the tab parent link of feat(pages): let widgets sit in the tabs of a tabs widget #3212. Widgets are not linkable to objects in other apps.
- Linking to other objects does not apply beyond that. The issue keeps parent links through export and import and deletes the children with the container, the same cleanup rule that Link a row to objects in other apps: mails, Deck cards, files, rows of other tables #3468 sets for links.
- A widget that shows another app's object (a Deck board, a calendar, a text file) is the same registration question as Q2 (do apps register widgets for Tables?), still open on Grid pages in applications (frontend) #3099. The Teams widgets of Team dashboard circles#2552 and Team dashboard V1 circles#3010 go in a similar direction; maintainers can say whether Tables widgets and Teams widgets should share one registry.
Relevant files:
Related issues
Drafted with AI assistance from the project plan; @remko48 reviews it. Part of #3419.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity