Skip to content
Back to skills

Pp365 Ui

ASecurity

How to build and change UI in the Prosjektportalen 365 SPFx solutions (React 18, Fluent UI v9): components, the shared-library wrappers, icons, styling, localized strings and accessible form fields. Use when asked to "add a component", "add a panel / drawer", "add a dialog", "add a form field", "add a toolbar button", "add a menu item", "add a column / cell renderer", "add a list", "show a toast", "add an icon", "style this", "add a string", "translate", "label not read by screen reader", "po...

  • 35 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 13, 2026
designtypescriptrustgoreactnodeawstestingdebugginggit

Works with

  • vscode
  • cli

Security analysis

A100/100

Scanned November 13, 2026

npx -y skills add Puzzlepart/prosjektportalen365 --skill pp365-ui --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Pp365 Ui?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Pp365 Ui
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/puzzlepart-pp365-ui/badge)](https://www.skillsdirectory.com/skills/puzzlepart-pp365-ui)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: pp365-ui
description: 'How to build and change UI in the Prosjektportalen 365 SPFx solutions (React 18, Fluent UI v9): components, the shared-library wrappers, icons, styling, localized strings and accessible form fields. Use when asked to "add a component", "add a panel / drawer", "add a dialog", "add a form field", "add a toolbar button", "add a menu item", "add a column / cell renderer", "add a list", "show a toast", "add an icon", "style this", "add a string", "translate", "label not read by screen reader", "popover / tooltip flicker", "a click in a dialog selects the row", "BasePanel", "FieldContainer", "DataGridList", "see my change in the browser". Encodes the component shape, which wrapper to reuse with a real call site for each, the icon helpers, the provider rule, the loc triad and what validate-loc does not check, and the Fluent v9 traps found in the migration. Pair with pp365-testing for tests and pp365-toolchain for build problems.'
argument-hint: 'Describe the UI change (component, panel or dialog, form field, list, menu, icon, styling, string)'
---

# UI in PP365 (React 18, Fluent UI v9)

Authoritative (Norwegian): `.development-guide/spfx/kodemonster.md`. This skill is the operational summary, the inventory of shared wrappers the guide lacks, and the traps recorded in `docs/plans/fluent-v9-migration.md` and `docs/plans/fluent-v9-phase-4.md`.

## Read first

- `kodemonster.md`, all of it: folder and barrel, hook, context, reducer, loc, SCSS modules, Fluent v9, icons, PnP controls, slot render functions. Beside it in `.development-guide/spfx/`: `komponentoversikt.md` maps web parts and extensions to solutions, `utviklingsmiljo.md` covers watching and debugging, `testing.md` the tests.
- The closest existing component in the same solution, and the wrapper table below, before writing anything new.
- Where kodemonster.md or AGENTS.md disagree with the code, follow the code and fix the guide.
- Stack: React 18.3.1 (mounted through `renderReact`, a `createRoot` per container; a render is scheduled, not done when the call returns), `@fluentui/react-components` ~9.74.8, `@fluentui/react-icons` ~2.0.341, `@reduxjs/toolkit` ~2.13.0. Fluent v8 (`@fluentui/react`) remains only as the Fabric font fallback in `shared-library/src/icons/index.tsx`.

## Component shape

- Follow kodemonster.md's folder: `index.ts` re-exports only, `X.tsx` JSX only (`export const X: FC<IXProps>`), `export function useX` holding state, effects and handlers, `types.ts`, `X.module.scss`, `context.ts`/`reducer.ts` when needed. JSDoc on exported symbols.
- About 65 component folders still keep the component in `index.tsx` (`UserMessage`, `WebPartTitle`, `OverflowTagMenu`, `ProjectLogo` in the library), and some hooks are arrow constants. Some call sites below are such files: copy the call, not the shape, and restructure one only when that is the task.
- Defaults: never `X.defaultProps` (React 19 ignores it on function components; ESLint stops it). A `const X_DEFAULT_PROPS: Partial<IXProps>` above the component, merged at the top with `withDefaults(incomingProps, X_DEFAULT_PROPS)` from `pp365-shared-library` (`../util` inside the library), so the hook, the context and `{...props}` see the defaults; exported where a web part's property pane or a test reads it (`PROJECT_INFORMATION_DEFAULT_PROPS`). A component that only reads its own props may default in the destructuring instead. `withDefaults` applies a default for `undefined` only, as React did.
- Reducers: `createReducer` with the builder callback (`builder.addCase(ACTION, (state, { payload }) => …)`), as all nine are; Redux Toolkit 2 removed the object notation. Type a context's `dispatch` as `React.Dispatch<UnknownAction>`. Every handler has a test in the `reducer.test.ts` beside it (`ProgramWebParts/src/components/ProgramAdministration/reducer.test.ts`).
- Ids: `useId` from `@fluentui/react-components` in components and hooks; `getId(prefix)` from `pp365-shared-library` only outside React (module scope, class fields).
- A web part's class is `src/webparts/<name>/index.ts(x)` on the solution's base web part (`this.renderComponent(Component, props)`); its UI is `src/components/<Name>`.
- Mount React only through `renderReact(element, container)` and `unmountReact(container)` from `pp365-shared-library` (`src/util/reactRoot.ts`), never `react-dom`'s `render` directly: every web part, extension, dialog and property pane field goes through them, and that one file keeps a React 18 root per container (`createRoot`) from its first render to its unmount. Anything that renders into its own container unmounts it when its host is disposed (the base web parts do in `onDispose`), and renders again into the same container rather than a new one each time.
- Consumers import their own folders bare (`components/X`, `models`, `data`; `baseUrl: src`). A new bare-imported folder goes into the solution's `tsconfig.json` `paths`: webpack's aliases come only from there (`config/spfx-customize-webpack.js`), while TypeScript and Jest resolve any folder, so it compiles and passes its tests, then fails to bundle.
- Import the library from `pp365-shared-library` (deep `pp365-shared-library/lib/...` paths also work); inside `shared-library` imports are relative (`../../util`).
- A new shared wrapper: a folder under `shared-library/src/components`, a line in `components/index.ts`, its texts in the `SharedLibraryStrings` triad. A consumer sees a library change only once it is in the library's `lib/`: keep `npm run watch` running in `shared-library` next to the solution's watch (the page then reloads by itself), or run `rush rebuild -o pp365-shared-library` (or `npx heft build --clean` in it). New or changed strings also need the solution's watch restarted.

## Reuse first: the shared wrappers

Wrappers are under `SharePointFramework/shared-library/src`, call sites under `SharePointFramework/`.

| Wrapper | What it is for | Real call site |
|---|---|---|
| `components/BasePanel` | Every side panel: v9 `OverlayDrawer`, own providers. `open`, `onClose` (close button, Escape, outside click), `headerText` or `header` (the heading), `headerActions` (under it), `footer`, `size` (`small`/`medium`/`large`/`full`, default `medium`), opens at `end`; `isLightDismiss={false}` makes it `alert`; `hidden` hides only the header (title and close button) | `shared-library/src/components/CustomEditPanel/CustomEditPanel.tsx` |
| `components/CustomEditPanel` | Edit form for a SharePoint item's fields on `BasePanel`; one element per field type in `CustomEditPanelBody/FieldElements` | `ProjectWebParts/src/components/ProjectInformation/EditPropertiesPanel/EditPropertiesPanel.tsx` |
| `components/FilterPanel` | Filter drawer on `BasePanel`, handed to `Toolbar` as `filterPanel` | `ProjectWebParts/src/components/DynamicList/DynamicList.tsx` (props built in `useToolbarItems.tsx`) |
| `components/Toolbar` + `ListMenuItem` | Command bar: `items`, `farItems`, built with `new ListMenuItem(text, description)` and `setIcon`, `setOnClick`, `setDisabled`, `setHidden`, `setItems`, `makeCheckable`, `setSearchBox`; `makeConditional` last, since it returns `null`. Own providers | `PortfolioWebParts/src/components/ProjectList/Commands/useCommands.tsx` (rendered in `Commands.tsx`) |
| `components/DataGridList` + `util/createDataGridColumns.tsx` | The v9 list: `sortable`, resizable, `single`/`multiselect` selection as row ids, `onRowDoubleClick`, `emptyContent`, `fitColumnsToContainer` | `ProjectWebParts/src/components/ProjectTimeline/TimelineList/TimelineList.tsx` |
| `components/ItemColumn` | Cell renderers by data type: a `ColumnRenderComponent` (static `key`, `id`, `displayName`, `iconName`) registered in `ColumnRenderComponentRegistry`; `renderItemColumn(item, column)` | `PortfolioWebParts/src/components/List/ItemColumn/useOnRenderItemColumn.tsx` |
| `components/FieldContainer` | v9 `Field`: `label`, catalog `iconName`, `description` (hint), `required`, `validationState`/`validationMessage`, `hidden` | `shared-library/src/components/CustomEditPanel/CustomEditPanelBody/FieldElements/Text.tsx` |
| `components/PeoplePicker` | People on v9 `TagPicker`: `selected`, `onChange`, `onResolveSuggestions(filter, selected)`, `multi`; no data access inside | `shared-library/src/components/CustomEditPanel/CustomEditPanelBody/FieldElements/User.tsx` |
| `components/DateField` | A day in a `FieldContainer`: the localized v9 `DatePicker` (`formatDay`/`parseShortDate`, week numbers, typed input, the label tied to it, the calendar mounted outside a drawer's transform); `label`, `value`, `onSelectDate`, `required`, `description`, `disabled` | `ProjectExtensions/src/components/RiskAction/RiskActionPopover/NewRiskActionPanel/NewRiskActionPanel.tsx` |
| `components/ColumnSearchPropertyField` | The column forms' managed-property field, on `Autocomplete` (freeform v9 `Combobox`, no other caller); `readOnly` shows the value in a plain read-only input instead | `PortfolioWebParts/src/components/PortfolioOverview/ColumnFormPanel/index.tsx` |
| `components/UserMessage` | v9 `MessageBar`: `intent`, `title`, `text` (markdown and HTML), children; own providers. `fixedCenter` and `isCompact` do nothing | `ProjectExtensions/src/components/ErrorDialog/ErrorDialog.tsx` |
| `components/ConfirmDialog` | `const [element, getResponse] = useConfirmationDialog()`; `getResponse({ title, subText, responses: [[label, value, isPrimary]] })`; Escape or outside click resolves `undefined`; own providers | `PortfolioWebParts/src/components/PortfolioOverview/ColumnFormPanel/ColumnFormPanelFooter/index.tsx` |
| `components/LoadingSkeleton` | Placeholder rows (`rows` as width steps, three by default) | `ProjectWebParts/src/components/ProjectPhases/ProjectPhases.tsx` |
| `components/WebPartTitle` | The web part's `<h2>` title, `description` (HTML) in an `InfoLabel`; own providers | `ProjectWebParts/src/components/RiskMatrix/RiskMatrix.tsx` |
| `components/Fluent` | A root `IdPrefixProvider` + `FluentProvider` with the theme; `transparent` drops its background | `ProjectWebParts/src/components/ProjectStatus/ProjectStatus.tsx` |
| `components/FileTypeIcon` | Coloured Office file glyph as a CDN image (`extension`, `size`, …) | `ProjectExtensions/src/components/DocumentTemplateDialog/SelectScreen/columns.tsx` |
| `components/OverflowTagMenu` | Tags; those that do not fit go behind a `+n` menu | `PortfolioWebParts/src/components/ProjectList/ProjectCard/ProjectCardContent/ProjectCardContent.tsx` |
| `components/StatusMark` | The shape beside a status icon, so the status is not told by colour alone: `color`, `iconName` (the value's own icon; `CircleFill` counts as none), `iconSize` of the icon beside it; nothing for a colour that is not green, yellow or red | `ProjectWebParts/src/components/ProjectStatus/StatusElement/StatusElementIcon/StatusElementIcon.tsx` |
| `components/ProjectLogo` | Project logo, falling back to the template image, then the initials | `PortfolioWebParts/src/components/LatestProjects/LatestProjects.tsx` |
| `components/ConditionalWrapper` | Wraps its children in `wrapper` only when `condition` | `ProjectWebParts/src/components/ProjectStatus/StatusElement/StatusElement.tsx` |
| `components/PropertyPaneDescription` | A description block in a property pane | `PortfolioWebParts/src/webparts/portfolioOverview/index.ts` |
| `components/ProjectTimeline` | The portfolio and program timelines (ProjectWebParts uses its `Timeline`) | `PortfolioWebParts/src/webparts/projectTimeline/index.ts` |
| `components/BaseWebPartComponent` | Legacy class base nothing extends outside its test; consumers use `IBaseWebPartComponentProps` and `IBaseWebPartComponentState<T>` (six ProjectWebParts state interfaces). New UI is function components | `ProjectWebParts/src/components/ProjectPhases/types.ts` |
| `util/theme.tsx` (`customLightTheme`) | Fluent theme from the site's primary colour, read once when the module loads; SharePoint blue (`#0078d4`) for the page's whole life if the theme was not published by then | every provider above |
| `util/format.ts`, `util/formatDate.ts` | `format(strings.Key, a, b)` fills `{0}` tokens with v8's semantics; `formatDate(date, includeTime)` (long, with weekday) and `formatShortDate` (numeric, for field values) for display, in SharePoint's UI language (`getUILocale`), the language of the strings beside them, and in the site's time zone (`toSiteWallTime`, from the page context every client's creation hands the library, `rememberPageContext`): the day and time SharePoint's lists show, not the machine's. They take an instant; a date picker's value is a day at local midnight, which `formatDay` writes and `parseShortDate` reads back (the date field's pair). Never `toLocaleDateString()` without a locale: it follows the browser's language | `PortfolioWebParts/src/components/ProjectList/Commands/useCommands.tsx`; `ProjectWebParts/src/components/ProjectInformation/ArchiveStatus/index.tsx` |

ProjectExtensions' dialogs (`ErrorDialog`, `ProgressDialog`, `ProjectSetupDialog`, `DocumentTemplateDialog`) build on its own `src/components/@BaseDialog` (v9 `Dialog`, `title`, `subText`, `footer`, `isBlocking`, `version`; own providers). `isBlocking` only drops the close button and backdrop dismissal: Escape still closes. Its icon-only close button is named `strings.CloseModalText` ("Lukk"), as is the footer button of `ErrorDialog`: tests find that one by text. Width: kodemonster.md, "Konsistens".

## Icons (`shared-library/src/icons`)

- `getFluentIcon(name, { color, size, filled, bundle, jsx, className })`: `name` is a catalog name (`FluentIconName`, the keys of `iconCatalog.ts`; `getFluentIcons()` lists them). It reads the catalog only and returns `null` for a UI Fabric alias. Bundled icons are cached per name; `jsx: false` returns the component. Catalog icons are mostly unsized (1em), drawn on a 20 px grid: pass a `size` that is a whole multiple of it (20, 40), since at 18, 30 or 50 px their strokes blur on a 1x screen (the status icons, #1788), or beside sized siblings bundle the `*24` pair once at module scope.
- `getFluentIconWithFallback(name, { color, size, filled, className })` for names from list data or configuration (`GtSecIcon` and friends): catalog, then `fabricIconAliases.ts`, then the Fabric font; `null` for an empty name (`ProjectWebParts/src/components/ProjectStatus/StatusElement/StatusElementIcon/StatusElementIcon.tsx`). The boolean-argument form is deprecated.
- `getIconComponentWithFallback(name, 'Cube')` where a prop wants a component (`Tab`, `MenuItem`): `PortfolioWebParts/src/components/ProjectList/ProjectListFilterRegistry.ts`. It, `getFluentIconWithFallback` and `isIconAvailable` resolve aliases through `resolveFluentIcon`.
- `ListMenuItem.setIcon` takes a name string, resolved like `getFluentIconWithFallback` (`Toolbar/createIcon.tsx`; `setIcon('Filter')` in `PortfolioWebParts/src/components/PortfolioOverview/ToolbarItems/useToolbarItems.ts`), or a component (`getFluentIcon(name, { jsx: false })`, a module-scope `bundleIcon`).
- A new icon: "Legge til et ikon i katalogen" in kodemonster.md, then rebuild the library.

## Typical tasks

- **Extend an existing component** through its own action list, panel union and reducer before reaching for a wrapper. Project information: `ActionType` tuples in `ProjectWebParts/src/components/ProjectInformation/Actions/useActions.ts` (a new `actionsMap` key also goes into the `hideActions` options in `webparts/projectInformation/index.ts`); a panel is a `ProjectInformationPanelType` member opened with `OPEN_PANEL`, closed with `CLOSE_PANEL`.
- **Panel**: `BasePanel`, or `CustomEditPanel` for an item form; save and cancel in `footer`, actions beside the title in `headerActions`, which puts them in a row under the title, outside the heading (`PortfolioWebParts/src/components/EditViewColumnsPanel/EditViewColumnsPanel.tsx`): in `header` they were the heading, which named the panel by its buttons, and absolutely placed from an empty heading they sat 16px below the close button and reached past the header, where the divider drawn on scroll cut through them. A panel about one item names itself through `headerText`, on the close button's line, not with a title in its body: the project information panel passes the project's title and `hideTitle` to the web part inside. Open state lives in the component's reducer when it has one, otherwise in `useState` in its hook. Put no provider inside: both `ViewFormPanel`s and both `ColumnFormPanel`s still nest one; do not copy them (`NewRiskActionPanel` and its footer lost theirs on 2026-10-14, #1319).
- **Dialog**: v9 `Dialog` (`DialogSurface` > `DialogBody` > `DialogTitle`, `DialogContent`, `DialogActions`). Model: `shared-library/src/components/ItemColumn/DialogColumn/index.tsx`, with a dismiss button in `DialogTitle`'s `action` (`aria-label={strings.CloseText}`) and a "Lukk" button in `DialogActions`, each in `DialogTrigger action='close'`. Under an existing provider (a cell, a panel) a dialog needs none; in its own React root it gets `IdPrefixProvider value={useId('fp-…')}` + `FluentProvider theme={customLightTheme}`, as `useConfirmationDialog` does. A yes/no question is `useConfirmationDialog` itself.
- **Form field**: each control in a `FieldContainer`, texts from the strings module; accessibility rules below. A day is the shared `DateField` (`CustomEditPanel`'s `DateTime` element and `NewRiskActionPanel` render it); `@fluentui/react-datepicker-compat` itself is declared only in shared-library and ProjectWebParts, and a consumer rendering `DateField` needs no dependency of its own. A day goes to SharePoint as `toCalendarDate(date)` (`YYYY-MM-DD`, which SharePoint stores as midnight in the site's time zone) and comes back as `readStoredDay(value, valueAsText)`: never send a picker's `Date` (from a machine east of the site the day before was stored) or show `new Date(storedValue)` (west of the site it showed the day before); both in `shared-library/src/util/formatDate.ts`.
- **List**: `DataGridList` with `IDataGridColumn` (`createTableColumn` plus `minWidth`/`defaultWidth`) or `createDataGridColumns(IListColumn[])`, which returns `{ columns, columnSizingOptions }`: pass `.columns`, memoized on the source columns (`ProjectWebParts/src/components/ProjectStatus/Sections/ListSection/ListSection.tsx`). A changed set of column ids remounts the grid and resets sort and sizing, so never build columns afresh per render, least of all with `getId` keys.
- Not `DataGrid` directly: the wrapper carries the lists' typography (column names 14px semibold, values 12px in `--colorNeutralForeground3`, links at the values' size, as 1.14's v8 lists; the hub's `ListGrid` and the dynamic list's table match it, so keep the three alike), an `overflow-x: auto` container, the selection-cell labels and a fit that allows for Fluent's 44px selection cell and 16px column padding.
- Two lists are not `DataGridList`: the hub (`PortfolioWebParts/src/components/List`, Fluent `Table` in `List/ListGrid`, for groups, a pinned header and shift-click ranges; a new cell type there is a registered `ColumnRenderComponent`) and the dynamic list's table view (`ProjectWebParts/src/components/DynamicList/views/ListView/ListView.tsx`, `Table` with `useTableFeatures`). A grouped list elsewhere reuses `ListGrid` (the program administration does): `selectionMode='none'` drops the checks, `selectedItems` makes the selection the caller's (matched by identity, reported through `onSelectionChange`), `className` overrides the hub's padding, `collapseStateKey` forgets the groups the user opened or closed when it changes (the program administration passes its search), and a right click on a column header reaches only `onColumnHeaderContextMenu` (the hub's column menu), else the browser. The header row is sticky: give no ancestor up to the scrolling area an `overflow`, or it sticks to that instead. Sort its rows with `List/sortItems` (by data type, or a custom order), then stably by the group value, as both hub lists do: sorting groups the rows within their groups, never ungroups.
- A cell that holds tags (`OverflowTagMenu`, `TagsColumn`) gives its `TableCellLayout`'s content the cell's width: `content={{ className }}` with `flex: 1 1 auto; min-width: 0` (`cellContent` in `List/ListGrid` and the dynamic list's `ListView`, `tagCell` in the project list's `List`). Fluent sizes that content by what it shows, and the tags' `Overflow` measures it, so until 1.15.0 the tags behind `+n` stayed there when the column was widened.
- A virtualised list (`react-window`, the project cards in `ProjectList/useProjectListRenderer.tsx`) takes its row as a component defined once at module scope, its data in `itemData`. An inline function as `FixedSizeList`'s child is a new component on every render: every row is remounted, a focused button is replaced, and a drawer it opened has nothing to give the focus back to.
- **Toolbar command**: a `ListMenuItem` built in the component's hook. An icon-only item has `null` text and a `description`, which becomes its `title` and `aria-label`. A checkable item needs `makeCheckable({ name, value })` and its parent `setItems(items, checkedValues)` (the render-mode menu in `useCommands.tsx`). An item with items inside a menu is a submenu opened by a menu item (the programs in `useViewSelector.tsx`). A selector whose label shows the current choice (the view selectors, the project list's render mode) is `makeShrinkable()`, never `setWidth`: it gives way first, its label shortening with an ellipsis down to its icon (a grid button, `Toolbar.module.scss`), then the toolbar's search box; nothing else shrinks, and only under 480 px do the buttons wrap; the list layout e2e holds it to that. A toolbar with neither (the status page's, the timelines', the idea module's, the program administration's) wraps as soon as its buttons do not fit, at any width (`:not(:has(.search, .shrinkable))`): kept on one line down to 480 px, the status page's went past the web part's edge up to about 1024 px. Its host gives it no fixed height (the status page's `.commandBar` had 42 px, and the wrapped row lay under the pinned tabs); `tests/smoke/project.spec.ts` measures the status page. A search box beside a toolbar rather than in it (`List/ListHeader`, the project list's `Commands`, the program administration's `ProjectList`) follows the same rule in its own stylesheet: `min-width: 0` on the search box and its wrapper, and `flex-wrap: wrap` under 480 px. Where the toolbar holds a shrinkable selector (`List/ListHeader`, `Commands`), the host gives the toolbar's provider `flex: 1000 0 auto; width: min-content; max-width: max-content` and the search box a basis (`flex: 1 1 180px`), not `width: 100%`: the toolbar then takes the free space up to its full width before the search box, and the title and search box keep theirs until the selector shows only its icon; a shrink factor alone would take a fraction of a pixel from the title, enough to wrap it.
- **Column header menu** (portfolio overview, aggregation): not `ListMenuItem` but `IMenuItem` (`shared-library/src/types/MenuItem.ts`: `canCheck`, `checked`, `data: { name, value }`, `subMenuProps`, `iconProps.iconName`), built in each `ColumnContextMenu/useColumnContextMenu.ts`, which also holds `checkedValues`, and rendered by `PortfolioWebParts/src/components/List/ColumnContextMenu/renderMenuItem.tsx`. The dynamic list's table view has a context menu of Fluent's own per header instead (`Menu openOnContext` round the `TableHeaderCell`, in `DynamicList/views/ListView/ListView.tsx`): sort, and «Endre kolonnebredde» through the column sizing's `enableKeyboardMode`, the keyboard's way to resize a column. The hub's column menus offer «Endre kolonnebredde» too, through the `resizeColumn` that `ListGrid` hands `onColumnContextMenu` (none for a column without a resize handle); `ListGrid` names the handle in Norwegian, where Fluent's own names are English.
- In those menus a checkable item without `data.name` and `value` never shows its check (the group-by item until phase 4); `iconName` must be a catalog name, since `renderMenuItem` uses `getFluentIcon`; a submenu's trigger drops the close handler and is marked `hasSubmenu`.
- **An application customizer** renders at the end of `onInit`, on `placeholderProvider.changedEvent` and on `navigatedEvent`, and gives up quietly when `placeholderProvider.tryCreateContent` returns nothing yet. On a list page SharePoint often defines its placeholders after the customizer has started, and the first navigation has passed: rendering on that event only, the footer showed on few list loads (`PortfolioExtensions/src/extensions/footer/index.ts`, 2026-10-20).
- **Usage statistics**: a user action worth counting is counted once, in the handler where it went through, with `useTelemetry().track('<event>', variant?)` from `pp365-shared-library/lib/telemetry` (never in `render`; a pick of what is shown already is no switch), and a load or save failure the component handles and shows with `trackError(error)`, by its code, never its message. The event and the component's alias must be in the usage contract (`shared-library/src/telemetry/contract.ts`), which changes together with Assist's copy and the wiki page. The base web parts provide `TelemetryProvider`. Rules and checklist: `.development-guide/spfx/bruksstatistikk.md`.
- **Notice after an action**: no wrapper; Fluent's `<Toaster toasterId={toasterId} />` with `useId('toaster')` and `useToastController(toasterId).dispatchToast(<Toast>…</Toast>, { intent })`, as `ProgramWebParts/src/components/ProgramAdministration/Commands/Commands.tsx`. A toast confirms what just happened; a `UserMessage` states a lasting condition in place (error, empty, info).
- **Styling**: `import styles from './X.module.scss'`, `className={styles.x}`, selectors nested as the DOM. Colours, sizes and weights from Fluent's tokens (`var(--colorNeutralForeground3)`, `var(--fontSizeBase200)`, `var(--fontWeightSemibold)`), which exist only under a `FluentProvider`; the v8-to-token table heads `ProjectExtensions/src/components/ProgressDialog/ProgressDialog.module.scss`.
- To restyle a Fluent part, nest `:global(.fui-…)` under your module class, which outranks Fluent's single-class rules whatever the injection order (`DataGridList.module.scss`). Read Fluent's own styles rather than guess: its sub-packages are only in the pnpm store, `common/temp/node_modules/.pnpm/@fluentui+<pkg>@<version>_*/node_modules/@fluentui/<pkg>/lib`.
- **See it in the browser** (`utviklingsmiljo.md`): `npm run watch` in the solution. It bundles `shared-library` and `ProjectWebParts` from their `lib/` as they are, so build those first (`rush build -T <package>`, or `npx heft build --clean` in each), or keep `npm run watch` running in `shared-library` while you change it. `SERVE_CHANNEL` in the solution's `.env` must match the page's channel (the test hub is on `test`) or the page never asks for your bundles; `SERVE_BUNDLE_REGEX` narrows the build.
- To debug from VS Code with the repo open: copy `.vscode/launch.sample.json` to `.vscode/launch.json`, `npx heft trust-dev-cert` once in a solution, run `npm run watch`, then start "Debug a page against npm run watch" (F5) on the page, without a query string.
- **Test**: a component test next to the component (pp365-testing has the stand-ins for Fluent's combobox family and popovers, and the workarounds for menus and drawers). Mock the hook or adapter that fetches; a hook that only reads context is covered by rendering with a context stand-in value (`ProjectInformation/Actions/Actions.test.tsx`). Strings resolve to nb-no, so `BasePanel`'s close button is "Lukk". Coverage floors in each `config/jest.config.json`: `heft test` only reports a missed floor, `Install/Build-Release.ps1` fails on it.
- **Changelog**: a user-visible change gets a Norwegian line in `CHANGELOG.md` under the coming version (`Ny funksjonalitet`, `Forbedringer` or `Feilrettinger`).

## Fluent v9 pitfalls

- **One provider per surface root.** Each `FluentProvider` injects a `<style>` with the whole theme into `document.head`, so never one per cell or row: cells render under the list's provider (`PortfolioWebParts/src/components/List/List.tsx`). Wrappers with own providers need none around or inside them. A provider paints `colorNeutralBackground1` and body typography, hence `Fluent transparent`. A surface in its own React root (an extension's dialog) needs its own.
- Keep `applyStylesToPortals` at its default and drawers modal (comments in `BasePanel.tsx`): with the flag off a portalled drawer gets no theme and renders invisible; a `non-modal` drawer renders inline, behind the web part.
- The `OverlayDrawer` keeps an identity `transform` after it slides in, so it is the containing block of anything `position: fixed` inside it: such an element is placed relative to the drawer and clipped by its `overflow`. A drag preview is the case found (`@hello-pangea/dnd` drags a fixed copy; it vanished while dragged): render it through `renderClone` into a Fluent `<Portal>`, which carries the theme and the drawer's layer, inside a wrapper with the CSS module's outer class when the row's styles are nested under it (`PortfolioWebParts/src/components/EditViewColumnsPanel/EditViewColumnsPanel.tsx`). jsdom has no layout, so only a browser test catches it (`e2e/tests/flows/edit-view-columns-drag.spec.ts`).
- **Portalled clicks bubble through React.** A dialog, popover or menu that a row's cell opens is portalled elsewhere in the page, yet React passes its clicks up through the row. A clickable row ignores clicks that did not land inside it in the DOM: `isOwnClick` in `PortfolioWebParts/src/components/List/ListGrid/ListGrid.tsx` (`event.currentTarget.contains(event.target)`, and not on a link, button or check of its own).
- **Hover popovers in cells** (`PortfolioWebParts/src/components/List/ItemColumn/StatusReportColumn`): `openOnHover` opens with no delay, and the surface paints at the viewport's top left until positioning stamps `data-popper-placement`. Control `open` with a timer (`openDelay` 500), cancel it in the trigger's `onPointerLeave` (Fluent reports the leave only after `mouseLeaveDelay`, 500 ms by default, 200 there), and hide the surface with `&:not([data-popper-placement]) { visibility: hidden }`.
- **Tooltips in rows**: once one tooltip under a provider is visible, the next opens with no delay, and `relationship='description'` (or `label` with non-string content) keeps a hidden portal per instance. In rows use a native `title`, or `relationship='label'` with a string (`shared-library/src/components/ItemColumn/UserColumn`).
- `bundleIcon()` returns a new component type per call; in a render or hook body it remounts the icon on every render. Call it at module scope (`PortfolioWebParts/src/components/IdeaModule/IdeaModule.tsx`) or use `getFluentIcon`; `ProjectCardFooter/useProjectCardFooter.ts`, `ProjectInformation/Actions/useActions.ts` and `ProjectStatus/Commands/useToolbarItems.tsx` still do it per render. A component declared inside a render body churns the same way.
- **Truncating text in a Fluent `Button`**: Fluent's reset gives the button `resize: horizontal`, which draws a browser grip once `overflow` is hidden. Give it `min-width: 0; overflow: hidden; resize: none`, and the text its own span with `white-space: nowrap; text-overflow: ellipsis` and a `title` (`.headerButton` in `List/ListGrid/ListGrid.module.scss`).
- Memo and effect dependencies: the `Fluent` wrapper once memoized its tree with no dependencies and froze the status page on its first render; a fresh `[]` default on every render re-ran an effect on every render (project information's child projects).
- No entrance animation that keeps its end state (`forwards`/`both`) on list rows: in Chrome/Edge on a Retina Mac such rows stay on their own compositor layers and paint as white tiles (the 1.14.0 fix "hvite, flimrende felter" in `CHANGELOG.md`); DevTools' Layers panel names the cause.
- Shipping in `@fluentui/react-components` does not prove a control works on our React, and failing or crawling under jsdom does not prove it broken: the combobox family looped under jsdom on React 17 (on 18 it opens, slowly) and `Menu` stalls the Jest worker, yet both work in the browser. Try a new kind of control in a browser first (pp365-testing).
- **Renaming a prop**: props objects (`useMemo<IXProps>`, `: IXProps =`, `as IXProps`) that are spread skip excess-property checks; that is how five panels kept `isOpen` and never opened (`docs/plans/fluent-v9-migration.md`). `IBasePanelProps` declares `isOpen`/`onDismiss` as `never` for that reason; grep for the objects.
- **A fix that does nothing**: first prove the browser runs your bundle (a visible tell, or the bundle URL in the Network tab): the right solution watched, its dependencies built, and after a deployment SharePoint can serve a component's previous manifest for minutes. A `<style>` tag added from the console tests CSS without a build.

## Accessibility

Names, labels (the `FieldContainer` wiring, `useFieldControlProps_unstable`, `PeoplePicker`, PnP's taxonomy picker), focus, announcements, colours and the audit of a component: pp365-a11y.

## Localized strings

- Components use their solution's module: `import strings from 'ProjectWebPartsStrings'` (or `import * as strings`; both compile, match the file). The library uses `SharedLibraryStrings`; consumers never import it.
- `SharedResources` (`import resource from 'SharedResources'`) holds the names and texts the templates provision; label a field with `resource.SiteFields_<Name>_DisplayName` rather than a new key. It is generated into each solution's `src/loc/shared` from `Templates/Portfolio/Resources.*.resx` by `npm run generate-resx-ts` in `Templates`.
- A new key goes into the declaration file, `nb-no.js` and `en-us.js`, phrased like its siblings in both languages; groups such as `strings.Aria.*` are fine. Interpolate with `format`, never concatenation; `Error()` texts the UI shows are strings too.
- Edit a bundle in its own style, and never run Prettier over `src/loc/*.js`: not every solution's bundles are formatted (ProjectWebParts' `en-us.js` mixes quotes and long lines), so `prettier --write` rewrites dozens of lines nobody changed. No build or lint step formats them.
- A key missing from one bundle is `undefined` in that language: text renders nothing and `format()` throws. `,,` in a bundle is a syntax error that takes the whole bundle down (in `nb-no.js` it also fails the Jest run).
- `npm run validate-loc` (all solutions: `rush validate-loc`) writes the interface keys missing from each bundle to `localization-report.md` (gitignored) and logs `N missing keys in <lng>`. It exits 0 even then, cannot see a key that exists only in a `.js` file, and is part of neither `npm run build` nor CI: read its output.

## Do not

- Import `@fluentui/react` (v8) in new code.
- `import * as` from `@fluentui/react-icons`, deep-import `pp365-shared-library/lib/icons/iconCatalog`, or import a PnP control from its package root (`@pnp/spfx-controls-react`, `@pnp/spfx-property-controls`); ESLint stops all three (`SharePointFramework/.eslint-config/index.js`).
- Put logic or JSX in a barrel, or edit `temp/sass-ts` or `src/loc/shared` by hand.
- Use `isOpen`/`onDismiss` on `BasePanel`, a `non-modal` drawer, or `applyStylesToPortals={false}`.
- Add a provider around or inside a wrapper that has its own, or one per cell or row; call `bundleIcon` in a render; animate list rows in.
- Render Fluent's `DataGrid` directly for a new list, or rebuild a list's columns on every render.
- Style with Griffel `makeStyles` outside the components that already do (`TemplatePackageCatalog` and its parts, `ProjectMenu`, the status page's `SnapshotDialog` and its `CopyLinkDialog`); use `.module.scss`.
- Hard-code user-facing text in either language, error messages and `aria-label`s included.
- Remove a `fabricIconAliases.ts` entry; tenants keep the old names in their lists for good.
- Take `npx tsc --noEmit` as the check: it runs no ESLint, and the error-level rules (`unused-imports/no-unused-imports`, `react/jsx-key`, `prettier/prettier`, the restricted imports) fail `heft build`; run `npx eslint <files>` in the solution.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in design →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.