Skip to content

Conversation

@dougfabris
Copy link
Member

@dougfabris dougfabris commented Sep 10, 2025

Proposed changes (including videos or screenshots)

Enforce the FieldHint usage in order to keep visual consistency

before

Screenshot 2025-09-11 at 10 32 01

after

Screenshot 2025-09-11 at 10 33 09

Issue(s)

Steps to test or reproduce

Further comments

CORE-1345

Summary by CodeRabbit

  • New Features
    • None
  • Style
    • Unified hint styling in Create Channel and Create Team modals for clearer, consistent guidance.
  • Documentation
    • Added Storybook stories for Create Channel and Create Team modals, including V2 variants.
  • Tests
    • Introduced story-driven snapshot and accessibility tests to ensure stable rendering and a11y compliance across modal variants.
  • Chores
    • Improved Storybook environment setup to better simulate app routing and runtime configuration.

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Sep 10, 2025

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Sep 10, 2025

⚠️ No Changeset found

Latest commit: 61d9fcc

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 10, 2025

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • apps/meteor/client/sidebar/header/CreateTeam/__snapshots__/CreateTeamModal.spec.tsx.snap is excluded by !**/*.snap

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Replaces FieldDescription with FieldHint in channel/team creation modals. Adds Storybook stories for both modals and story-driven Jest + axe accessibility tests. Initializes Meteor runtime config in RouterContextMock for stories. No changes to exported APIs or business logic.

Changes

Cohort / File(s) Summary
Hint component swap: Channel modals
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/CreateChannelModal.tsx, apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx
Replaced FieldDescription with FieldHint for encrypted hints; removed FieldDescription imports; IDs and content unchanged.
Hint component swap: Team modal
apps/meteor/client/sidebar/header/CreateTeam/CreateTeamModal.tsx
Replaced multiple FieldDescription instances (private/encrypted/read-only/broadcast) with FieldHint; removed FieldDescription import; IDs and content unchanged.
Storybook: Channel modal
apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.stories.tsx
New stories: default and version 2; sets meta title and component; minor naming inconsistency retained.
Storybook: Team modal
apps/meteor/client/sidebar/header/CreateTeam/CreateTeamModal.stories.tsx
New stories: default and version 2; sets meta title and component.
Tests: Channel modal stories
apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.spec.tsx
Adds composed Storybook-based tests: render snapshot and jest-axe a11y per story; uses mock app wrapper; retains existing test invocation.
Tests: Team modal stories
apps/meteor/client/sidebar/header/CreateTeam/CreateTeamModal.spec.tsx
Adds composed Storybook-based tests: render snapshot and jest-axe a11y per story; mocks navigation; uses mock app wrapper.
Story runtime setup
apps/meteor/client/stories/contexts/RouterContextMock.tsx
Adds window.meteor_runtime_config initialization (ROOT_URL, ROOT_URL_PATH_PREFIX) before RouterContextMock; component logic unchanged.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Jest as Jest Runner
  participant Stories as composeStories(...)
  participant Wrapper as mockAppRoot().build()
  participant Story as Story Component
  participant Axe as jest-axe

  Jest->>Stories: Load all Create*Modal stories
  loop For each story
    Jest->>Wrapper: Render(Story)
    Wrapper->>Story: Provide app/router context
    Note over Story: Renders Create*Modal (V1 or V2)
    Jest->>Axe: axe(container)
    Axe-->>Jest: a11y results
    Jest->>Jest: Snapshot baseElement
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested labels

stat: ready to merge, stat: QA assured

Pre-merge checks (3 passed)

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "chore: Use FieldHint instead of FieldDescription on create modals" succinctly and accurately summarizes the PR's primary change—replacing FieldDescription with FieldHint in create modal components (e.g., CreateChannelModal and CreateTeamModal). It is specific, on-topic, and clear enough for a teammate scanning the history to understand the main intent of the changeset.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Poem

Hop, hop! I swap a hint, not a tale,
FieldHint now sails where descriptions set sail.
Stories bloom, tests nibble a11y delight,
Snapshots sparkle in the moonlit night.
With ROOT_URL set, my burrow’s just right—
Carrot commits merged, everything tight! 🥕✨

✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/createModalHints

Comment @coderabbitai help to get the list of available commands and usage tips.

@dougfabris dougfabris added this to the 7.11.0 milestone Sep 10, 2025
@codecov
Copy link

codecov bot commented Sep 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.53%. Comparing base (27b29fa) to head (61d9fcc).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #36909      +/-   ##
===========================================
+ Coverage    66.46%   66.53%   +0.06%     
===========================================
  Files         3342     3344       +2     
  Lines       114309   114626     +317     
  Branches     21080    21194     +114     
===========================================
+ Hits         75980    76268     +288     
- Misses       35647    35663      +16     
- Partials      2682     2695      +13     
Flag Coverage Δ
e2e 57.68% <0.00%> (-0.13%) ⬇️
unit 71.22% <100.00%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dougfabris dougfabris marked this pull request as ready for review September 11, 2025 13:39
@dougfabris dougfabris requested a review from a team as a code owner September 11, 2025 13:39
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (7)
apps/meteor/client/stories/contexts/RouterContextMock.tsx (1)

12-16: Don’t clobber global Meteor runtime config; guard and keep types

Unconditional assignment can overwrite existing config in story/test runs; also the property isn’t typed.

Apply within this hunk:

-// Ensure Meteor settings are defined
-window.__meteor_runtime_config__ = {
-	ROOT_URL: 'http://localhost:3000',
-	ROOT_URL_PATH_PREFIX: '',
-};
+// Ensure Meteor settings are defined (preserve existing values)
+(window as any).__meteor_runtime_config__ = {
+  ...((window as any).__meteor_runtime_config__ ?? {}),
+  ROOT_URL: (window as any).__meteor_runtime_config__?.ROOT_URL ?? 'http://localhost:3000',
+  ROOT_URL_PATH_PREFIX: (window as any).__meteor_runtime_config__?.ROOT_URL_PATH_PREFIX ?? '',
+};

Outside this hunk, consider adding a global type to avoid casts:

declare global {
  interface Window {
    __meteor_runtime_config__?: {
      ROOT_URL?: string;
      ROOT_URL_PATH_PREFIX?: string;
      [k: string]: unknown;
    };
  }
}
apps/meteor/client/sidebar/header/CreateTeam/CreateTeamModal.spec.tsx (1)

1-25: Solid story-driven smoke + a11y tests; add a couple of guardrails

  • Ensure jest-axe matchers are registered globally (expect.extend from 'jest-axe/extend-expect'); otherwise toHaveNoViolations will fail.
  • Snapshot of baseElement can be brittle due to dynamic ids; consider targeted assertions for key UI bits.
apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.spec.tsx (1)

1-5: Story-driven tests — LGTM; watch for minor flakiness and naming drift

  • Same note on jest-axe matcher registration and snapshot brittleness as above.
  • The stories file has a “CreateChanelModal” typo per repo patterns; verify story import names to avoid confusion in CI.

Also applies to: 7-7, 16-28

apps/meteor/client/sidebar/header/CreateTeam/CreateTeamModal.stories.tsx (2)

6-9: Provide default args for required props

CreateTeamModal requires onClose; setting a no-op avoids runtime issues in stories/tests.

 export default {
   title: 'views/sidebar/CreateTeamModal',
   component: CreateTeamModal,
+  args: {
+    onClose: () => undefined,
+  },
 } satisfies Meta<typeof CreateTeamModal>;

11-12: Mirror args on V2 story for consistency

Not strictly required, but keeping both stories consistent helps avoid future regressions.

-export const Default: StoryFn<typeof CreateTeamModal> = (args) => <CreateTeamModal {...args} />;
-export const DefaultVersion2: StoryFn<typeof CreateTeamModalV2> = (args) => <CreateTeamModalV2 {...args} />;
+export const Default: StoryFn<typeof CreateTeamModal> = (args) => <CreateTeamModal {...args} />;
+export const DefaultVersion2: StoryFn<typeof CreateTeamModalV2> = (args) => <CreateTeamModalV2 {...args} />;
+Default.args = { onClose: () => undefined };
+DefaultVersion2.args = { onClose: () => undefined };
apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.stories.tsx (2)

3-3: Fix “Channel” typo across import, meta, and story.

Consistently use “CreateChannelModal” to avoid confusion in Storybook navigation and search.

-import CreateChanelModal from './CreateChannelModal';
+import CreateChannelModal from './CreateChannelModal';
 export default {
-	title: 'views/sidebar/CreateChanelModal',
-	component: CreateChanelModal,
-} satisfies Meta<typeof CreateChanelModal>;
+	title: 'views/sidebar/CreateChannelModal',
+	component: CreateChannelModal,
+} satisfies Meta<typeof CreateChannelModal>;
-export const Default: StoryFn<typeof CreateChanelModal> = (args) => <CreateChanelModal {...args} />;
+export const Default: StoryFn<typeof CreateChannelModal> = (args) => <CreateChannelModal {...args} />;

Also applies to: 7-9, 11-11


4-4: Split V1 and V2 stories into separate Storybook Meta files

DefaultVersion2 renders CreateChannelModalV2 while this file's Meta/component is CreateChanelModal — don’t mix different components under one Meta (it skews docs/args typing). Move the V2 story to its own stories file (or give it a separate Meta).

  • Location: apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.stories.tsx
  • Quick removal (keep V2 in a separate file):
-import CreateChannelModalV2 from '../../../NavBarV2/NavBarPagesGroup/actions/CreateChannelModal';
...
-export const DefaultVersion2: StoryFn<typeof CreateChannelModalV2> = (args) => <CreateChannelModalV2 {...args} />;
  • Example new file:
// apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/CreateChannelModal.stories.tsx
import type { Meta, StoryFn } from '@storybook/react';
import CreateChannelModal from './CreateChannelModal';

export default {
  title: 'views/navbar-v2/CreateChannelModal',
  component: CreateChannelModal,
} satisfies Meta<typeof CreateChannelModal>;

export const Default: StoryFn<typeof CreateChannelModal> = (args) => <CreateChannelModal {...args} />;
  • Also fix the "CreateChanel" typo in the title/import to "CreateChannel".
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e82cfaa and 90ac92b.

⛔ Files ignored due to path filters (2)
  • apps/meteor/client/sidebar/header/CreateChannel/__snapshots__/CreateChannelModal.spec.tsx.snap is excluded by !**/*.snap
  • apps/meteor/client/sidebar/header/CreateTeam/__snapshots__/CreateTeamModal.spec.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (9)
  • apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/CreateChannelModal.tsx (1 hunks)
  • apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/CreateTeamModal.tsx (4 hunks)
  • apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.spec.tsx (1 hunks)
  • apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.stories.tsx (1 hunks)
  • apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx (1 hunks)
  • apps/meteor/client/sidebar/header/CreateTeam/CreateTeamModal.spec.tsx (1 hunks)
  • apps/meteor/client/sidebar/header/CreateTeam/CreateTeamModal.stories.tsx (1 hunks)
  • apps/meteor/client/sidebar/header/CreateTeam/CreateTeamModal.tsx (4 hunks)
  • apps/meteor/client/stories/contexts/RouterContextMock.tsx (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (6)
apps/meteor/client/sidebar/header/CreateTeam/CreateTeamModal.spec.tsx (1)
packages/mock-providers/src/index.ts (1)
  • mockAppRoot (3-3)
apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.spec.tsx (2)
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/testCreateChannelModal.tsx (1)
  • testCreateChannelModal (9-179)
packages/mock-providers/src/index.ts (1)
  • mockAppRoot (3-3)
apps/meteor/client/sidebar/header/CreateTeam/CreateTeamModal.stories.tsx (1)
apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.stories.tsx (2)
  • Default (11-11)
  • DefaultVersion2 (12-12)
apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/CreateTeamModal.tsx (1)
apps/meteor/app/utils/lib/i18n.ts (1)
  • t (6-6)
apps/meteor/client/sidebar/header/CreateTeam/CreateTeamModal.tsx (1)
apps/meteor/app/utils/lib/i18n.ts (1)
  • t (6-6)
apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.stories.tsx (1)
apps/meteor/client/sidebar/header/CreateTeam/CreateTeamModal.stories.tsx (2)
  • Default (11-11)
  • DefaultVersion2 (12-12)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: 🔨 Test Storybook / Test Storybook
  • GitHub Check: 🔎 Code Check / TypeScript
  • GitHub Check: 🔨 Test Unit / Unit Tests
  • GitHub Check: 🔎 Code Check / Code Lint
  • GitHub Check: 📦 Meteor Build - coverage
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🔇 Additional comments (5)
apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx (1)

313-314: FieldHint swap for encrypted hint — LGTM

Correct component, stable id, and aria-describedby wiring are preserved.

apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/CreateChannelModal.tsx (1)

317-317: FieldHint swap for encrypted hint — LGTM

Consistent with the rest of the modal; a11y refs intact.

apps/meteor/client/NavBarV2/NavBarPagesGroup/actions/CreateTeamModal.tsx (1)

243-246: Replace FieldDescription → FieldHint across hints — LGTM

Private, Encrypted, Read-only, and Broadcast hints now use FieldHint with correct ids and aria-describedby.

Also applies to: 272-272, 292-295, 313-314

apps/meteor/client/sidebar/header/CreateTeam/CreateTeamModal.tsx (1)

240-243: Replace FieldDescription → FieldHint across hints — LGTM

All four hints switched to FieldHint with stable ids and aria-describedby references.

Also applies to: 269-269, 289-292, 310-311

apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.stories.tsx (1)

1-2: Good use of satisfies for Meta typing.

Typing is precise and future-proof; no changes needed.

Also applies to: 9-9

MartinSchoeler
MartinSchoeler previously approved these changes Sep 11, 2025
@MartinSchoeler MartinSchoeler added the stat: QA assured Means it has been tested and approved by a company insider label Sep 11, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Sep 11, 2025
@kodiakhq kodiakhq bot merged commit a89f0e5 into develop Sep 11, 2025
117 of 127 checks passed
@kodiakhq kodiakhq bot deleted the chore/createModalHints branch September 11, 2025 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants