Skip to content

Xtdh groups#1642

Merged
analyticsflowee merged 3 commits intomainfrom
xtdh-groups
Dec 11, 2025
Merged

Xtdh groups#1642
analyticsflowee merged 3 commits intomainfrom
xtdh-groups

Conversation

@simo6529
Copy link
Copy Markdown
Collaborator

@simo6529 simo6529 commented Dec 11, 2025

Summary by CodeRabbit

  • New Features
    • Added support for multiple TDH inclusion strategy modes (TDH, xTDH, Both) when creating and managing groups.
    • Group creation flow now includes a mode selector to choose the preferred TDH strategy.
    • Group details dynamically display the selected inclusion strategy with updated labels.

✏️ Tip: You can customize this high-level summary in your review settings.

Signed-off-by: Simo <simo@6529.io>
Signed-off-by: Simo <simo@6529.io>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Dec 11, 2025

Walkthrough

The PR introduces support for multiple TDH (Trust Delegation Hash) inclusion strategies—TDH, xTDH, and Both—across group creation, configuration, and display components. A new ApiGroupTdhInclusionStrategy enum is added to the API schema and integrated into group creation flows, test fixtures, and UI components that display TDH configuration.

Changes

Cohort / File(s) Summary
Test data updates
__tests__/components/groups/page/create/actions/GroupCreateActions.test.tsx, __tests__/components/groups/page/create/actions/GroupCreateTest.test.tsx, __tests__/components/waves/specs/groups/group/edit/buttons/useWaveGroupEditButtonsController.test.tsx, __tests__/services/groups/groupMutations.test.ts
Updated test fixtures and payloads to include the new inclusion_strategy field in tdh objects; removed ts-expect-error comment in mock; extended payload constructions with additional public fields.
Group creation components
components/groups/page/create/GroupCreate.tsx, components/groups/page/create/config/GroupCreateTDH.tsx
Added inclusion_strategy field to group TDH configuration and import of ApiGroupTdhInclusionStrategy; introduced CommonTabs UI for switching between TDH modes with dynamic labels and descriptions based on selected strategy; adjusted loading state dependencies.
Group card/display components
components/groups/page/list/card/GroupCardConfig.tsx, components/groups/page/list/card/GroupCardConfigs.tsx
Extended GroupCardConfigProps with optional label property; implemented dynamic label derivation based on TDH inclusion_strategy (Tdh, xTDH, or TDH + xTDH); updated config object rendering to prefer explicit labels.
Wave service
components/waves/create-wave/services/waveGroupService.ts, components/waves/specs/groups/group/edit/buttons/hooks/useWaveGroupEditButtonsController.ts
Extended group TDH payloads to include inclusion_strategy: ApiGroupTdhInclusionStrategy.Tdh.
API schema
openapi.yaml
Added new ApiGroupTdhInclusionStrategy enum type with values TDH, XTDH, BOTH; updated ApiGroupTdhFilter to include inclusion_strategy as a required field; extended ApiRatingWithProfileInfoAndLevel with xtdh field.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

  • GroupCreateTDH.tsx: Tab-based mode switching logic and dynamic label/description generation warrant careful review to ensure correct strategy mapping and UI state management.
  • GroupCardConfigs.tsx: Label derivation logic for different inclusion strategies should be verified for correctness across all three modes (TDH, xTDH, Both).
  • GroupCreate.tsx: Changes to loading state dependencies (isFetching calculation and effect dependencies) should be reviewed to ensure correct behavior when fetching group data.
  • Test payloads: Verify all test fixtures correctly reflect the new field structure across different test scenarios.

Possibly related PRs

  • wip #1572: Modifies GroupCreate.tsx for wallet-related updates; may conflict or interact with this PR's loading state dependency changes.
  • Submissions image quality #1585: Introduces TDH-related API schema and enum model generation; foundational work for this PR's ApiGroupTdhInclusionStrategy usage.

Suggested reviewers

  • ragnep

Poem

🐰 Hops through the fields of TDH trust,
Three strategies now—because we must!
TDH, xTDH, and Both combined,
Inclusion modes carefully aligned,
Tab-switching magic, labels so bright—
Group trust weaving, configured just right!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title 'Xtdh groups' is too vague and generic; it uses a non-descriptive term that doesn't clearly convey the scope or purpose of the changes. Expand the title to clearly describe the main change, such as 'Add xTDH inclusion strategy support to group filtering' or 'Implement TDH/xTDH/Both inclusion modes for groups'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch xtdh-groups

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown

@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 (4)
components/groups/page/list/card/GroupCardConfigs.tsx (1)

60-79: TDH label derived from inclusion_strategy is correct and robust

getTdhConfig now computes a label from tdh.inclusion_strategy with sensible values ("Tdh", "xTDH", "TDH + xTDH") and includes it in the returned config, which matches how the card renderer now prefers config.label. As a minor optional tidy-up, you could express this as a small mapping instead of if/else chains:

-    let label = "Tdh";
-    if (tdh.inclusion_strategy === ApiGroupTdhInclusionStrategy.Xtdh) {
-      label = "xTDH";
-    } else if (tdh.inclusion_strategy === ApiGroupTdhInclusionStrategy.Both) {
-      label = "TDH + xTDH";
-    }
+    const inclusionStrategyLabelMap: Partial<Record<ApiGroupTdhInclusionStrategy, string>> = {
+      [ApiGroupTdhInclusionStrategy.Tdh]: "Tdh",
+      [ApiGroupTdhInclusionStrategy.Xtdh]: "xTDH",
+      [ApiGroupTdhInclusionStrategy.Both]: "TDH + xTDH",
+    };
+    const label = inclusionStrategyLabelMap[tdh.inclusion_strategy] ?? "Tdh";
__tests__/components/waves/specs/groups/group/edit/buttons/useWaveGroupEditButtonsController.test.tsx (1)

3-65: Test fixtures updated correctly; consider asserting inclusion_strategy in payload

Importing ApiGroupTdhInclusionStrategy and extending baseGroupFull.group.tdh with inclusion_strategy: ApiGroupTdhInclusionStrategy.Tdh keeps the fixture aligned with the new schema and the rest of the codebase.

To strengthen coverage, you could also assert that the controller preserves/sets this field when calling createGroup, for example in the first test:

-    const payloadArg = mockCreateGroup.mock.calls[0][0].payload;
-    expect(payloadArg.group.identity_addresses).toEqual(['0xabcd']);
+    const payloadArg = mockCreateGroup.mock.calls[0][0].payload;
+    expect(payloadArg.group.tdh.inclusion_strategy).toBe(ApiGroupTdhInclusionStrategy.Tdh);
+    expect(payloadArg.group.identity_addresses).toEqual(['0xabcd']);

This would catch any future regression where tdh.inclusion_strategy is dropped from the payload while still keeping the tests focused on identity behavior.

components/groups/page/create/config/GroupCreateTDH.tsx (1)

3-5: TDH/xTDH/Both UI wiring is solid; consider centralizing display labels

The enum-driven modes list, CommonTabs wiring, and setTDH calls correctly keep tdh.inclusion_strategy in sync with the UI, and the “Both” handling ("TDH + xTDH") is clear and consistent across heading, description, and numeric label.

One minor improvement: for the non‑Both cases you currently render tdh.inclusion_strategy directly, which surfaces the raw enum value (e.g. "XTDH") while the tab label uses "xTDH". To keep casing and wording consistent and avoid depending on enum string values, you could derive the display label from the modes array (or a small mapping) and reuse that for the heading, description, and numeric label.

Also applies to: 14-30, 35-61, 64-71

components/groups/page/create/GroupCreate.tsx (1)

11-11: GroupCreate TDH defaults and edit mapping look correct; consider centralizing the default

  • New groups get groupConfig.group.tdh.inclusion_strategy set to ApiGroupTdhInclusionStrategy.Tdh, and edited groups map originalGroup.group.tdh?.inclusion_strategy with a sane fallback to the same default. This keeps tdh.inclusion_strategy non‑null for the TDH UI and payload builders.
  • Extending isFetching to also depend on loadingOriginalGroupWallets and loadingOriginalGroupExcludedWallets ensures the “Loading...” state covers the wallet lookups as well, which is consistent with how the form uses those arrays.

As a small maintainability improvement, you now hard‑code .Tdh as the default inclusion strategy in several places (here, in the wave edit hook, in wave group creation helpers, and in tests). Consider extracting a shared DEFAULT_TDH_INCLUSION_STRATEGY constant (or helper that builds the default TDH filter) to keep these call sites in sync if the default ever changes.

