Skip to content

Primitives

The shared layer every view composes: seven Java components in com.glacez.webapp.ui.components and one theme. If a screen needs a titled section, a responsive row, a lazy block or a table, it uses one of these — not a fresh Div.

Java components

Class Extends What it is
layout/GlacezComponent VerticalLayout A titled section: ComponentHeader on top, a main content area below.
layout/ComponentHeader HorizontalLayout H2 title + secondary Span subtitle, justified BETWEEN.
layout/AsideHeader Header A summary aside's header: H3 title plus an optional Paragraph subtitle — the shape .summary-aside header styles.
layout/GridLayout FlexLayout The only sanctioned responsive row container.
layout/LazyComponent Div Defers a component's construction until the element is attached.
units/grid/GlacezGrid<T> GridPro<T> Grid base with mobile column management.
units/grid/KeyValueGrid GridPro<KeyValues> Key/value table: one key column, N value columns.

GlacezComponent

Constructor builds the header (setTitle("", "")) and a main VerticalLayout; setSizeFull(), setSpacing(false).

  • rebuildMain(Component...) — the sanctioned content swap. Clears main and re-adds. Use it instead of remove(main); main = new VerticalLayout(...); add(main).
  • withoutTitle() — removes the header and nulls it. After this, setTitle is a no-op.
  • setTitle(String, String) / setTitle(HorizontalLayout) / setSubtitle(String) — delegate to the header.

20 components use it. The dashboard and detail views build their own VerticalLayout + ComponentHeader instead — see Conventions.

ComponentHeader

The title is an H2 with FontSize.XLARGE and Margin.NONE; the subtitle a Span with TextColor.SECONDARY and FontSize.XSMALL. setTitle(HorizontalLayout) replaces the title with an arbitrary row — that is how a view puts a button or badge beside its title.

GridLayout

setWidthFull(), class grid-layout, flex-wrap: wrap, gap: var(--lumo-space-xs).

addRow(Component...): - one component → flex-basis: 100% - N components → flex: 1 1 calc(max(300px, <N>% - var(--lumo-space-m)))

The CSS enforces the floor: .grid-layout > * { min-width: 300px }, and at ≤ 768 px every child becomes flex-basis: 100% !important; min-width: 0. So a row of four cards collapses to a single column on mobile without any Java change.

LazyComponent

Div whose addAttachListener calls the supplier only when getElement().getChildCount() == 0. Use it for expensive children — charts, grids — that should not be built for a view the user never opens.

GlacezGrid<T>

GridPro with GridVariant.LUMO_NO_BORDER and a MOBILE_BREAKPOINT of 768 px.

  • registerColumn(String key, Grid.Column<T> column) — call after creating each column to enroll it in mobile management.
  • getMandatoryMobileColumns() — override to return the keys that must stay visible on mobile.
  • applyInitialColumnVisibility() — call after all columns exist. It assumes mobile first and hides non-mandatory columns, so the page does not flash all columns before the real viewport width is known.

KeyValueGrid

GridPro<KeyValues> with LUMO_NO_BORDER and LUMO_NO_ROW_BORDERS, selection NONE, --lumo-size-m: 50px. The key column is START-aligned and auto-width; value columns are END-aligned and auto-width. hideKeyColumn() removes the key column and centers the values; attachHeader(List<String>) sets the header row.

Theme

src/main/frontend/themes/Glacez-UI/, applied globally by @CssImport("themes/Glacez-UI/styles.css") on GlacezUi — not by @Theme, and theme.json is empty. styles.css imports every stylesheet in order; a new stylesheet that is not imported there does nothing.

Path Carries
main-layout.css Drawer and side-nav, the fixed mobile header/footer (36 px, #1C2532FF, radius l).
custom/glacez-cutom-styles.css Global one-offs: .transactions-tabsheet, .glacez-highlight, .glacez-silver-highlight. Note the filename typo — it is cutom, not custom, and renaming it means updating the import.
custom/actions-layout.css .actions-layout card/grid treatment used by action lists.
custom/grid-layout.css The GridLayout floor and mobile collapse.
custom/uni-column-view.css The detail archetype: max-width 1024 px, centered, mobile padding --lumo-space-s.
custom/report-markdown.css .glacez-report-markdown typography for <vaadin-markdown> bodies.
views/*.css Per-view selectors: portfolio-view, market-view, instrument-view, feed-view, credit-card-form-view, onboarding-view, form-with-aside-layout.

Tokens

Everything is Lumo. The theme overrides the font scale in styles.css (--lumo-font-size 1rem, xxxl 1.75rem, xxl 1.375, xl 1.125, l 1, m 0.875, s 0.8125, xs 0.75, xxs 0.6875; line-height m 1.4, s 1.2, xs 1.1). Spacing is always var(--lumo-space-*); the most-used are s, m, l, xs, xl.

Cards are not a component. The pattern is a VerticalLayout with Padding.LARGE, setPadding(false), setSpacing(false) and a theme-list spacing (spacing-l or spacing-s) — see PortfolioView.createHighlight and createTopChangePositions.

Removed

gridwith-filters-view, master-detail-view and collaborative-master-detail-view were Vaadin starter residue in the UI theme — no Java class referenced them — and were deleted. glacez-webapp-admin still uses gridwith-filters-view in its own theme; do not resurrect the UI copy.