diff --git a/plugins/ui5/README.md b/plugins/ui5/README.md index c73b603..8494784 100644 --- a/plugins/ui5/README.md +++ b/plugins/ui5/README.md @@ -108,6 +108,17 @@ Authoritative development guidelines for all UI5 table controls (SAPUI5 1.136+ L - **Personalization** - `sap.m.p13n.Engine` integration - **Cell templates & alignment** - Type-based alignment and model type namespace rules +#### ui5-fiori-guidelines + +Picks the correct SAP Fiori / UI5 control for a use case — and stops the wrong one — giving both the SAPUI5 class and the `ui5-*` web component tag: + +- **Wrong → Right mapping** - The exact wrong control mapped to the right one (e.g. `sap.m.Bar` used as an app header → `sap.f.ShellBar` / `ui5-shellbar`) +- **Use-case → Component map** - "App-level navigation" → `ShellBar`; "list → detail split" → `FlexibleColumnLayout` +- **Table selection by data, not looks** - Responsive vs Grid vs Analytical vs Tree, and when a responsive table degrades +- **Decision-first reference files** - Per control: when to use, when NOT (with the alternative), machine-checkable rules, gotchas — across actions, inputs, containers, navigation, lists/tables, display, messages, AI, and upload +- **Critical one-liners** - One emphasized button per page, icon-only buttons need a tooltip, links navigate / buttons act, Popover is non-modal / Dialog is modal +- **Maintenance** - `REFRESH.md` documents an agent-driven re-sync against SAP sources with human review (no unattended writes) + --- ## Installation diff --git a/plugins/ui5/skills/ui5-fiori-guidelines/README.md b/plugins/ui5/skills/ui5-fiori-guidelines/README.md new file mode 100644 index 0000000..fe57119 --- /dev/null +++ b/plugins/ui5/skills/ui5-fiori-guidelines/README.md @@ -0,0 +1,61 @@ +# SAP Fiori Component Selection Skill + +Picks the correct SAP Fiori / UI5 control for a use case — and stops the wrong one (a `sap.m.Bar` used as an +app header, a responsive table used for large and complex data). This skill catches those before the code ships. + +Built for AI coding assistants working alongside application developers. + +## What it does + +- **Wrong → Right mapping.** The exact wrong control → the correct one, with the `sap.*` class and OpenUI5 / SAPUI5 availability. +- **Use-case → Component map.** "I need to show app navigation" → `ShellBar`, not `Bar`. +- **Decision-first reference files.** Every component: when to use, when NOT (with the alternative), machine-checkable rules, gotchas. No anatomy, no fluff. + +## Usage + +Starts automatically on SAP Fiori / UI5 questions and on code containing UI5 control names. Example triggers: + +- "How do I build a navigation bar in Fiori?" +- "I'm using sap.m.Bar for my app header" (→ ShellBar) +- "Which table should I use for large and complex data?" +- "Which control for a brief success confirmation?" (→ MessageToast) +- "Review my Fiori app against the guidelines" (→ review mode, implementation checklist) + +## Contents + +`SKILL.md` is the router: Wrong→Right table, Use-case→Component map, reference routing, critical one-liners. + +| Reference file | Topic | +|---|---| +| `component-selection.md` | Full wrong→right + table-type decision + long tail | +| `theming-tokens.md` | CSS tokens, semantic colors, density tiers | +| `ui-actions.md` | Buttons, links, toggle/segmented/menu buttons, menu, table toolbar | +| `ui-inputs.md` | Inputs, selects, combo/multi, pickers, mask, filter bar, facet filter, value help | +| `ui-layouts.md` | Dynamic page, flexible column layout, side panel, app / nav container | +| `ui-containers.md` | Cards, dialog, popover, quick view, color palette, P13n, variant management | +| `ui-navigation.md` | Shell bar, user menu, product switch, icon tab bar, tab container, side nav, shell search, breadcrumbs | +| `ui-lists-tables.md` | Responsive / Grid / Analytical / Tree table, Grid List, List, pull to refresh | +| `ui-display.md` | Avatar, progress, busy, illustrated message, carousel, tag, generic tag, expandable text, image, draft indicator | +| `ui-messages.md` | Message strip / box / toast / popover | +| `ui-ai.md` | AI button, guided/quick prompts, regenerate, local AI notice | +| `ui-upload.md` | File Uploader vs Upload Set | +| `implementation-checklist.md` | Code-review checklist for a built app (review mode) | + +## Tests + +`tests/eval.json` holds manual evaluation cases: control-selection prompts, reference-dispatch checks, +and review-mode fixtures under `tests/fixtures/`. See `tests/README.md`. + +## Maintenance + +`REFRESH.md` documents the repeatable, agent-driven process to re-sync against latest SAP sources +(diff + human review, no unattended writes). + +## Version + +Source: SAP Fiori Design Guidelines (`sap.com/design-system/fiori-design-web/`). Control names verified against `ui5.sap.com`. + +| Area | Guideline version | UI5 API version | Refreshed | +|---|---|---|---| +| Button (`ui-actions.md` Button + Split Button) | v1.151 | 1.153.0 | 2026-10-21 | +| Everything else | not stamped (pre-refresh snapshot) | — | — | diff --git a/plugins/ui5/skills/ui5-fiori-guidelines/REFRESH.md b/plugins/ui5/skills/ui5-fiori-guidelines/REFRESH.md new file mode 100644 index 0000000..cc7abcc --- /dev/null +++ b/plugins/ui5/skills/ui5-fiori-guidelines/REFRESH.md @@ -0,0 +1,91 @@ +# Refreshing this skill + +The skill is a snapshot of SAP Fiori guidelines + UI5 APIs. Sources change. This is the repeatable +process to re-sync it and keep it up to date. **No unattended writes** — the process reports drift and proposes edits; a +human reviews and applies. + +## Authoritative sources + +| Source | URL | Reachable? | Use for | +|---|---|---|---| +| Fiori Design Guidelines | `sap.com/design-system/fiori-design-web/` | Yes, via versioned `.plain.html` (below) | Design rules, when-to-use | +| SAPUI5 / OpenUI5 API | `ui5.sap.com/` | Yes | Verifying `sap.*` class names, deprecations, OpenUI5 library membership | +| Theming tokens | `github.com/SAP/theming-base-content` | Yes (raw.githubusercontent.com) | CSS token names + values | + +### Fetching the design guidelines + +The portal is client-rendered, but each page's content is served as a static HTML fragment: + +```bash +B=https://www.sap.com/design-system/fiori-design-web +curl -sS "$B/v1-151/ui-elements/button/usage.plain.html" # guideline body (When to Use, Types, Guidelines…) +curl -sS "$B/v1-151/ui-elements/button.plain.html" # hero: title + sap.* classes +``` + +- **Use a versioned path.** Unversioned URLs (`$B/ui-elements/button/`) return 404. Versions are published + every third release (`v1-136`, `v1-139`, … `v1-151`); find the newest by probing upward until 404. +- **Headers.** Plain `curl` works. A browser `User-Agent` *without* an `Accept` header gets a 403 from the + bot filter; send `Accept: text/html` with it. `WebFetch`-style tools hit the unversioned URL and fail. +- **Slug** = the control name in kebab case (`menu-button`, `segmented-button`, `upload-set`). Links inside a + page point to sibling slugs. +- **Strip before use.** Content contains `[internal_only]…[/internal_only]` blocks and links to + `wiki.one.int.sap` / `wiki.wdf.sap.corp` — drop both (internal SAP material). Keep `[external_only]` text. +- **API JSON** for step 2: `ui5.sap.com/test-resources//designtime/apiref/api.json` + (e.g. `sap/m`, `sap/ui/core`); current version at `ui5.sap.com/resources/sap-ui-version.json`. + +## Refresh process (agent-driven diff + review) + +Run one agent per file group so context stays scoped. Each agent: +1. Reads its current reference file(s). +2. Fetches the matching live source(s) above. For every `sap.*` class, checks `ui5.sap.com` for + existence, deprecation, and whether the library is part of OpenUI5 or SAPUI5-only. For tokens, fetches + `theming-base-content`. +3. Diffs live vs current and **reports** — new/renamed/deprecated controls, changed token values, + new wrong-component pitfalls, dead links — plus a proposed edit list. It does **not** write. +4. A human reviews the report and applies edits. + +File groups: `ui-actions/inputs/navigation` · `ui-containers/layouts/lists-tables` · +`ui-display/messages/ai/upload` · +`SKILL.md + component-selection/theming-tokens`. + +Can be launched as a Workflow (one agent per group, results collected) or via the Agent tool. + +### Scheduled refresh + +The Fiori design portal cannot be fetched live while the skill runs, so the skill is maintained as a +snapshot. To keep it from drifting, run the process above on a schedule — at least once per UI5 +release — for example from a CI job that runs the agents and opens a pull request containing only the +drift report and proposed edits. The "no unattended writes" rule still applies: a human reviews and +merges. + +## Invariants every refresh must preserve + +- Decision-first contract per section: **OpenUI5 / SAPUI5 control · Use when · Do NOT use when → alternative · Rules · Gotchas.** No anatomy, no state prose. +- Every control names its `sap.*` class and OpenUI5 vs SAPUI5 availability. +- When a guideline page names a deprecated API, follow the API: recommend the replacement and mention the deprecated name only as a gotcha. +- A section with no guideline page is marked "API-based, no guideline page" on its control line. +- SKILL.md body stays a router: Wrong→Right table, Use-case→Component map, routing table, one-liners. Keep it under ~200 lines; keep `description` under ~1,536 chars. +- Tone: short, concise, no fluff. + +## Verification after any refresh + +```bash +# 1. No scrape artifacts or dead/internal links (must return nothing) +grep -rnE '\+-+x-+\+|:badge|:decline:|:overflow:|:bell:|builder-prospect|ui5\.github\.io|wiki\.one\.int\.sap|&#x[0-9a-f]+;|Section Metadata|external_only' references/ SKILL.md + +# 2. Every ui-*.md component section names a sap.* identifier (spot-check) +grep -rnE '`sap\.' references/ui-*.md | head + +# 3. SKILL.md budget +wc -l SKILL.md # target < 200 +``` +- For each `sap.*` class, confirm via `ui5.sap.com` that it exists and note OpenUI5 vs SAPUI5 availability. +- Run the cases in `tests/eval.json` (see `tests/README.md`); add a case for every new control or wrong→right row. +- Trigger test in a fresh session: "how do I build a navigation bar in Fiori", "I'm using sap.m.Bar + for my header", "which table for large and complex data", "design an object page" should each surface the right + guidance. + +## Version stamping + +- Record the SAP Fiori guideline version and refresh date in `README.md`. +- On material change, bump the version line in `README.md`. diff --git a/plugins/ui5/skills/ui5-fiori-guidelines/SKILL.md b/plugins/ui5/skills/ui5-fiori-guidelines/SKILL.md new file mode 100644 index 0000000..f65cbf3 --- /dev/null +++ b/plugins/ui5/skills/ui5-fiori-guidelines/SKILL.md @@ -0,0 +1,91 @@ +--- +name: ui5-fiori-guidelines +description: Picks the correct SAP Fiori / UI5 control for a use case and prevents the usage of the wrong one; also reviews built OpenUI5/SAPUI5 apps against the Fiori guidelines. Use when (1) choosing between UI5 controls or planning page and app layout (DynamicPage, FlexibleColumnLayout, ObjectPageLayout, ShellBar, ToolPage, App), or (2) the user asks to review, audit, or check an existing Fiori app, view, or fragment against the Fiori guidelines. Covers sap.m.*, sap.f.*, sap.tnt.*, sap.uxap.*, sap.ui.table.* in XML views, fragments, controllers, and manifest.json. Catches classic wrong-component mistakes, for example sap.m.Bar as app header (use sap.f.ShellBar), List as side navigation (use sap.tnt.SideNavigation), responsive sap.m.Table for large data (use sap.ui.table.Table) or group subtotals (use AnalyticalTable), Dialog for a plain error (use MessageBox or MessageStrip), Page for object details (use sap.uxap.ObjectPageLayout). +--- + +# SAP Fiori Component Selection + +The job of this skill: pick the right control for the task or plan the correct Fiori application architecture / UX. + +## Two modes + +- **Select** (default) — the user is choosing a control or planning a layout. Answer from the tables below; open one reference file only when they do not answer it. +- **Review** — the user asks to review, audit, or check existing code against the Fiori guidelines. Read `references/implementation-checklist.md` and check every item against the code. Report each failing item under its checklist section with the file, the control, and the fix. If nothing fails, reply "No Fiori guideline violations found." + +## OpenUI5 vs SAPUI5 + +OpenUI5 and SAPUI5 share almost all `sap.*` controls. Label availability explicitly: +- **OpenUI5 / SAPUI5** — `sap.m`, `sap.f`, `sap.tnt`, `sap.uxap`, `sap.ui.table`, `sap.ui.layout`, `sap.ui.unified`, `sap.ui.mdc`, `sap.ui.fl`, `sap.ui.integration`. +- **SAPUI5** only — `sap.ui.comp.*` (smart controls), `sap.fe.*`, `sap.suite.ui.*`, `sap.ushell.*`. + +## Wrong → Right + +| Developer says / writes | WRONG | RIGHT | Why | +|---|---|---|---| +| "navigation bar", "app header", "top bar" | `sap.m.Bar` | `sap.f.ShellBar` | Bar is a generic toolbar; ShellBar is the app-level header (logo, search, notifications, profile, Joule). | +| "side menu", "left navigation" | `sap.m.List` | `sap.tnt.SideNavigation` | List has no nav semantics, expand/collapse, or selection state. | +| "tabs on a page", "sections" | `sap.m.TabContainer` | `sap.m.IconTabBar` | TabContainer is editable multi-document tabs; IconTabBar is in-page section/filter nav. | +| "header with title + actions on a detail page" | `sap.m.Bar` / `sap.m.Page` | `sap.uxap.ObjectPageLayout` | ObjectPage provides standard header + anchored sections. | +| "error popup", "confirmation dialog" | hand-built `sap.m.Dialog` | `sap.m.MessageBox` | MessageBox gives semantic types and standard buttons. | +| "inline error / warning banner" | `sap.m.Dialog` / `MessageBox` | `sap.m.MessageStrip` | Dialogs interrupt; strips are non-blocking. | +| "brief success confirmation" | `sap.m.MessageStrip` / `Dialog` | `sap.m.MessageToast` | Toast auto-dismisses; a strip persists. | +| "many validation errors at once" | repeated `MessageStrip` | `sap.m.MessagePopover` | One entry point, grouped by severity. | +| "big data table", "grid table with thousands of rows" | `sap.m.Table` | `sap.ui.table.Table` | Responsive table degrades past ~200 loaded items; grid table is for large desktop datasets and column comparison. | +| "subtotals per group", "multilevel grouping" | `sap.m.Table` | `sap.ui.table.AnalyticalTable` (V4: `Table` + `ODataV4Aggregation`) | Responsive table only has footer totals, no group subtotals. A single column total stays in `sap.m.Table`. | +| "hierarchy / tree" | grouped `AnalyticalTable` | `sap.ui.table.TreeTable` | Grouping clusters by value; TreeTable models parent-child nodes. | +| "master–detail", "list + details side by side" | nested routes / custom CSS columns / `sap.m.SplitApp` | `sap.f.FlexibleColumnLayout` | FCL handles column transitions, breakpoints, and back nav. | +| "page with title and collapsible header" | `sap.m.Page` + hand-built header | `sap.f.DynamicPage` | Title stays visible, header snaps on scroll, floating footer. | +| "app with header and left menu" | custom layout around `SideNavigation` | `sap.tnt.ToolPage` | ToolPage places ShellBar and SideNavigation with correct responsive behavior. | +| "object detail page" | `sap.m.Page` | `sap.uxap.ObjectPageLayout` | Page has no anchored section navigation. | +| "menu button" | custom split markup | `sap.m.MenuButton` | Use MenuButton (or split mode) instead of ad-hoc menus. | +| "secondary button in header/footer toolbar" | `type="Transparent"` | `type="Ghost"` | Ghost gives the guideline's default style there; Transparent is for negative path (Cancel) and the less important buttons in content toolbars. | +| "on/off setting" | `sap.m.CheckBox` for immediate effect | `sap.m.Switch` | Switch = immediate effect; CheckBox = confirmed-on-save. | +| "pick one from a long list" | `sap.m.Select` | `sap.m.ComboBox` / value help | Select is for short fixed lists (~2–12). | +| "pick a date" | `sap.m.Input` | `sap.m.DatePicker` | Input has no calendar, parsing, or validation. | + +## Use case → Component + +| I need to… | Use | NOT | +|---|---|---| +| App-level nav: logo, search, notifications, profile | `sap.f.ShellBar` | Bar, Toolbar | +| Left-hand navigation menu | `sap.tnt.SideNavigation` | List, VerticalLayout | +| Navigate between facets of one object | `sap.m.IconTabBar` | TabContainer, SegmentedButton | +| Switch a small set of views (2–3) | `sap.m.SegmentedButton` | RadioButtonGroup, Select | +| Persistent page-level error/warning | `sap.m.MessageStrip` | MessageBox, Dialog | +| One-time success confirmation | `sap.m.MessageToast` | MessageStrip, Dialog | +| Show entity details (header + sections) | `sap.uxap.ObjectPageLayout` | Page, Panel | +| List → detail split layout | `sap.f.FlexibleColumnLayout` | custom columns, SplitApp | +| Page with title, collapsible header, footer | `sap.f.DynamicPage` | Page with custom header | +| Switch between suite products from the header | `sap.f.ProductSwitch` | Menu, custom popover grid | +| KPI / situation in a page header | `sap.m.GenericTag` | ObjectStatus, Text | +| Empty / no-data / error state | `sap.m.IllustratedMessage` | plain Text/Label | +| Contextual detail without leaving page | `sap.m.Popover` | Dialog (that's modal) | +| Personalize 20+ table columns | `sap.m.p13n.Popup` | ViewSettingsDialog | + +## Reference files — read on demand + +| Topic | File | Read when | +|---|---|---| +| Full wrong→right + long tail, table-type decision | `references/component-selection.md` | Any control-choice question not fully answered above | +| CSS tokens, semantic colors, density tiers | `references/theming-tokens.md` | Colors, theming, cozy/compact/condensed | +| Buttons, links, toggle/segmented/menu buttons, menu, table toolbar | `references/ui-actions.md` | Choosing an action control | +| Inputs, selects, combo/multi, pickers, mask, filter bar, facet filter | `references/ui-inputs.md` | Form/input/filter design | +| Layouts: dynamic page, flexible column layout, side panel, app / nav container | `references/ui-layouts.md` | Page structure, list-detail, app root | +| Containers: cards, panel, wizard, dialog, popover, color palette, P13n, variant management | `references/ui-containers.md` | Overlays, cards, panels, wizards, personalization | +| Navigation: shell bar, user menu, product switch, icon tab bar, side nav, breadcrumbs | `references/ui-navigation.md` | Shell header, tab/section/side navigation | +| Tables and lists (Responsive/Grid/Analytical/Tree/List), pull to refresh | `references/ui-lists-tables.md` | Choosing a table or list | +| Avatar, image, carousel, tags, tokens, rating, draft indicator, progress, busy, illustrated message | `references/ui-display.md` | Status/empty-state display | +| Message strip / popover / box / toast | `references/ui-messages.md` | Message pattern and placement | +| AI/Joule: AI button, guided/quick prompts, notice | `references/ui-ai.md` | AI-powered features | +| Upload (File Uploader vs Upload Set) | `references/ui-upload.md` | File upload | +| Implementation review checklist | `references/implementation-checklist.md` | Review mode — always read it first | + +## Rules that stop the most mistakes + +- **One emphasized/primary button per page or dialog.** Everything else is Default/Transparent. +- **Icon-only buttons need a tooltip** and a recognizable, worldwide-consistent icon metaphor. +- **App header = ShellBar, never Bar.** Bar is a content-area toolbar. +- **Button text is an imperative verb** — Save, Edit, Create. Not "OK to save?". +- **Table choice is by data, not looks:** ≤~200 loaded items → Responsive (footer totals OK); large/desktop → Grid; multilevel grouping + subtotals → Analytical; simple hierarchy → `sap.m.Tree`, deep/large → TreeTable. +- **Links navigate, buttons act.** Don't use a Button to go to a page or a Link to submit. +- **Popover is non-modal contextual; Dialog is modal.** Don't use a Popover for anything requiring focus or confirmation. diff --git a/plugins/ui5/skills/ui5-fiori-guidelines/references/component-selection.md b/plugins/ui5/skills/ui5-fiori-guidelines/references/component-selection.md new file mode 100644 index 0000000..1bbe382 --- /dev/null +++ b/plugins/ui5/skills/ui5-fiori-guidelines/references/component-selection.md @@ -0,0 +1,194 @@ +# Component Selection + +The full wrong to right map. SKILL.md carries the high-frequency subset; this file carries the long +tail and the decision criteria. Every entry names the `sap.*` control and OpenUI5 vs SAPUI5 availability. + +## Contents +- [Tables — the biggest offender](#tables--the-biggest-offender) +- [Inputs & selection](#inputs--selection) +- [Actions](#actions) +- [Navigation & structure](#navigation--structure) +- [Overlays & messaging](#overlays--messaging) +- [Display & status](#display--status) +- [SAPUI5-only controls](#sapui5-only-controls) + +--- + +## Tables — the biggest offender + +Choose by **data shape**, never by appearance. This single decision causes more wrong-component +usage than anything else. + +| Need | Control | Class | +|---|---|---| +| ≤ ~200 loaded items, mobile + desktop; simple column totals in the footer | Responsive Table | `sap.m.Table` | +| Large data, desktop-first, cell comparison | Grid Table | `sap.ui.table.Table` | +| Multilevel grouping with subtotals per group (OData V2) | Analytical Table | `sap.ui.table.AnalyticalTable` | +| Deep or large (>~200 items) parent-child hierarchy (bill of materials, cost centers) | Tree Table | `sap.ui.table.TreeTable` | +| Simple hierarchy, ≤~200 items, responsive | Tree | `sap.m.Tree` | +| Card/tile visual layout, images, non-tabular | Grid List | `sap.f.GridList` | +| Simple vertical item list, not columnar | List | `sap.m.List` / `sap.m.StandardListItem` | + +Decision order: +1. **Hierarchy?** Two levels → grouped list/table; simple ≤~200 items → `sap.m.Tree`; deep or large → Tree Table. +2. **Multilevel grouping + subtotals?** → Analytical Table. One column total → Responsive Table footer. +3. **More than ~200 items loaded at once, or desktop cell-comparison?** → Grid Table. + +"~200" counts items loaded in the front end, not database rows. For OData V4, use `sap.ui.table.Table` with the `ODataV4Aggregation` / `ODataV4Hierarchy` plugin instead of `AnalyticalTable` / `TreeTable` (V2 / JSON only). +4. **Visual cards, not columns?** → Grid List. +5. **Otherwise** → Responsive Table (`sap.m.Table`). + +Common misuses: +- **Responsive Table for large and complex data.** It loads and renders everything → DOM bloat, single-column pop-in mush. Use Grid Table. +- **Analytical Table with no aggregation** → adds cost, drops mobile. Use Grid Table (without aggregation it looks the same as a grid table). +- **Grouping an Analytical Table to fake a hierarchy.** Grouping ≠ nodes. Use Tree Table. +- **Grid List for text-heavy tabular data** because "cards look nice." No column alignment/sort. Use Responsive Table. +- **`sap.m.Table` as a drop-in for grid/analytical/tree tables** → responsive table has no group subtotals, freeze, or hierarchy (only footer totals). + +Smart/MDC tables (Fiori Elements): `sap.ui.comp.smarttable.SmartTable` (**SAPUI5**, OData V2) / `sap.ui.mdc.Table` (**OpenUI5 / SAPUI5**, OData V4) are annotation-driven wrappers — see the `ui5-best-practices-smart-controls` and `ui5-best-practices-mdc` skills. Don't hand-build these, and don't hand-build table personalization either — use `sap.m.p13n` (`Engine` + `Popup`). + +--- + +## Inputs & selection + +Pick the simplest control that fits the cardinality and source. + +| Need | Control | Class | +|---|---|---| +| Single-line free text | Input | `sap.m.Input` | +| Multi-line text | Text Area | `sap.m.TextArea` | +| Pick one, short fixed list (~2–12) | Select | `sap.m.Select` | +| Pick one, long list (13–200), type-ahead/free text | Combo Box | `sap.m.ComboBox` | +| Pick many from a list | Multi-Combo Box | `sap.m.MultiComboBox` | +| Enter many tokens (with value help/suggestions) | Multi-Input | `sap.m.MultiInput` | +| Pick one, all options visible, ≤ ~8 | Radio Button (group) | `sap.m.RadioButton` / `RadioButtonGroup` | +| Toggle a confirmed-on-save flag | Checkbox | `sap.m.CheckBox` | +| Toggle an immediate on/off state | Switch | `sap.m.Switch` | +| Pick a date | Date Picker | `sap.m.DatePicker` | +| Pick a date range | Date Range Selection | `sap.m.DateRangeSelection` | +| Pick date + time | Date/Time Picker | `sap.m.DateTimePicker` | +| Pick a time | Time Picker | `sap.m.TimePicker` | +| Numeric with steppers | Step Input | `sap.m.StepInput` | +| Search a list/table | Search Field | `sap.m.SearchField` | +| Complex value selection (dialog + inline) | Value Help | `sap.ui.mdc.ValueHelp` (OpenUI5 / SAPUI5) / `sap.ui.comp.valuehelpdialog.ValueHelpDialog` (**SAPUI5**) | + +Common misuses: +- **Input for dates** → use Date Picker (parsing, calendar, validation come free). +- **Select for 200 items** → use Combo Box or Input + value help. +- **Checkbox for an immediate on/off** → use Switch; Checkbox implies "applies on save." +- **Multiple Inputs for multi-value entry** → use Multi-Input or Multi-Combo Box. +- **Select for a binary** → use Switch (setting) or Radio group (2 visible choices). + +--- + +## Actions + +| Need | Control | Class | +|---|---|---| +| Trigger an action | Button | `sap.m.Button` | +| Navigate to a page/anchor/URL | Link | `sap.m.Link` | +| Toggle a two-state toolbar action | Toggle Button | `sap.m.ToggleButton` | +| Choose one of a small option set | Segmented Button | `sap.m.SegmentedButton` | +| Button that opens a menu | Menu Button | `sap.m.MenuButton` | +| Default action + menu | Split Button | `sap.m.MenuButton` (split) | + +Button emphasis: +- **Primary:** `type="Emphasized"` — one per page/dialog. +- **Secondary:** header/footer toolbars → `type="Ghost"`; content toolbars → most important button `type="Ghost"`, the rest `type="Transparent"`. +- **Negative path (Cancel):** `type="Transparent"`. +- **Positive/Negative:** semantic `Accept`/`Reject`, header/footer only. Text buttons only. + +Common misuses: +- **Button for navigation** → Link. **Link to submit** → Button. +- **Cancel styled as secondary** (`Default`/`Ghost`) → negative path is `type="Transparent"`. +- **Custom menu button markup** → use `sap.m.MenuButton` (or split mode) instead. + +--- + +## Navigation & structure + +| Need | Control | Class | +|---|---|---| +| App header (logo, search, notifications, profile, Joule) | Shell Bar | `sap.f.ShellBar` | +| Left navigation menu | Side Navigation | `sap.tnt.SideNavigation` | +| In-page section/facet navigation | Icon Tab Bar | `sap.m.IconTabBar` | +| Editable multi-document tabs | Tab Container | `sap.m.TabContainer` | +| Switch between products of a suite (Shell Bar) | Product Switch | `sap.f.ProductSwitch` | +| App shell with header + left navigation | Tool Page | `sap.tnt.ToolPage` | +| Page with title, collapsible header, floating footer | Dynamic Page | `sap.f.DynamicPage` | +| Object detail floorplan | Object Page | `sap.uxap.ObjectPageLayout` | +| List → detail columns | Flexible Column Layout | `sap.f.FlexibleColumnLayout` | +| Root container for full-page navigation | App | `sap.m.App` | +| Page drill-down inside a popover/dialog | Nav Container | `sap.m.NavContainer` | +| Breadcrumb trail | Breadcrumbs | `sap.m.Breadcrumbs` | +| Save/load view configurations | Variant Management | `sap.m.VariantManagement` / `sap.ui.fl.variants.VariantManagement` | + +Common misuses: +- **Bar as app header** → ShellBar. Bar is a content-area toolbar (page/dialog header/footer). +- **List as side nav** → SideNavigation (nav semantics, expand/collapse, selection). +- **`sap.f.SideNavigation`** → does not exist. The class is `sap.tnt.SideNavigation`. +- **TabContainer for in-page sections** → IconTabBar. TabContainer is browser-tab-style editing. +- **`sap.tnt.SideNavigation` standalone** → put it in the `sideContent` of `sap.tnt.ToolPage` or responsive behavior breaks. +- **Shell Bar `Back` button** → prefer the browser back button; only use ShellBar back when technically forced. +- **`sap.m.Page` with a hand-built collapsible header** → Dynamic Page (title stays visible, header snaps on scroll). +- **`sap.m.SplitApp` for new list-detail apps** → Flexible Column Layout. +- **FCL layout set with `setLayout` in controllers** → drive the layout from the router (`{layout}` route parameter) with `FlexibleColumnLayoutSemanticHelper`. +- **`app.to()` for app-level navigation** → use the router so the URL hash, back, and bookmarks work. + +--- + +## Overlays & messaging + +| Need | Control | Class | +|---|---|---| +| Modal that blocks and requires input | Dialog | `sap.m.Dialog` | +| Semantic error/warning/success/confirm dialog | Message Box | `sap.m.MessageBox` | +| Non-blocking inline page message | Message Strip | `sap.m.MessageStrip` | +| Transient success confirmation | Message Toast | `sap.m.MessageToast` | +| Aggregate many messages | Message Popover | `sap.m.MessagePopover` | +| Contextual detail beside a trigger | Popover | `sap.m.Popover` | +| Standardized object preview | Quick View | `sap.m.QuickView` | +| Responsive popover (full-screen on phone) | Responsive Popover | `sap.m.ResponsivePopover` | + +Common misuses: +- **Dialog for a plain error** → MessageBox (semantic type + buttons for free). +- **MessageBox/Dialog for inline feedback** → MessageStrip (non-blocking). +- **MessageStrip/Dialog for brief success** → MessageToast (auto-dismiss). +- **Popover for confirmation** → Dialog. Popover is non-modal, background stays interactive. +- **Custom Popover structure for object preview** → QuickView (standard) unless it truly can't fit. + +--- + +## Display & status + +| Need | Control | Class | +|---|---|---| +| Picture or logo as content | Image | `sap.m.Image` | +| Person / object thumbnail | Avatar | `sap.m.Avatar` | +| Status in a table cell, list, or form | Object Status | `sap.m.ObjectStatus` | +| KPI or situation in a page header | Generic Tag | `sap.m.GenericTag` | +| "Saving draft..." / "Draft saved" feedback | Draft Indicator | `sap.m.DraftIndicator` | +| Object editing-status marker (Draft, Locked, Unsaved) | Object Marker | `sap.m.ObjectMarker` | +| Refresh a list by pulling down (touch) | Pull to Refresh | `sap.m.PullToRefresh` | +| Empty / no-data / error state | Illustrated Message | `sap.m.IllustratedMessage` | + +Common misuses: +- **`sap.m.Image` with only `alt`** → `decorative` defaults to `true`, so `alt` is ignored. Set `decorative="false"` for meaningful images. +- **`sap.m.Image` for icons** → `sap.ui.core.Icon`. **For person thumbnails** → `sap.m.Avatar`. +- **`ObjectStatus` for header KPIs** → Generic Tag. **Generic Tag in table cells** → ObjectStatus. +- **MessageToast for every draft autosave** → Draft Indicator in the footer. +- **Pull to Refresh on desktop-only pages** → a Refresh button in the toolbar. + +--- + +## SAPUI5-only controls + +Mark these **SAPUI5** (libraries not shipped with OpenUI5): +- `sap.ui.comp.smarttable.SmartTable`, `sap.ui.comp.smartfilterbar.SmartFilterBar`, and related `sap.ui.comp.*` smart controls. +- `sap.fe.*` (SAP Fiori elements for OData V4), `sap.suite.ui.*`, and `sap.ushell.*` (SAP Fiori launchpad). + +These ship with **both** OpenUI5 and SAPUI5 — do not mark them SAPUI5-only: +- `sap.m`, `sap.f`, `sap.uxap`, `sap.ui.table`, `sap.ui.layout`, `sap.ui.unified`. +- `sap.tnt` (`SideNavigation`, `ToolPage`, `ToolHeader`). +- `sap.ui.mdc`, `sap.ui.fl` (including `sap.ui.fl.variants.VariantManagement`), `sap.ui.integration`. +- `sap.m.plugins.UploadSetwithTable` (replaces the deprecated `sap.m.upload.UploadSet` and `sap.m.UploadCollection`). diff --git a/plugins/ui5/skills/ui5-fiori-guidelines/references/implementation-checklist.md b/plugins/ui5/skills/ui5-fiori-guidelines/references/implementation-checklist.md new file mode 100644 index 0000000..dca8f64 --- /dev/null +++ b/plugins/ui5/skills/ui5-fiori-guidelines/references/implementation-checklist.md @@ -0,0 +1,124 @@ +# Implementation Checklist + +Use this in **review mode** (see SKILL.md): when the user asks to review, audit, or check a built Fiori app. +Each item is a yes/no check. Report only failing items, grouped by the section headings below, each with +the file, the control, and the fix. Skip sections that do not apply to the code under review. + +## Shell and Navigation + +- [ ] App header uses `sap.f.ShellBar` — not `sap.m.Bar` or a custom header +- [ ] Left-hand navigation uses `sap.tnt.SideNavigation` (not a List) inside the `sideContent` of `sap.tnt.ToolPage` +- [ ] No `sap.f.SideNavigation` — the class is `sap.tnt.SideNavigation` +- [ ] Master–detail layout uses `sap.f.FlexibleColumnLayout` — not custom CSS columns or `sap.m.SplitApp` +- [ ] FCL layout is driven by the router (`{layout}` route parameter) and `FlexibleColumnLayoutSemanticHelper` — not by `setLayout` calls in controllers +- [ ] FCL column actions (full screen / exit full screen / close) are in the column title's `navigationActions` +- [ ] App-level navigation goes through the router — not `App.to()` / `NavContainer.to()` +- [ ] Exactly one root container (`sap.m.App`, FCL, `SplitApp`, or `ToolPage`) — no nested `sap.m.App` +- [ ] Cross-app navigation uses semantic object / action intents — not raw URLs +- [ ] Back navigation works with the browser back button and shell back arrow +- [ ] `manifest.json` declares `crossNavigation.inbounds` and `outbounds` + +## Layout and Floorplan + +- [ ] Object detail pages use `sap.uxap.ObjectPageLayout` — not `sap.m.Page` +- [ ] Pages with a collapsible header use `sap.f.DynamicPage` — not `sap.m.Page` with a hand-built header +- [ ] `DynamicPage` `fitContent="true"` only when the content stretches in height (e.g. grid table with auto row count) +- [ ] `DynamicPage` footer (`showFooter`) holds finalizing actions only (Save, Cancel, Submit) +- [ ] List → detail split uses FCL — not nested routes with manual column CSS +- [ ] Wizards use `sap.m.Wizard` — not a sequence of dialogs +- [ ] Tab-based in-page navigation uses `sap.m.IconTabBar` — not `TabContainer` + +## Buttons and Actions + +- [ ] Exactly one emphasized / primary button per page or dialog +- [ ] Destructive actions (Delete, Discard) are Default or Transparent — never emphasized +- [ ] Header/footer toolbars: secondary `type="Ghost"`, negative path (Cancel) `type="Transparent"`. Content toolbars: most important button `Ghost` (or `Emphasized` if it is the page's only primary action), other secondary `Transparent`, no `Accept`/`Reject` +- [ ] Icon-only buttons have a tooltip and an accessible name +- [ ] Button text is an imperative verb (Save, Edit, Approve) — not "OK", "Yes", "Submit" +- [ ] Page-level actions are in the toolbar or floating footer — not inline in content +- [ ] Overflow actions use an overflow menu — button labels are not truncated + +## Forms and Inputs + +- [ ] Every input field has a visible label (not placeholder-only) +- [ ] Required fields marked with `*`; convention explained once on the form +- [ ] Date inputs use `sap.m.DatePicker` — not a plain `Input` +- [ ] Short fixed lists (2–12 items) use `Select`; long/dynamic lists use `ComboBox` + value help +- [ ] Immediate-effect toggles use `Switch`; save-confirmed selections use `CheckBox` +- [ ] Form validation uses `valueState` on the control — not manual border color CSS +- [ ] Error messages are associated with their field (`aria-describedby` or control API) + +## Tables and Lists + +- [ ] Responsive table (`sap.m.Table`) used only for ≤~200 loaded items; no group subtotals needed (footer totals are fine, but not in growing mode) +- [ ] Large datasets use `sap.ui.table.Table` — not responsive table +- [ ] Subtotals and totals use `sap.ui.table.AnalyticalTable` — not responsive table +- [ ] Hierarchical data uses `sap.ui.table.TreeTable` — not grouped AnalyticalTable +- [ ] Table type choice matches the data shape (see `references/ui-lists-tables.md`) +- [ ] Empty table state uses `IllustratedMessage` — not a plain "No data" text + +## Messaging + +- [ ] Persistent page-level messages use `MessageStrip` — not a Dialog +- [ ] One-time success confirmations use `MessageToast` — not a persistent strip +- [ ] Multiple validation errors use `MessagePopover` — not stacked strips +- [ ] Modal confirmations and errors use `MessageBox` — not a hand-built Dialog +- [ ] MessageToast text fits within 3 seconds of reading (~80 chars) +- [ ] Draft autosave feedback uses `sap.m.DraftIndicator` in the footer — not a MessageToast per save + +## Colors and Theming + +- [ ] No hard-coded hex colors — all colors use `--sap*` CSS tokens +- [ ] Semantic colors used by meaning: error → `--sapNegativeColor`, warning → `--sapCriticalColor`, etc. +- [ ] Embedded AI uses SAP blue (`--sapBrandColor`) — purple / `--sapAssistant_*` only for Joule +- [ ] Form field validation uses `valueState` — not manual color overrides + +## Content Density + +- [ ] Density set once at the app root (Cozy / Compact / Condensed) +- [ ] Cozy and Compact not mixed arbitrarily in the same app context +- [ ] Condensed used only in table contexts within a Compact container + +## Accessibility + +- [ ] Every interactive element has an accessible name (label, `aria-label`, or tooltip) +- [ ] Meaningful `sap.m.Image` controls set `decorative="false"` and `alt` — `alt` alone is ignored because `decorative` defaults to `true` +- [ ] Form fields have an associated `