Also applies to: 76-91, 93-120, 131-137

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3c6e5fd and b1259a3.

⛔ Files ignored due to path filters (5)
  • generated/models/ApiGroupTdhFilter.ts is excluded by !**/generated/**
  • generated/models/ApiGroupTdhInclusionStrategy.ts is excluded by !**/generated/**
  • generated/models/ApiRatingWithProfileInfoAndLevel.ts is excluded by !**/generated/**
  • generated/models/ObjectSerializer.ts is excluded by !**/generated/**
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (11)
  • __tests__/components/groups/page/create/actions/GroupCreateActions.test.tsx (2 hunks)
  • __tests__/components/groups/page/create/actions/GroupCreateTest.test.tsx (3 hunks)
  • __tests__/components/waves/specs/groups/group/edit/buttons/useWaveGroupEditButtonsController.test.tsx (2 hunks)
  • __tests__/services/groups/groupMutations.test.ts (5 hunks)
  • components/groups/page/create/GroupCreate.tsx (4 hunks)
  • components/groups/page/create/config/GroupCreateTDH.tsx (2 hunks)
  • components/groups/page/list/card/GroupCardConfig.tsx (1 hunks)
  • components/groups/page/list/card/GroupCardConfigs.tsx (3 hunks)
  • components/waves/create-wave/services/waveGroupService.ts (2 hunks)
  • components/waves/specs/groups/group/edit/buttons/hooks/useWaveGroupEditButtonsController.ts (2 hunks)
  • openapi.yaml (4 hunks)
🧰 Additional context used
📓 Path-based instructions (12)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx,js,jsx}: Do not include any comments in the code; it should be self-explanatory
Write correct, up-to-date, bug-free, fully componentized, secure, and efficient code
Include all required imports and ensure proper naming of key components
Use NextJS features that match the current version

**/*.{ts,tsx,js,jsx}: Replace <img> elements with <Image /> from next/image to satisfy @next/next/no-img-element ESLint rule
Use <Link href="/path"> from Next.js for internal navigation instead of plain HTML links to satisfy @next/next/no-html-link-for-pages ESLint rule

Files:

  • components/waves/create-wave/services/waveGroupService.ts
  • components/groups/page/list/card/GroupCardConfig.tsx
  • __tests__/components/waves/specs/groups/group/edit/buttons/useWaveGroupEditButtonsController.test.tsx
  • components/waves/specs/groups/group/edit/buttons/hooks/useWaveGroupEditButtonsController.ts
  • components/groups/page/create/config/GroupCreateTDH.tsx
  • __tests__/components/groups/page/create/actions/GroupCreateActions.test.tsx
  • __tests__/services/groups/groupMutations.test.ts
  • components/groups/page/list/card/GroupCardConfigs.tsx
  • __tests__/components/groups/page/create/actions/GroupCreateTest.test.tsx
  • components/groups/page/create/GroupCreate.tsx
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{js,jsx,ts,tsx}: Code must satisfy ESLint (Next's Core Web Vitals + React Hooks)
Use framework APIs: internal links should use <Link>, images should use next/image, and adopt Next's ESLint rules (Core Web Vitals)

**/*.{js,jsx,ts,tsx}: Code must satisfy ESLint (Next's Core Web Vitals + React Hooks rules)
Follow existing code style and naming conventions; maintain clean code standards (measured by SonarQube)

Files:

  • components/waves/create-wave/services/waveGroupService.ts
  • components/groups/page/list/card/GroupCardConfig.tsx
  • __tests__/components/waves/specs/groups/group/edit/buttons/useWaveGroupEditButtonsController.test.tsx
  • components/waves/specs/groups/group/edit/buttons/hooks/useWaveGroupEditButtonsController.ts
  • components/groups/page/create/config/GroupCreateTDH.tsx
  • __tests__/components/groups/page/create/actions/GroupCreateActions.test.tsx
  • __tests__/services/groups/groupMutations.test.ts
  • components/groups/page/list/card/GroupCardConfigs.tsx
  • __tests__/components/groups/page/create/actions/GroupCreateTest.test.tsx
  • components/groups/page/create/GroupCreate.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Must pass tsc --noEmit type checking
Prefer direct named imports for React hooks and types (import { useMemo, useRef, FC, etc. } from "react") over React. namespace usage (React.useMemo, React.useRef, etc.)
If the react-hooks/exhaustive-deps lint rule is triggered: if the Effect only derives state, remove the Effect and compute during render; if listening to an external system and needing fresh props/state, wrap non-reactive logic in useEffectEvent

**/*.{ts,tsx}: Must pass tsc --noEmit for TypeScript type checking
Prefer Server Components over Client Components; use Server Functions/Server Actions ('use server') for mutations
Remove unnecessary Effects; if Effect only derives state, compute during render instead
Use useEffectEvent for non-reactive logic inside Effects to avoid unnecessary re-runs
Use framework APIs: <Link> for internal links, next/image for images, adopt Next's ESLint rules
Use 'use cache' directive and Cache Components features for explicit opt-in caching in Next.js 16
Use TypeScript and React functional components with hooks
When parsing Seize URLs or similar, fail fast if base origin is unavailable; do not fall back to placeholder origins
Replace <img> elements with <Image /> from next/image
Use <Link href="/path"> for internal navigation instead of plain HTML links
Move data fetches to Server Components; handle mutations through Server Functions/Server Actions with 'use server' directive

Files:

  • components/waves/create-wave/services/waveGroupService.ts
  • components/groups/page/list/card/GroupCardConfig.tsx
  • __tests__/components/waves/specs/groups/group/edit/buttons/useWaveGroupEditButtonsController.test.tsx
  • components/waves/specs/groups/group/edit/buttons/hooks/useWaveGroupEditButtonsController.ts
  • components/groups/page/create/config/GroupCreateTDH.tsx
  • __tests__/components/groups/page/create/actions/GroupCreateActions.test.tsx
  • __tests__/services/groups/groupMutations.test.ts
  • components/groups/page/list/card/GroupCardConfigs.tsx
  • __tests__/components/groups/page/create/actions/GroupCreateTest.test.tsx
  • components/groups/page/create/GroupCreate.tsx
**/*.{tsx,jsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{tsx,jsx}: Use FontAwesome for icons in React components
Use TailwindCSS for styling in React components
Use react-query for data fetching
Always add readonly before props in React components

Files:

  • components/groups/page/list/card/GroupCardConfig.tsx
  • __tests__/components/waves/specs/groups/group/edit/buttons/useWaveGroupEditButtonsController.test.tsx
  • components/groups/page/create/config/GroupCreateTDH.tsx
  • __tests__/components/groups/page/create/actions/GroupCreateActions.test.tsx
  • components/groups/page/list/card/GroupCardConfigs.tsx
  • __tests__/components/groups/page/create/actions/GroupCreateTest.test.tsx
  • components/groups/page/create/GroupCreate.tsx
**/@(__tests__|*.test).{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Tests should live in __tests__/ or ComponentName.test.tsx; mock external dependencies and APIs in tests

Files:

  • __tests__/components/waves/specs/groups/group/edit/buttons/useWaveGroupEditButtonsController.test.tsx
  • __tests__/components/groups/page/create/actions/GroupCreateActions.test.tsx
  • __tests__/services/groups/groupMutations.test.ts
  • __tests__/components/groups/page/create/actions/GroupCreateTest.test.tsx
**/__tests__/**/*.{ts,tsx}

📄 CodeRabbit inference engine (GEMINI.md)

Place tests in __tests__/ directory or as ComponentName.test.tsx alongside components

Files:

  • __tests__/components/waves/specs/groups/group/edit/buttons/useWaveGroupEditButtonsController.test.tsx
  • __tests__/components/groups/page/create/actions/GroupCreateActions.test.tsx
  • __tests__/services/groups/groupMutations.test.ts
  • __tests__/components/groups/page/create/actions/GroupCreateTest.test.tsx
**/*.test.{ts,tsx}

📄 CodeRabbit inference engine (GEMINI.md)

Mock external dependencies and APIs in tests

Files:

  • __tests__/components/waves/specs/groups/group/edit/buttons/useWaveGroupEditButtonsController.test.tsx
  • __tests__/components/groups/page/create/actions/GroupCreateActions.test.tsx
  • __tests__/services/groups/groupMutations.test.ts
  • __tests__/components/groups/page/create/actions/GroupCreateTest.test.tsx
__tests__/**/*.test.{ts,tsx}

📄 CodeRabbit inference engine (tests/AGENTS.md)

Use Jest + ts-jest for TypeScript testing

Files:

  • __tests__/components/waves/specs/groups/group/edit/buttons/useWaveGroupEditButtonsController.test.tsx
  • __tests__/components/groups/page/create/actions/GroupCreateActions.test.tsx
  • __tests__/services/groups/groupMutations.test.ts
  • __tests__/components/groups/page/create/actions/GroupCreateTest.test.tsx
__tests__/**/*.{ts,tsx}

📄 CodeRabbit inference engine (tests/AGENTS.md)

Functions must have ≤ 15 cognitive complexity; extract deep ternaries (>3 levels) and break down complex logic

Files:

  • __tests__/components/waves/specs/groups/group/edit/buttons/useWaveGroupEditButtonsController.test.tsx
  • __tests__/components/groups/page/create/actions/GroupCreateActions.test.tsx
  • __tests__/services/groups/groupMutations.test.ts
  • __tests__/components/groups/page/create/actions/GroupCreateTest.test.tsx
__tests__/**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (tests/AGENTS.md)

__tests__/**/*.{ts,tsx,js}: Prefer for...of loops over forEach as it allows break/continue and works with async/await
Use array.at(-1) and array.at(-2) instead of index-based array access for negative indexing
Use String.prototype.replaceAll() instead of replace() for global string replacements
Use globalThis.fetch() instead of direct fetch() calls
Organize imports with one import per module in order: external → internal → types, with no duplicates
Use element.remove() instead of parent.removeChild(element) for DOM manipulation
Catch errors only when meaningful; no empty catch blocks; log errors with context
Avoid double negatives in code; prefer explicit logic and remove redundant annotations; use optional chaining (?.)

Files:

  • __tests__/components/waves/specs/groups/group/edit/buttons/useWaveGroupEditButtonsController.test.tsx
  • __tests__/components/groups/page/create/actions/GroupCreateActions.test.tsx
  • __tests__/services/groups/groupMutations.test.ts
  • __tests__/components/groups/page/create/actions/GroupCreateTest.test.tsx
__tests__/**/{components,contexts,hooks}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (tests/AGENTS.md)

Use semantic HTML elements (<label>, <output>) over ARIA attributes when possible; every form control must have a label

Files:

  • __tests__/components/waves/specs/groups/group/edit/buttons/useWaveGroupEditButtonsController.test.tsx
  • __tests__/components/groups/page/create/actions/GroupCreateActions.test.tsx
  • __tests__/components/groups/page/create/actions/GroupCreateTest.test.tsx
{.env*,*.env,**/config/**}

📄 CodeRabbit inference engine (.cursor/rules/dev_workflow.mdc)

Configure Task Master behavior via environment variables: ANTHROPIC_API_KEY (required), MODEL, MAX_TOKENS, TEMPERATURE, DEBUG, LOG_LEVEL, DEFAULT_SUBTASKS, DEFAULT_PRIORITY, PROJECT_NAME, PROJECT_VERSION, PERPLEXITY_API_KEY, and PERPLEXITY_MODEL

Files:

  • components/groups/page/create/config/GroupCreateTDH.tsx
🧠 Learnings (13)
📚 Learning: 2025-12-05T10:55:43.476Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-12-05T10:55:43.476Z
Learning: Applies to __tests__/app/api/**/__tests__/**/*.test.{ts,tsx,js} : API integration tests should be located in `app/api`

Applied to files:

  • __tests__/components/waves/specs/groups/group/edit/buttons/useWaveGroupEditButtonsController.test.tsx
  • __tests__/components/groups/page/create/actions/GroupCreateActions.test.tsx
  • __tests__/services/groups/groupMutations.test.ts
  • __tests__/components/groups/page/create/actions/GroupCreateTest.test.tsx
📚 Learning: 2025-12-05T10:55:43.476Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-12-05T10:55:43.476Z
Learning: Applies to __tests__/**/__tests__/**/components/**/*.test.{ts,tsx} : Use testing-library/react + user-event for React component tests

Applied to files:

  • __tests__/components/waves/specs/groups/group/edit/buttons/useWaveGroupEditButtonsController.test.tsx
  • __tests__/components/groups/page/create/actions/GroupCreateActions.test.tsx
  • __tests__/components/groups/page/create/actions/GroupCreateTest.test.tsx
📚 Learning: 2025-12-05T10:55:30.871Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: GEMINI.md:0-0
Timestamp: 2025-12-05T10:55:30.871Z
Learning: Applies to **/*.{ts,tsx} : Use TypeScript and React functional components with hooks

Applied to files:

  • __tests__/components/waves/specs/groups/group/edit/buttons/useWaveGroupEditButtonsController.test.tsx
📚 Learning: 2025-12-05T10:55:43.476Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-12-05T10:55:43.476Z
Learning: Applies to __tests__/**/__tests__/**/*.test.{ts,tsx,js} : Keep tests independent, deterministic, and fast with production-like data

Applied to files:

  • __tests__/components/groups/page/create/actions/GroupCreateActions.test.tsx
  • __tests__/components/groups/page/create/actions/GroupCreateTest.test.tsx
📚 Learning: 2025-12-05T10:55:43.476Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-12-05T10:55:43.476Z
Learning: Applies to __tests__/**/*.{ts,tsx,js} : Organize imports with one import per module in order: external → internal → types, with no duplicates

Applied to files:

  • __tests__/components/groups/page/create/actions/GroupCreateActions.test.tsx
  • __tests__/components/groups/page/create/actions/GroupCreateTest.test.tsx
📚 Learning: 2025-12-05T10:55:30.871Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: GEMINI.md:0-0
Timestamp: 2025-12-05T10:55:30.871Z
Learning: Applies to **/*.test.{ts,tsx} : Mock external dependencies and APIs in tests

Applied to files:

  • __tests__/components/groups/page/create/actions/GroupCreateTest.test.tsx
📚 Learning: 2025-12-03T14:52:34.271Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-03T14:52:34.271Z
Learning: Applies to **/@(__tests__|*.test).{ts,tsx} : Tests should live in `__tests__/` or `ComponentName.test.tsx`; mock external dependencies and APIs in tests

Applied to files:

  • __tests__/components/groups/page/create/actions/GroupCreateTest.test.tsx
📚 Learning: 2025-12-05T10:55:43.476Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-12-05T10:55:43.476Z
Learning: Applies to __tests__/**/*.{ts,tsx,js} : Avoid double negatives in code; prefer explicit logic and remove redundant annotations; use optional chaining (`?.`)

Applied to files:

  • __tests__/components/groups/page/create/actions/GroupCreateTest.test.tsx
📚 Learning: 2025-12-05T10:55:43.476Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-12-05T10:55:43.476Z
Learning: Applies to __tests__/**/__tests__/**/*.test.{ts,tsx,js} : Test high-risk areas including happy path workflows, invalid input errors, edge cases/boundaries, component & API interactions, and performance/security when relevant

Applied to files:

  • __tests__/components/groups/page/create/actions/GroupCreateTest.test.tsx
📚 Learning: 2025-12-05T10:55:30.871Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: GEMINI.md:0-0
Timestamp: 2025-12-05T10:55:30.871Z
Learning: Applies to **/__tests__/**/*.{ts,tsx} : Place tests in `__tests__/` directory or as `ComponentName.test.tsx` alongside components

Applied to files:

  • __tests__/components/groups/page/create/actions/GroupCreateTest.test.tsx
📚 Learning: 2025-11-25T08:35:58.729Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T08:35:58.729Z
Learning: Applies to **/*.{tsx,jsx} : Use react-query for data fetching

Applied to files:

  • __tests__/components/groups/page/create/actions/GroupCreateTest.test.tsx
📚 Learning: 2025-12-05T10:55:43.476Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-12-05T10:55:43.476Z
Learning: Applies to __tests__/**/*.{ts,tsx,js} : Use `globalThis.fetch()` instead of direct `fetch()` calls

Applied to files:

  • __tests__/components/groups/page/create/actions/GroupCreateTest.test.tsx
📚 Learning: 2025-12-05T10:55:43.476Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-12-05T10:55:43.476Z
Learning: Applies to __tests__/**/*.test.{ts,tsx} : Use Jest + `ts-jest` for TypeScript testing

Applied to files:

  • __tests__/components/groups/page/create/actions/GroupCreateTest.test.tsx
🧬 Code graph analysis (1)
components/groups/page/create/config/GroupCreateTDH.tsx (3)
components/utils/select/CommonSelect.tsx (1)
  • CommonSelectItem (11-18)
components/utils/select/tabs/CommonTabs.tsx (1)
  • CommonTabs (7-174)
components/groups/page/create/config/common/GroupCreateNumericValue.tsx (1)
  • GroupCreateNumericValue (1-47)
🔇 Additional comments (10)
components/waves/create-wave/services/waveGroupService.ts (1)

3-32: TDH inclusion strategy correctly added to admin-group creation payload

Importing ApiGroupTdhInclusionStrategy and setting tdh.inclusion_strategy to ApiGroupTdhInclusionStrategy.Tdh in createOnlyMeGroup keeps the payload in sync with the updated ApiGroupTdhFilter schema and provides a sensible default for admin groups.

components/groups/page/list/card/GroupCardConfig.tsx (1)

18-22: Config label override with safe fallback looks good

Using config.label ?? configLabel[config.key] cleanly supports custom labels from callers while preserving the existing per-key default label behavior.

openapi.yaml (2)

5441-5464: ApiGroupTdhFilter / ApiGroupTdhInclusionStrategy schema alignment

Adding inclusion_strategy to ApiGroupTdhFilter (and making it required) plus the new ApiGroupTdhInclusionStrategy enum matches how the frontend now constructs TDH filters and derives labels from TDH | XTDH | BOTH. Ensure server implementations and any non-TS clients are updated in lockstep with this contract change.


6401-6427: xtdh added to ApiRatingWithProfileInfoAndLevel

Extending ApiRatingWithProfileInfoAndLevel to require xtdh and defining it as number with float format is consistent with other xTDH exposure in the API. Just confirm that all endpoints populating this schema now always set xtdh to avoid breaking existing consumers expecting the previous shape.

components/groups/page/list/card/GroupCardConfigs.tsx (2)

8-15: Config props/interface correctly extended with optional label

Importing ApiGroupTdhInclusionStrategy and extending GroupCardConfigProps with an optional label?: string keeps this component aligned with upstream config builders while remaining backward compatible for existing callers that don’t pass a label.


46-58: Identity display string remains clear and stable

The multi-line template string in getIdentityValue still yields readable values like "from identity: 0x..." or "identity: 0x..." when direction is absent, without introducing extra whitespace artifacts.

components/waves/specs/groups/group/edit/buttons/hooks/useWaveGroupEditButtonsController.ts (1)

18-18: TDH inclusion_strategy default is wired correctly into new group payloads

Importing ApiGroupTdhInclusionStrategy and defaulting createEmptyGroupPayload().group.tdh.inclusion_strategy to ApiGroupTdhInclusionStrategy.Tdh aligns with the updated schema and keeps cloneGroupPayload behavior intact for existing groups. No issues found here.

Also applies to: 119-142

__tests__/components/groups/page/create/actions/GroupCreateTest.test.tsx (1)

2-3: Test groupConfig updated to reflect TDH inclusion_strategy enum

The added ApiGroupTdhInclusionStrategy import and the extended tdh config (min, max, and inclusion_strategy: ApiGroupTdhInclusionStrategy.Tdh) keep the test payload aligned with the new API shape and avoid hard-coded strings. The React Query mock remains sufficient for these assertions.

Also applies to: 20-30, 32-43

__tests__/components/groups/page/create/actions/GroupCreateActions.test.tsx (1)

3-4: Default test group now matches extended TDH shape

Importing ApiGroupTdhInclusionStrategy and initializing defaultGroup.group.tdh with min, max, and inclusion_strategy: ApiGroupTdhInclusionStrategy.Tdh keeps the test payload consistent with the updated group model used by GroupCreateActions. No issues detected.

Also applies to: 26-37

__tests__/services/groups/groupMutations.test.ts (1)

6-25: createPayload helper aligned with new TDH inclusion_strategy

The createPayload factory now seeds group.tdh with min, max, and inclusion_strategy: ApiGroupTdhInclusionStrategy.Tdh, which is consistent with the new API shape and other defaults. The tests that pass group overrides via as any still correctly rely on createPayload to provide TDH defaults, so validation coverage remains accurate.

Also applies to: 35-41, 53-60, 66-74, 80-88

@analyticsflowee analyticsflowee merged commit a4d8ab7 into main Dec 11, 2025
9 checks passed
@analyticsflowee analyticsflowee deleted the xtdh-groups branch December 11, 2025 14:53
@coderabbitai coderabbitai Bot mentioned this pull request Jan 8, 2026
@coderabbitai coderabbitai Bot mentioned this pull request Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants