Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .storybook/github-source.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Submodule story roots live in their own repos; GitHub can't browse into a gitlink.
const SUBMODULE_REPOS: Record<string, string> = {
'packages/datavis/': 'mieweb/datavis',
};

/** GitHub blob URL for a path relative to the ui repo root. */
export function githubSourceUrl(repoPath: string): string {
const prefix = Object.keys(SUBMODULE_REPOS).find((p) =>
repoPath.startsWith(p)
);
const [repo, path] = prefix
? [SUBMODULE_REPOS[prefix], repoPath.slice(prefix.length)]
: ['mieweb/ui', repoPath];
return `https://github.com/${repo}/blob/main/${path
.split('/')
.map(encodeURIComponent)
.join('/')}`;
}

/** Repo-relative path of an absolute story file path, if it is in a known root. */
export function repoRelativeStoryPath(fileName: string): string | null {
const roots = [...Object.keys(SUBMODULE_REPOS), 'src/'];
for (const root of roots) {
const index = fileName.indexOf(`/${root}`);
if (index >= 0) return fileName.slice(index + 1);
}
return null;
}
6 changes: 5 additions & 1 deletion .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,11 @@ function ychartGitInfoPlugin(): Plugin {
const ychartDependencyNames = readDependencyNames('ychart');

const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
stories: [
'../src/**/*.mdx',
'../src/**/*.stories.@(js|jsx|mjs|ts|tsx)',
'../packages/datavis/stories/**/*.stories.@(js|jsx|mjs|ts|tsx)',
Comment thread
tvenable-mie marked this conversation as resolved.
Resolved
Comment thread
tvenable-mie marked this conversation as resolved.
Resolved
Comment thread
tvenable-mie marked this conversation as resolved.
Resolved
Comment thread
tvenable-mie marked this conversation as resolved.
Resolved
Comment thread
tvenable-mie marked this conversation as resolved.
Resolved
Comment thread
tvenable-mie marked this conversation as resolved.
Resolved
Comment thread
tvenable-mie marked this conversation as resolved.
Resolved
Comment thread
tvenable-mie marked this conversation as resolved.
Resolved
Comment thread
tvenable-mie marked this conversation as resolved.
Resolved
Comment thread
tvenable-mie marked this conversation as resolved.
Resolved
Comment thread
tvenable-mie marked this conversation as resolved.
Resolved
Comment thread
tvenable-mie marked this conversation as resolved.
Resolved
Comment thread
tvenable-mie marked this conversation as resolved.
Resolved
Comment thread
tvenable-mie marked this conversation as resolved.
Resolved
],
// Deprecated/retired entries are hidden from both the sidebar tree and
// search (one filtered dataset drives both — there is no search-only mode).
// Their docs pages stay built and reachable by direct URL; the Deprecated
Expand Down
6 changes: 2 additions & 4 deletions .storybook/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { create } from 'storybook/theming/create';
import { Button } from 'storybook/internal/components';
import { GithubIcon, MobileIcon, ShareAltIcon } from '@storybook/icons';
import { buildArgsParam } from 'storybook/internal/router';
import { githubSourceUrl } from './github-source';
import { serializeProjectGlobals } from './mobile-preview';

// Brand theme configurations for the Storybook manager UI
Expand Down Expand Up @@ -667,10 +668,7 @@ function GitHubSourceTool() {

if (!sourcePath) return null;

const githubUrl = `https://github.com/mieweb/ui/blob/main/${sourcePath
.split('/')
.map(encodeURIComponent)
.join('/')}`;
const githubUrl = githubSourceUrl(sourcePath);

return React.createElement(
Button,
Expand Down
10 changes: 6 additions & 4 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
} from '../src/components/CodeLookup/context';
import { isRtlLocale } from '../src/hooks/useDirection';
import { CatalogDocsPage } from './CatalogDocsPage';
import { githubSourceUrl, repoRelativeStoryPath } from './github-source';
import { withMobilePreview } from './MobilePreview';
import { mobilePreviewMode } from './mobile-preview';

Expand Down Expand Up @@ -205,18 +206,19 @@ const withGitHubSource: Decorator = (Story, context) => {
const rawFileName = context.parameters?.fileName as string | undefined;
// Normalize Windows backslashes to forward slashes before any path operations
const fileName = rawFileName ? rawFileName.replace(/\\/g, '/') : undefined;
const srcIndex = fileName ? fileName.indexOf('/src/') : -1;
const relPath = fileName ? repoRelativeStoryPath(fileName) : null;

const githubUrl = (() => {
if (srcIndex < 0 || !fileName) return null;
const relPath = fileName.slice(srcIndex + 1);
if (!relPath) return null;
// Submodule stories have no sibling component file; link the story itself.
if (!relPath.startsWith('src/')) return githubSourceUrl(relPath);
const basename = relPath.split('/').pop() ?? '';
// Only strip `.stories` when the basename is strictly `Name.stories.(ts|tsx|js|jsx)`
// (no extra dot-segments before `.stories`). Otherwise link to the stories file itself.
const stripped = /^[^.]+\.stories\.(tsx?|jsx?)$/.test(basename)
? relPath.replace(/\.stories(\.[^.]+)$/, '$1')
: relPath;
return `https://github.com/mieweb/ui/blob/main/${stripped}`;
return githubSourceUrl(stripped);
})();

// Full-height stories (parameters.githubSourceFooter === false) fill the
Expand Down
22 changes: 12 additions & 10 deletions ComponentDocsAudit.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,17 @@ Reported, not resolved:
## 2. Grade table

Scores are `P S A R C L`. Evidence points at `description.component` or records its absence.
DataVis NITRO stories now live in [mieweb/datavis](https://github.com/mieweb/datavis/tree/main/stories);
their line-level evidence is pinned to the audited snapshot (`a8ca1ad`).

### Calibration set

| Component | P S A R C L | Total | Grade | Evidence |
| -------------------------------------------------------------------------------------- | ----------- | ----- | ----- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| [ReadingProgressBar](src/components/ReadingProgressBar/ReadingProgressBar.stories.tsx) | 2 1 0 0 2 1 | 6 | D | [stories:12-14](src/components/ReadingProgressBar/ReadingProgressBar.stories.tsx#L12-L14); no link to Progress/TOC/SectionSpyNav |
| [TableOfContents](src/components/TableOfContents/TableOfContents.stories.tsx) | 1 0 0 0 2 1 | 4 | F | no `description.component` ([stories:9-24](src/components/TableOfContents/TableOfContents.stories.tsx#L9-L24)); a11y claims only in demo prose |
| [Table](src/components/Table/Table.stories.tsx) | 2 2 2 2 2 1 | 11 | C | [stories:39](src/components/Table/Table.stories.tsx#L39) one-way verified link to NITRO |
| [DataVis NITRO (Grid)](src/components/DataVisNITRO/DataVisNITRO.stories.tsx) | 2 1 0 0 2 1 | 7 | D | [stories:63-66](src/components/DataVisNITRO/DataVisNITRO.stories.tsx#L63-L66) describes the wrapper only |
| Component | P S A R C L | Total | Grade | Evidence |
| ---------------------------------------------------------------------------------------------------- | ----------- | ----- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| [ReadingProgressBar](src/components/ReadingProgressBar/ReadingProgressBar.stories.tsx) | 2 1 0 0 2 1 | 6 | D | [stories:12-14](src/components/ReadingProgressBar/ReadingProgressBar.stories.tsx#L12-L14); no link to Progress/TOC/SectionSpyNav |
| [TableOfContents](src/components/TableOfContents/TableOfContents.stories.tsx) | 1 0 0 0 2 1 | 4 | F | no `description.component` ([stories:9-24](src/components/TableOfContents/TableOfContents.stories.tsx#L9-L24)); a11y claims only in demo prose |
| [Table](src/components/Table/Table.stories.tsx) | 2 2 2 2 2 1 | 11 | C | [stories:39](src/components/Table/Table.stories.tsx#L39) one-way verified link to NITRO |
| [DataVis NITRO (Grid)](https://github.com/mieweb/datavis/blob/main/stories/DataVisNITRO.stories.tsx) | 2 1 0 0 2 1 | 7 | D | [stories:63-66](https://github.com/mieweb/ui/blob/a8ca1ad/src/components/DataVisNITRO/DataVisNITRO.stories.tsx#L63-L66) describes the wrapper only |

### A (16–18)

Expand Down Expand Up @@ -134,7 +136,7 @@ Scores are `P S A R C L`. Evidence points at `description.component` or records
| [SourceTip](src/components/SourceTip/SourceTip.stories.tsx) | 10 | R corrected to 0 — does not mention GlossaryTooltip |
| [VisuallyHidden](src/components/VisuallyHidden/VisuallyHidden.stories.tsx) | 10 | strong a11y use cases |
| [ClampedText](src/components/ClampedText/ClampedText.stories.tsx) | 9 | no Text link |
| [DataVisNitroGraph](src/components/DataVisNITRO/DataVisNitroGraph.stories.tsx) | 9 | peer deps/subpath not stated; Sparkline not linked |
| [DataVisNitroGraph](https://github.com/mieweb/datavis/blob/main/stories/DataVisNitroGraph.stories.tsx) | 9 | peer deps/subpath not stated; Sparkline not linked |
| [ErrorPage](src/components/ErrorPage/ErrorPage.stories.tsx) | 9 | no Alert/LoadingPage comparison |
| [FreshnessBadge](src/components/FreshnessBadge/FreshnessBadge.stories.tsx) | 9 | no Badge/CountBadge comparison |
| [HandsFreeChat](src/components/AI/HeyOzwell/HandsFreeChat.stories.tsx) | 9 | parent/sibling relationships unstated |
Expand All @@ -147,7 +149,7 @@ Scores are `P S A R C L`. Evidence points at `description.component` or records
| Total | Components |
| ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 8 | [Accordion](src/components/Accordion/Accordion.stories.tsx)\* · [CopyButton](src/components/CopyButton/CopyButton.stories.tsx) · [Modal](src/components/Modal/Modal.stories.tsx) · [RowActionToolbar](src/components/RowActionToolbar/RowActionToolbar.tsx) (JSDoc only, no story) |
| 7 | [AlertDialog](src/components/AlertDialog/AlertDialog.stories.tsx) · [AIMessage](src/components/AI/AIMessage.stories.tsx) · [DataVis NITRO](src/components/DataVisNITRO/DataVisNITRO.stories.tsx) · [ESheet Builder](src/components/ESheet/EsheetBuilder.stories.tsx) · [FilterSummaryBar](src/components/FilterSummaryBar/FilterSummaryBar.stories.tsx) · [Label](src/components/Label/Label.stories.tsx) · [Markdown](src/components/Markdown/MarkdownRenderer.stories.tsx) · [ServicePicker](src/components/ServicePicker/ServicePicker.stories.tsx) · [Sparkline](src/components/Sparkline/Sparkline.stories.tsx) · [SuperChat panel](src/components/SuperChat/SuperChat.stories.tsx) · [SuperChatConversations](src/components/SuperChat/SuperChatConversations.stories.tsx) |
| 7 | [AlertDialog](src/components/AlertDialog/AlertDialog.stories.tsx) · [AIMessage](src/components/AI/AIMessage.stories.tsx) · [DataVis NITRO](https://github.com/mieweb/datavis/blob/main/stories/DataVisNITRO.stories.tsx) · [ESheet Builder](src/components/ESheet/EsheetBuilder.stories.tsx) · [FilterSummaryBar](src/components/FilterSummaryBar/FilterSummaryBar.stories.tsx) · [Label](src/components/Label/Label.stories.tsx) · [Markdown](src/components/Markdown/MarkdownRenderer.stories.tsx) · [ServicePicker](src/components/ServicePicker/ServicePicker.stories.tsx) · [Sparkline](src/components/Sparkline/Sparkline.stories.tsx) · [SuperChat panel](src/components/SuperChat/SuperChat.stories.tsx) · [SuperChatConversations](src/components/SuperChat/SuperChatConversations.stories.tsx) |
| 6 | [ReadingProgressBar](src/components/ReadingProgressBar/ReadingProgressBar.stories.tsx) · [AGGrid](src/components/AGGrid/AGGrid.stories.tsx) · [AIChat (Voice)](src/components/AI/AIChatVoice.stories.tsx) · [Q](src/components/Q/Q.stories.tsx) · [SuperChatInbox](src/components/SuperChat/SuperChatInbox.stories.tsx) · [Text](src/components/Text/Text.stories.tsx) · [ThemeProvider](src/components/ThemeProvider/ThemeProvider.stories.tsx) · [Timeline](src/components/Timeline/Timeline.stories.tsx) · [Tooltip](src/components/Tooltip/Tooltip.stories.tsx) · [TranscriptView](src/components/TranscriptView/TranscriptView.stories.tsx) · [VisitScribe](src/components/AI/HeyOzwell/VisitScribe.stories.tsx) · [WakeWord](src/components/AI/HeyOzwell/WakeWord/WakeWord.stories.tsx) |
| 5 | [AddressForm](src/components/Address/AddressForm.stories.tsx) · [AudioPlayer](src/components/AudioPlayer/AudioPlayer.stories.tsx) · [BusinessHoursEditor](src/components/BusinessHoursEditor/BusinessHoursEditor.stories.tsx) · [Collapsible](src/components/Collapsible/Collapsible.stories.tsx) · [DropzoneOverlay](src/components/DropzoneOverlay/DropzoneOverlay.stories.tsx) · [Icons](src/components/Icons/Icons.stories.tsx) · [OrderList](src/components/OrderList/OrderList.stories.tsx) · [OzwellChat](src/components/AI/OzwellChat.stories.tsx) · [PatientHeader](src/components/PatientHeader/PatientHeader.stories.tsx) · [PermissionsEditor](src/components/PermissionsEditor/PermissionsEditor.stories.tsx) · [PhoneInputGroup](src/components/PhoneInput/PhoneInputGroup.stories.tsx) · [ResultsEntryForm](src/components/ResultsEntryForm/ResultsEntryForm.stories.tsx) · [StepIndicator](src/components/StepIndicator/StepIndicator.stories.tsx) · [VoiceSetup](src/components/AI/HeyOzwell/VoiceSetup.stories.tsx) |

Expand Down Expand Up @@ -219,11 +221,11 @@ Nearly all lack `description.component`. Number after each name is the total sco
## 3. Highest-priority findings

1. **The mandated default grid has the weakest selection guidance of the trio.**
[DataVisNITRO.stories.tsx:63-66](src/components/DataVisNITRO/DataVisNITRO.stories.tsx#L63-L66)
[DataVisNITRO.stories.tsx:63-66](https://github.com/mieweb/ui/blob/a8ca1ad/src/components/DataVisNITRO/DataVisNITRO.stories.tsx#L63-L66)
only says it wraps `@mieweb/datavis`. It never states it is the default for all tables, never
links to `Table` or `AGGrid`, never names the peers (`@mieweb/datavis`, `datavis-ace`) or the
`@mieweb/ui/datavis` subpath, and the material a11y limitation is only a code comment
([stories:54-59](src/components/DataVisNITRO/DataVisNITRO.stories.tsx#L54-L59),
([stories:54-59](https://github.com/mieweb/ui/blob/a8ca1ad/src/components/DataVisNITRO/DataVisNITRO.stories.tsx#L54-L59),
`a11y: { disable: true }`). _Effect:_ a developer on the NITRO page cannot tell why it is
preferred or what it costs. _Correction:_ add purpose/selection paragraph, reciprocal link to
Table, install block, and an explicit accessibility limitation.
Expand Down
11 changes: 9 additions & 2 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
export default [
eslint.configs.recommended,
{
files: ['src/**/*.{ts,tsx}'],
files: [
'src/**/*.{ts,tsx}',
// DataVis NITRO stories live in the datavis submodule but are linted here.
'packages/datavis/stories/**/*.{ts,tsx}',
],
languageOptions: {
parser: tsparser,
parserOptions: {
Expand Down Expand Up @@ -209,7 +213,10 @@ export default [
},
// Allow console logs in Storybook stories for development/testing
{
files: ['src/**/*.stories.{ts,tsx}'],
files: [
'src/**/*.stories.{ts,tsx}',
'packages/datavis/stories/**/*.stories.{ts,tsx}',
],
rules: {
'no-console': 'off',
},
Expand Down
Loading
Loading