Repository navigation
Todo
Labels
enhancementNew feature or request
Description
Is your feature request related to a problem? Please describe.
- A start page is mostly a way into the rest of the application. Today the only navigation is the application menu.
Why this is needed
- A start page is the way into an application, but today the only navigation is the application menu; a builder cannot put a tile or a quick link to a page, table or view on the page itself.
- buildiq parity: link, links, quicklinks, tile and menu are buildiq presentational widgets (feature comparison, section 3).
- Plan: part of the step "copy of the keep widgets", target sprint 6. The menu widget reads the menu API of feat(contexts): give applications a menu with its own API #3135 (in review, target sprint 5); visibility by group (Limit menu items, pages and widgets to groups #3444) decides which targets a viewer may open.
Describe the solution you'd like
- Navigation widget types for grid pages: one link button, a list of links, a row of quick links with icons, a tile (an icon, a title and a link), and a menu widget that shows the application menu or a group of it on the page.
Diagram
flowchart TD
V[viewer opens the start page] --> W{widget}
W -- "link, links, quicklinks, tile" --> T{target}
W -- menu --> M["menu of the application (#3135)"]
T -- "page, table or view by slug" --> A{can the viewer open it?}
T -- URL --> U[open the URL]
A -- yes --> O[open inside the application]
A -- no --> H[link not shown]
M --> A
Acceptance Criteria
- Each type is listed by
GET /api/2/widget-typeswith its settings schema. - A link can point at a page, table or view of the application, or at a URL.
- A link to something the viewer cannot open is not shown.
- The menu widget reads the menu of feat(contexts): give applications a menu with its own API #3135, so it changes when the menu changes.
- Export and import carry the widgets, with links inside the application mapped on import.
- Unit tests for the schemas, a Playwright spec per widget.
- 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. - Deleting a page, table or view, or taking it out of the application, removes the links to it from the widgets in the same transaction (blizzz on Grid pages in applications (data model and API) #3100). Links left behind by earlier versions are cleaned by a repair step once after upgrade, not by a recurring job.
- The tile uses
NcCard(feat: add NcCard component nextcloud-libraries/nextcloud-vue#9144 and feat(NcCard): add card component with collapsible and flush sections nextcloud-libraries/nextcloud-vue#9161), links useNcButtonandNcListItem. - Usable at 360 px wide: nothing cut off and no horizontal scroll of the page. Every action works with the keyboard alone.
Components
- CnLinkButtonWidget (keep, week 44): the link widget type: one button to a page, a table, a view or a URL.
- CnLinksWidget (keep, week 44): the links widget type: a list of links.
- CnQuicklinksWidget (keep, week 44): the quicklinks widget type: a row of links with icons.
- CnTileWidget (keep, week 44): the tile itself: an icon, a title and a link, in theme colours.
- CnDashTileWidget (keep, week 44): the renderer of the
tilewidget type around the tile, with three link kinds (another Nextcloud app, an outside URL, a page of the application). It also reads an older flat tile shape; Tables has no old tiles, so we propose to leave that branch out (new). - CnMenuWidget (keep, week 44): the menu widget type: the application menu or one group of it on the page, as a dropdown, a mega menu or a tree, with the current page highlighted.
- CnMenuItemEditor (keep, week 46): the tree editor in the menu widget's form: label, link and icon per item, children up to three levels, add and remove per row.
Out of scope
- Links to a single row: they need the detail page (Detail page type for one row #3435) and Link a row to objects in other apps: mails, Deck cards, files, rows of other tables #3468.
- Lists of links filled from data.
- Slicing, in landing order: one PR per type, link, links, quicklinks, tile, then menu once feat(contexts): give applications a menu with its own API #3135 is merged.
Describe alternatives you've considered
Questions for maintainers
- What happens to a link when its target goes? Options: (a) removed from the widget in the same transaction as the delete, (b) kept and hidden when the page renders. We would go with (a), as blizzz asked on Grid pages in applications (data model and API) #3100 for dependent data.
- What does the menu widget show? Options: (a) one group of the menu of feat(contexts): give applications a menu with its own API #3135, chosen in its settings, (b) always the whole menu. We would go with (a), with the whole menu when no group is chosen.
- Which word for the page an application opens on? jancborchardt asked on Grid pages in applications (frontend) #3099 for a word Nextcloud already uses. Options: (a) "Home", as in Talk, (b) "Dashboard", (c) keep "Start page". We would go with (a) "Home": Jan named Talk as the example, and "Dashboard" is already the Nextcloud Dashboard app, so two dashboards would confuse. The slug in the code can stay
dashboard(Page::START_PAGE_SLUG).
Additional context
Linking to other objects
- Object: widgets whose settings hold links to a page, table or view of the application, or to a URL.
- Today: the link column picks URLs through unified search; Tables' reference providers (
lib/Reference/ReferenceProvider.php) render links to tables and views as previews. Pages, rows and applications have no reference URL. Slugs are snake case and immutable:table_<id>,view_<id>,page_<id>(Technical name for tables and applications, CRUD routes by application and table #3094). - What this issue must do: store targets inside the application by type and slug, not by URL, so import maps them and access is checked per viewer. A link to a row or to an object in another app waits for row reference URLs (Link a row to objects in other apps: mails, Deck cards, files, rows of other tables #3468); then the widget can take a Smart Picker URL the way the link column does.
- 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
- Grid pages in applications (frontend) #3099
- feat(contexts): give applications a menu with its own API #3135
Drafted with AI assistance from the project plan; @remko48 reviews it. Part of #3419.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity