Skip to content

refactor(web): use pavo fields, tables and switch instead of raw elements - #40

Open
TheMeinerLP wants to merge 2 commits into
refactor/web-pavofrom
refactor/web-pavo-forms
Open

TheMeinerLP wants to merge 2 commits into
refactor/web-pavofrom
refactor/web-pavo-forms

Conversation

@TheMeinerLP

@TheMeinerLP TheMeinerLP commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Why

Material 3 is mandatory for every OLF UI. Several Grus screens still used raw select, input and table elements, which look and behave differently from the rest of the app: different focus rings, different labels, no shared sorting or empty states. Moving between the overview and the pool or instance pages therefore feels like switching between two apps.

What changed

  • Instances list: the pool and state filters are M3Select; the table is M3DataTable. Links to the instance detail page sit in the cell slots. The table is shown only when there are rows, so the empty state is unchanged.
  • Instance detail: the console command input is an M3TextField (monospace via input-class). The send button and its data-test attributes are untouched.
  • Events: the text filter is an M3TextField; the live log is an M3DataTable with the same four columns. The raw <details> view stays in the summary cell.
  • Pools: the pool list and the instances of one pool use M3DataTable. The scaling form uses M3TextField per field, keeping the numeric input types, inputmode, step, min and max, and the existing error and hint texts.
  • Pool detail: the maintenance button is an M3Switch labelled with the maintenance text and bound to pool.maintenance. Toggling it only opens the existing confirm dialog; the switch follows the server state after a confirmed change, and a cancel leaves it where it was.

Tests

  • web/app/m3-only.test.ts reads every .vue file under app/pages and app/components and fails when a template contains a raw input, select, textarea or table tag. It was checked once against a deliberately raw file.
  • eslint.config.mjs allows dotted v-slot names, because Pavo's DataTable names its cell slots item.<column>.

Remaining differences from the Pavo table

Pavo 0.3.0 brought back URL sorting, row attributes, placeholders and unpaged tables. What still differs:

  • Surface: the table draws its own card (surface background, outline border, row hover). The pool tables used a container-low card with elevation, and the instance table a rounded outline; those now follow the component's styling.
  • Sort headers: the sort buttons show an arrow icon and an accessible name that states the next direction, instead of the text arrows. The data-test hooks on the header buttons (sort-name, sort-age) are not passed through by the component; the row hooks are.

Stacking

This PR is stacked on #39 (refactor/web-pavo) and targets that branch. Merge it after #39.

…ents

Material 3 is mandatory for OLF UIs. The raw select, input and table
elements looked and behaved differently from the rest of the app, so the
instance and event pages, the pool pages and the scaling form now use
M3Select, M3TextField, M3DataTable and M3Switch.

The instance list keeps its default order and sorts by name; the URL
sort parameters and the age sort are no longer applied to the table.

Add web/app/m3-only.test.ts, which fails when a page or component
template contains a raw input, select, textarea or table tag.

Allow dotted v-slot names in the lint config, because Pavo's DataTable
names its cell slots item.<column>.
…avo 0.3

Pavo 0.3.0 adds controlled sorting, server-side ordering, paging
switches and row attributes to the data table. Use them to bring back
the behaviour the pavo 0.2.0 tables lost:

- instances: name and age sort through the sort and dir query
  parameters again; the page keeps its own ordering (server-sort)
- instance, pool instance, event and pool tables render all rows
  without a footer, as they did before
- row data-test hooks (instance-row, pool-row, pool-instance-row,
  event-row) are set again through row-attrs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant