Rework task pane UI and document design guidelines

- Add a header, a shared accordion, a docked status region, and token-based styles
- Use the blue primary style for every action button and collapse all sections by default
- Improve labels, selection hints, destructive confirmations, grid semantics, and narrow-pane layout
- Add docs/UI_GUIDELINES.md and update the README, user guide, and developer guide
This commit is contained in:
schihei committed 2026-11-25 12:40:12 +01:00
1 parent 89989c04e9
commit e223dc61c8
23 files changed
+719 -549

No files matched your search

+28 -6
View File
@@ -194,6 +194,7 @@ For raw Fluent buttons that need a confirmation dialog:
onConfirm={remove}
confirmTitle="Remove the grid?"
confirmMessage="This removes the grid from the current slide."
confirmLabel="Remove"
>
Remove
</ConfirmButton>
@@ -201,12 +202,15 @@ For raw Fluent buttons that need a confirmation dialog:
### Section
Collapsible grouping with consistent styling:
A single disclosure item. `Section` renders an `AccordionItem`, so it must be
placed inside the shared `Accordion` in `App.tsx`:
```tsx
<Section title="My Feature">
<MyFeatureComponent />
</Section>
<Accordion multiple collapsible defaultOpenItems={["content"]}>
<Section title="My Feature">
<MyFeatureComponent />
</Section>
</Accordion>
```
## Creating a New Tool
@@ -350,6 +354,21 @@ Test pure functions and helpers directly. Office.js interactions should be kept
Continuous integration runs lint, typecheck, tests, build, and manifest validation on every push and pull request.
## UI Guidelines
The pane follows Fluent 2 and Microsoft's Office Add-in UX guidance. The full
rules and review checklist live in [`docs/UI_GUIDELINES.md`](UI_GUIDELINES.md).
Key points:
- Use Fluent tokens for colour, spacing, type, radius, and motion. No literal
hex values in UI styles (slide colours are the exception).
- Keep one scroll container. Sections must not set `maxHeight` or `overflow`.
- All action buttons use the blue primary style; destructive actions are
confirmed by a dialog.
- Labels are verb + object, with a short hint when a selection is required.
- Keep the single always-mounted `role="status"` region for feedback.
## Performance Guidelines
- **Batch `context.sync()` calls.** Load all needed properties, then sync once.
@@ -366,12 +385,15 @@ Continuous integration runs lint, typecheck, tests, build, and manifest validati
4. Add confirmations for destructive operations.
5. Make repeated add operations idempotent.
6. Use Fluent `Field`/`Input`/`Dropdown` controls so labels and keyboard navigation work.
7. Announce results through the status region (`role="status"`).
8. Update docs when behavior changes.
7. Use design tokens and follow `docs/UI_GUIDELINES.md` for any new UI.
8. Announce results through the status region (`role="status"`).
9. Update docs when behavior changes.
## Resources
- [Office Add-ins documentation](https://learn.microsoft.com/office/dev/add-ins/)
- [Office Add-in UX design guidelines](https://learn.microsoft.com/office/dev/add-ins/design/add-in-design)
- [Office.js API reference](https://learn.microsoft.com/javascript/api/overview/office)
- [Fluent UI React v9](https://react.fluentui.dev/)
- [Fluent 2 design system](https://fluent2.microsoft.design/)
- [Vitest](https://vitest.dev/)