Skip to content

Detail page type for one row #3435

Todo

Description

@rubenvdlinde

Is your feature request related to a problem? Please describe.

  • An application needs a page per record, not only lists. Today a row opens in a modal with every column in one list.
Why this is needed

Describe the solution you'd like

  • A page type that shows one row of a table: a header with the row's title column, and a widget grid with widgets that read from that row, such as its fields and its metadata.
Diagram
flowchart TD
    L[list or data widget] --> O[open a row]
    O --> A["address of the detail page with the row id (new)"]
    A --> R{can the user read the row?}
    R -- no --> X[404]
    R -- yes --> H[header with the row's title column]
    H --> G[widget grid bound to the row]
    G --> DW["data widget: the row's fields"]
    G --> MW["metadata widget: creator and dates"]
Loading
Acceptance Criteria
  • A detail page belongs to one table of the application and opens at an address with the row id. Uuids stay out of this address: inside one instance the id is enough, as agreed on UUIDs for rows #3093.
  • Widgets on the page can bind to the current row; a data widget shows the row's fields, a metadata widget its creator and dates.
  • A row the user cannot read answers 404.
  • Lists and data widgets can open a row in its detail page.
  • Export and import carry the page type.
  • Unit tests, a Playwright spec that opens a row from a list.
  • Creating or changing a detail page goes through the page routes, which declare #[RequirePermission] for managing the application, and the service checks the same right before it writes. A test runs every write as a reader and expects 403.
  • Widgets on the page show only the columns the reader may read.
  • The table a page is bound to is stored in a new nullable column on tables_contexts_page. Migration order: new columns nullable, backfill, then NOT NULL, then the index, with no empty-string default (Oracle stores '' as NULL), as on Technical name for tables and applications, CRUD routes by application and table #3094. The version in appinfo/info.xml is bumped. Where an index is added, write timings before and after go into the benchmark (Benchmark the rows API on a table of 100k rows #3424).
  • When the bound table is deleted or taken out of the application, the binding is cleared in the same transaction and the page shows an empty state, the way widget sources are cleared today (WidgetService::deleteSourcesByNodeRelIds).
  • The header uses NcBreadcrumbs (feat(NcBreadcrumbs): accept the breadcrumbs as data nextcloud-libraries/nextcloud-vue#9141) back to the list.
  • Usable at 360 px wide: nothing cut off and no horizontal scroll of the page. Every action works with the keyboard alone.
Components
  • CnDetailPage (rewrite, week 46): rewritten as the detail page type: the row by its id, the table's columns as its schema, the header and the widget grid. Presence and lifecycle are dropped; locks come with Show the audit trail and the lock on the detail page #3448 and the sidebar with Sidebar of the detail page with files, relations and activity #3436.
  • CnObjectDataWidget (rewrite, week 48): rewritten as the data widget of the detail page: the fields of the current row, from the Tables columns the reader may read.
  • CnObjectMetadataWidget (adapt, week 48): the metadata widget: creator, created and last edited of the current row (createdBy, createdAt, lastEditBy, lastEditAt), mapped from the Tables row instead of OpenRegister's @self.
  • CnDetailWidgetHost (adapt, week 46): renders one widget of the detail page, in a card or without frame inside a tab, so the page and the tabs widget share one dispatch.
  • CnDetailGrid (adapt, week 46): the label and value grid that shows a row's fields and metadata.
  • CnSummaryAggregates (adapt, week 48): count, sum and average chips in the page header over rows related to the current row; waits for the aggregation endpoint (Q9).
  • CnWidgetGrid (adapt, week 46): a grid of slots with a column count per slot from the page config, the slots of the detail page.
Out of scope

Describe alternatives you've considered

Questions for maintainers

  1. Which address opens a row? Options: (a) the application's address plus the page slug plus the row id, (b) a Tables-wide row address that finds a detail page. We would go with (a): one row can have different detail pages in different applications. (b) can redirect to (a) later, for reference URLs.
  2. What happens when the bound table goes? Options: (a) the page stays with its binding cleared, (b) the page is deleted with it. We would go with (a), as widget sources work today: a builder may rebind it.
  3. One detail page per table per application, or several? Options: (a) one, (b) several, chosen per list. We would go with (a), so "open a row" is never ambiguous.

Additional context

Linking to other objects
Relevant files:
Related issues

Drafted with AI assistance from the project plan; @remko48 reviews it. Part of #3419.

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

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions