Conventions
The rules every screen obeys, in the order a screen is designed: the bar it has to clear, the states it must handle, what access and mobile require, what to build with, what it may cost, and how it is named. They are already followed by most of the code — this page states them so a new view does not have to rediscover them.
Design bar
What a screen has to be, independent of its shape. The rest of this page is how; this is what.
- Modern, and nothing invented. A solved problem takes its solved shape — the platform's component or a pattern below — not a new one. A screen that looks a decade old in a 2026 product is a finding, not a style.
- The essential information first. One headline figure per view, and the first band is the band that changes a decision. A number nobody acts on belongs on the detail view, not on the landing screen.
- One primary action per screen. Everything else is secondary or tertiary. The count of
PRIMARYbuttons is a number a review can name; two of them mean the screen has not decided. - A new button is a decision, not a detail. Before it is added, answer — in the MR — which existing affordance could carry it: a whole-row click, a
ContextMenu, an inline field, a disclosure, aTooltip. Fewer affordances is the better screen; the answer is what earns the button. - Nothing rendered that the user cannot act on. Dead chrome, a disabled control with no explanation, a read-only badge where a value would do — all findings.
- Legacy is audited, never inherited. Touching a view is the occasion for one pass over it: duplicate CSS, hand-rolled scaffolding where a primitive exists, buttons that earn nothing, contrast below the threshold, a mockup that lags the shape. Each finding is fixed in the MR or recorded in Known incoherence, with its measurement.
States
Every data region handles five. The mockup shows three of them — empty, loading and populated — because the empty state is the one a new user meets first.
- Populated — the real case, carrying the real data shape; a sample that shows only some of the fields mocks up a defect.
- Empty — the region says what it is empty of and what to do next;
EmptyPortfolioLayoutis the established shape for a grid with no rows. An empty first run is not an error. - Loading — a placeholder shaped like the content it will hold, never a bare
ProgressBarin the middle of the page and never a blank region. Vaadin renders the region before the data arrives, so the placeholder is a themed block of the right size. - Error — the reason and the next action, in place. A failed action surfaces through
GlacezNotification(the proxy layer already raises it); a failed read leaves the region with its message instead of an empty table. - Stale — data older than the range it claims says so, with its age. A pricing row is a closed day, and today is a live point appended from findata's latest closes; a chart that draws a closed day as if it were live is stale without saying so.
Accessibility
A gate, not a pass.
- Text contrast ≥ 4.5:1, measured on the real background. A
--lumo-*-text-colortoken paints words; a--lumo-*-colortoken paints fills and borders and reads 3.1–3.6:1 as 13 px text — the wrong token is the usual cause of an unreadable figure. - Visible focus, keyboard reachable. Every action reachable by mouse is reachable by Tab, and no stylesheet removes the focus ring.
- An icon-only control carries its name (
setAriaLabel), and a pushed event is announced — anaria-liveregion or theNotificationthe badge arrives with — not only counted. - Touch targets ≥ 44 px in the mobile pass below.
- Gate: Lighthouse accessibility 100 at 1440 and at 390. A score below it is a finding with its audit named, never a note in a review.
Mobile
The 390 px pass is its own review, not the desktop collapsed (playwright-cli resize 390 844). The layout owns the breakpoint and the collapse; this owns what must be true at that width.
- The primary action is bottom-reachable — a bottom sheet or a fixed action row in the thumb zone, not the desktop's top-right button squeezed down.
- Navigation is the bottom bar.
MobileFooteralready carries it andMobileHeaderthe account menu; a second mobile navigation pattern is a finding. - No hover-only affordance. Hover is a desktop hint (a tint, a cursor change); the action itself is visible and tappable.
- One column, headline still above the fold. The figure that makes the decision survives the collapse; the rest may scroll.
- A screenshot is not the measurement. Read the DOM for overflow, target size and contrast (see the
webapp-visual-checkskill); Firefox is the engine to hold them in.
Toolkit
Check before building, in this order — the first hit ends the search.
- Vaadin 25's own set — the component, not markup around it:
Grid/GridPro(lazyDataProvider, trees, detail rows),Charts,Dashboard,ContextMenu,MenuBar,Tooltip,Tabs/TabSheet,SplitLayout,Dialog/ConfirmDialog,Notification,Upload,VirtualList,MasterDetailLayout,RichTextEditor,Markdown. The pro set is already in the frontend dependencies; a hand-rolled markup beside a component that does the same is a finding. - This repo's tree —
GlacezTimeline,GlacezGrid,KeyValueGrid,GridLayout,NativeDetails,AsideHeader,ComponentHeader,EmptyPortfolioLayout. A shape copied into a second class is a primitive that has not been extracted yet. - CSS —
LumoUtilityin Java first, a themed selector only for a repeated structure (see Theme).
Cost
Speed is a product feature, so a view names what it spends.
- A call budget per open — how many backend calls the view makes, how many rows each returns, and the ms from the log line. The number is quoted in the MR; "it looks fine" is not evidence.
- One call per region, not per row. Rows come from a lazy
DataProviderwith a page size, never a whole collection fetched to be filtered in Java. - Bounded by what the view shows. A read path that grows with the user's history is a finding — the store does the work its indexes were built for.
Naming
| Thing | Rule | Examples |
|---|---|---|
| List view | plural | StrategiesView, PositionsView, TransactionsView |
| Detail view | singular, optional path param | StrategyView (strategy/:strategyID?), PositionView |
| Package | <domain>/{grid,component,form,chart} |
strategy/grid/StrategiesGrid, market/chart/MarketCapTimeline |
| Form aside | <Domain>Aside |
DcaAside, ScalpAside, ClosePositionAside, TradeBalancesAside, WithdrawalAside |
| Chart | <Domain><Metric>Timeline |
PortfolioUplTimeline, StrategyChangeTimeline |
| Grid | <Domain>Grid |
StrategiesGrid, PositionsGrid, TransactionsGrid |
| Card | <Role>Panel or <Domain><Role>Component |
NewsFeedPanel, StrategyInfoComponent, InstrumentCard |
| Section container | <Thing>Component extending GlacezComponent |
TimelinesComponent, PositionTimelinesComponent |
A Chart suffix is reserved for the switcher and gauge shapes. A time series is a Timeline.
Structure
- One archetype per view. See Archetypes. A view that needs two shapes is two views, or one shape with a section — not a hybrid.
- A routed view's root is a
Div.Mainis not the page-root base: the theme usesmainas a child selector (.form-with-aside-layout main,.checkout-form-view main), so a view that extendedMainwould have that grid applied to its own root. - Compose primitives. A titled section is a
GlacezComponent, a responsive row is aGridLayout, a table is aGlacezGridorKeyValueGrid. See Primitives. - Reuse before adding. A shape copied into a second class is a shared class that has not been extracted yet: extract it when the second caller appears, and never duplicate a config. The rule cuts both ways — a wrapper that only forwards is not a reuse, it is a layer.
rebuildMain(Component...)for content swaps, neverremove(main); main = new VerticalLayout(...); add(main).@Routealways insideMainLayout, exceptHomeView(/home). The layout owns the chrome, the scroll and the navigation.BeforeEnterObserverfor route-parameter loading and themustOnboardguard;HasDynamicTitlewhen the page title depends on the entity.
Layout and responsiveness
- 768 px is the breakpoint.
GlacezGrid.MOBILE_BREAKPOINT, thegrid-layoutCSS media query and theuni-column-viewmedia query all use it. Do not introduce a second breakpoint. GridLayouthandles the collapse. Rows become one column at ≤ 768 px; a view should not need its own mobile CSS for a row.GridLayoutfloors every child at 300 px, so a row of four or more cells wraps at 1440 (1184 px of content). A row that must stay on one line lowers the floor on its own cell class —.kpitakes it to 220 px — and never for every row.- Widths: detail and simple forms cap at 1024 px; form-with-aside caps at 1200 px; a dashboard is full width.
- Mobile chrome:
MobileHeaderandMobileFooterare fixed and 36 px tall; the theme'smain-layout.cssowns their styling. A view does not compensate for them. - No nested scroll containers.
MainLayoutscrolls; the exceptions are the report markdown body (max-height: 70vh) and grids with a deliberatemax-height.
Theme
- Dark only in
glacez-webapp-ui(@ColorScheme(DARK)). Do not write light-mode branches. - Lumo tokens only. Spacing
var(--lumo-space-*), colourvar(--lumo-contrast-*)/var(--lumo-*-text-color), radiusvar(--lumo-border-radius-*). A hard-coded hex is a finding, except the two established ones inglacez-cutom-styles.cssand the mobile header's#1C2532FF. - A stylesheet must be imported in
styles.cssto exist. An unimported file is dead weight. - Prefer
LumoUtilityclasses in Java over new CSS. A selector earns its place when it styles a repeated structure, not a single element. - Cards are a pattern, not a component:
VerticalLayout+Padding.LARGE+setPadding(false)+setSpacing(false)+ a theme-list spacing.
Known incoherence
The register the legacy pass writes to. One line per deviation: what it is, how much of it there is, and what the fix would be. A line is deleted when its fix lands — nothing is annotated as fixed — and an entry here is a candidate for a cleanup MR, never a rule to copy.
GlacezComponentis under-used — 20 components use it, but the dashboard and detail views hand-rollVerticalLayout+ComponentHeader, so there are two ways to make a titled section.- The theme is forked per webapp —
glacez-webapp-admincarries its own copy ofglacez-cutom-styles.cssandreport-markdown.css, and the copies have already diverged. There is no shared source; a change to one does not reach the other. PortfolioViewstill hand-rolls its panel header — its privatecreateHeader(title, subtitle)isComponentHeader.setTitle(String, String)line for line. The five*Asideclasses now shareAsideHeader; this is the last copy.InstrumentsGridhas no empty state — a failed or empty currency read leaves a blank table whereEmptyPortfolioLayoutis the established shape; the market screen's regime band now says it has no data, the table below it still does not.- Four classes add a badge theme as one space-separated value (
theme += " success") —RecordFileGrid,PositionGridUtils,StrategySnapshotDtoUtils,SimulationSnapshotDtoUtils. Vaadin splits it into two names and warns; add one name peradd().