Skip to content

Disable chat fix#1641

Merged
simo6529 merged 4 commits intomainfrom
disable-chat-fix
Dec 11, 2025
Merged

Disable chat fix#1641
simo6529 merged 4 commits intomainfrom
disable-chat-fix

Conversation

@simo6529
Copy link
Copy Markdown
Collaborator

@simo6529 simo6529 commented Dec 11, 2025

Summary by CodeRabbit

  • Bug Fixes

    • Improved handling of closed waves: users now see a clear "Wave is closed" message instead of an empty editor.
  • Realtime / UX

    • Enhanced typing indicators for more responsive and reliable on-type feedback.
  • UI Updates

    • Updated leaderboard timeline header copy to clarify winners and upcoming season messaging.
    • Minor visual/formatting polish for improved readability.

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

…nge some season ending text to more general

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

Added a chat-closed early-return to CreateDropContent, refactored typing/typing-throttle wiring and effect dependencies, removed some memoization, and updated seasonal copy and icon usage in TimelineToggleHeader; plus minor formatting changes.

Changes

Cohort / File(s) Change Summary
Wave Chat State Guard
components/waves/CreateDropContent.tsx
Renders an early "Wave is closed" message and returns when the wave is a Chat type and chat is disabled, preventing the editor UI from rendering.
Throttling & Typing Notification
components/waves/CreateDropContent.tsx
Introduced a dedicated sendTyping callback, wired a throttled onType (throttle depends on sendTyping), and replaced inline send calls with the throttled handler.
Effect & Dependency Adjustments
components/waves/CreateDropContent.tsx
Updated useEffect dependencies to include the new throttle/handler so effects re-run appropriately (e.g., effects reacting to markdown/typing).
Computation Simplification
components/waves/CreateDropContent.tsx
Removed memoization for canSubmit/canAddPart in favor of direct evaluations (no behavioral change).
Formatting & Minor Data Construction
components/waves/CreateDropContent.tsx
Non-functional whitespace/line-break changes and slight reformatting around newParts/markdown transformer construction.
Seasonal Messaging & Icon Use
components/waves/leaderboard/time/TimelineToggleHeader.tsx
Updated header text ("Congrats to last SZN winners!", "Next SZN starts:"), replaced inline SVG with FontAwesomeIcon using faChevronDown, and switched component signature to FC<TimelineToggleHeaderProps>.
UI/JSX Formatting
components/waves/leaderboard/time/TimelineToggleHeader.tsx
Minor JSX/className reflow and spacing adjustments (no significant behavior change).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Areas to inspect:
    • throttle/onType/sendTyping wiring and updated effect dependencies in CreateDropContent.tsx for unintended re-runs or missed cleanup
    • Early-return guard for closed chats to confirm it doesn't suppress error messages or other intended UI flows
    • Removal of useMemo for canSubmit/canAddPart for potential render/performance implications
    • New FontAwesomeIcon import and FC signature change in TimelineToggleHeader.tsx

Suggested reviewers

  • ragnep
  • prxt6529

Poem

🐰 I hopped through code with eager paws,
Closed chats now hush their little laws,
Throttles whisper as I type away,
Seasons renamed to greet the day.
Hop, hop, hooray — the changes stay! 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Disable chat fix' is vague and generic. While it references the main chat-disabled guard added to CreateDropContent.tsx, it lacks specificity about what the fix actually accomplishes or the full scope of changes, which also include UI updates to TimelineToggleHeader.tsx. Consider a more descriptive title that clarifies the specific fix, such as 'Add chat-closed guard to wave editor and update timeline UI' or 'Prevent wave editor rendering when chat is disabled'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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 disable-chat-fix

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c2cf1c4 and 16d59d7.

📒 Files selected for processing (1)
  • components/waves/CreateDropContent.tsx (8 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • components/waves/CreateDropContent.tsx
⏰ 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). (1)
  • GitHub Check: Analyze (javascript-typescript)

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.

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 (3)
components/waves/leaderboard/time/TimelineToggleHeader.tsx (1)

81-113: Header/icon template string changes are safe; consider optional React/icon cleanups

The rewrapped className template literals for the header label and chevron icon keep the same Tailwind classes and isOpen-based rotation, so behavior is unchanged and still accessible via the aria-label.

You might later:

  • Switch to named React imports and FC (import type { FC } from "react";) to align with the preferred style over React.FC.
  • Replace the inline SVG with a FontAwesome chevron icon to match the “use FontAwesome for icons” guideline.
  • Remove JSX comments like {/* Title */} if you want stricter adherence to the “no comments in code” rule.
    (Based on learnings, these are non-blocking and can be deferred.)
components/waves/CreateDropContent.tsx (2)

483-493: Consider using useEffectEvent for stable throttle identity.

The current implementation recreates the throttle when send or wave.id changes. While functionally correct, React 19.2's useEffectEvent could optimize this by keeping a stable throttle while accessing the latest send and wave.id:

+const onType = useEffectEvent(() => {
+  send(WsMessageType.USER_IS_TYPING, { wave_id: wave.id });
+});
+
 const throttleHandle = useMemo(() => {
-  return throttle(() => {
-    send(WsMessageType.USER_IS_TYPING, { wave_id: wave.id });
-  }, 4000);
-}, [send, wave.id]);
+  return throttle(onType, 4000);
+}, []);

This prevents throttle timer resets if send changes unexpectedly.

Based on learnings, prefer refactors aligned with React 19.2 conventions.


974-983: Optional: setIsStormMode is stable and unnecessary in deps.

The setIsStormMode function from useState is stable and doesn't require inclusion in the dependency array. While harmless, removing it follows React best practices:

-}, [drop, setIsStormMode]);
+}, [drop]);
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 892c581 and 4428719.

📒 Files selected for processing (2)
  • components/waves/CreateDropContent.tsx (9 hunks)
  • components/waves/leaderboard/time/TimelineToggleHeader.tsx (3 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{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/CreateDropContent.tsx
  • components/waves/leaderboard/time/TimelineToggleHeader.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/waves/CreateDropContent.tsx
  • components/waves/leaderboard/time/TimelineToggleHeader.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/CreateDropContent.tsx
  • components/waves/leaderboard/time/TimelineToggleHeader.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/CreateDropContent.tsx
  • components/waves/leaderboard/time/TimelineToggleHeader.tsx
🧠 Learnings (1)
📚 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: Fix with modernization (no `// eslint-disable` unless explicitly instructed); prefer refactors aligned with React 19.2, React Compiler, and Next.js 16 conventions

Applied to files:

  • components/waves/CreateDropContent.tsx
  • components/waves/leaderboard/time/TimelineToggleHeader.tsx
🧬 Code graph analysis (1)
components/waves/CreateDropContent.tsx (5)
components/drops/create/lexical/transformers/markdownTransformers.ts (1)
  • SAFE_MARKDOWN_TRANSFORMERS (42-42)
components/drops/create/lexical/transformers/MentionTransformer.ts (1)
  • MENTION_TRANSFORMER (4-32)
components/drops/create/lexical/transformers/HastagTransformer.ts (1)
  • HASHTAG_TRANSFORMER (4-32)
components/drops/create/lexical/transformers/ImageTransformer.ts (1)
  • IMAGE_TRANSFORMER (4-22)
components/drops/create/lexical/transformers/EmojiTransformer.ts (1)
  • EMOJI_TRANSFORMER (6-27)
⏰ 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). (1)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (3)
components/waves/leaderboard/time/TimelineToggleHeader.tsx (1)

35-58: Status banner text and date formatting look correct

The updated copy (“Congrats to last SZN winners!” / “Next SZN starts: …”) and the reflowed toLocaleDateString options preserve existing behavior; the paused-state banner logic and fallback to currentPause.end_time remain sound. Just ensure the new wording matches product copy expectations across the app.

If you want, you can quickly grep for similar SZN messaging to confirm consistency with other components.

components/waves/CreateDropContent.tsx (2)

525-526: LGTM! Removing useMemo aligns with React 19.2 best practices.

Computing these boolean values directly on each render is appropriate. The operations are inexpensive, and the React Compiler can optimize this automatically. This modernization avoids premature optimization.

Based on learnings, prefer refactors aligned with React 19.2 conventions.


1047-1055: LGTM! Clean implementation of the closed chat guard.

The guard correctly:

  • Checks wave type and enabled status
  • Returns after all hooks are invoked (satisfies Rules of Hooks)
  • Provides clear user feedback

Signed-off-by: Simo <simo@6529.io>
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/waves/leaderboard/time/TimelineToggleHeader.tsx (2)

39-60: Paused-state copy and date formatting changes are consistent

The updated copy (“Congrats to last SZN winners!” / “Next SZN starts:”) and the unified toLocaleDateString month/day formatting for both mintingDate and currentPause.end_time keep the behavior clear and consistent, with no new edge-case risk introduced.


88-96: Header label styling and chevron toggle behavior are solid

The conditional label styling via hasNextDecision and the FontAwesome chevron rotation driven by isOpen both behave as expected, and the button retains an appropriate aria-label. If you later revisit interaction semantics, you might optionally move the toggle handler from the container div to the button for a more conventional pattern, but it’s not required for correctness here.

Also applies to: 100-107

components/waves/CreateDropContent.tsx (2)

851-869: Missing‑requirements derivation could drop state/effect entirely

missingRequirements is fully derived from isDropMode, metadata, files, and wave.participation.required_media, so you can avoid the extra useMemo + useEffect + useState and compute it during render:

-  const getMissingRequirementsResult = useMemo(() => {
-    return () =>
-      getMissingRequirements(
-        isDropMode,
-        metadata,
-        files,
-        wave.participation.required_media
-      );
-  }, [metadata, files, wave.participation.required_media, isDropMode]);
-
-  const [missingRequirements, setMissingRequirements] =
-    useState<MissingRequirements>({
-      metadata: [],
-      media: [],
-    });
-
-  useEffect(() => {
-    setMissingRequirements(getMissingRequirementsResult());
-  }, [metadata, files, getMissingRequirementsResult]);
+  const missingRequirements: MissingRequirements = useMemo(
+    () =>
+      getMissingRequirements(
+        isDropMode,
+        metadata,
+        files,
+        wave.participation.required_media
+      ),
+    [isDropMode, metadata, files, wave.participation.required_media]
+  );

This aligns with the guideline that effects should not be used just to derive state. As per coding guidelines and learnings, this is a good follow‑up refactor, not a blocker.


484-497: Good use of useEffectEvent + throttle; consider cancelling throttle on unmount

Using useEffectEvent for onType and feeding it into a single throttled function is a solid pattern and avoids stale closures. One improvement: call throttleHandle.cancel() in a cleanup effect so that pending timers don't fire after unmount.

For example:

-  const throttleHandle = useMemo(() => {
-    return throttle(onType, 4000);
-  }, []);
-
-  useEffect(() => {
-    if (getMarkdown?.length) {
-      throttleHandle();
-    }
-  }, [getMarkdown, throttleHandle]);
+  const throttleHandle = useMemo(() => throttle(onType, 4000), []);
+
+  useEffect(() => {
+    if (getMarkdown?.length) {
+      throttleHandle();
+    }
+    return () => {
+      throttleHandle.cancel();
+    };
+  }, [getMarkdown, throttleHandle]);

This prevents late "user is typing" messages after the composer unmounts, while preserving the existing behavior.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4428719 and c2cf1c4.

📒 Files selected for processing (2)
  • components/waves/CreateDropContent.tsx (9 hunks)
  • components/waves/leaderboard/time/TimelineToggleHeader.tsx (4 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{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/CreateDropContent.tsx
  • components/waves/leaderboard/time/TimelineToggleHeader.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/waves/CreateDropContent.tsx
  • components/waves/leaderboard/time/TimelineToggleHeader.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/CreateDropContent.tsx
  • components/waves/leaderboard/time/TimelineToggleHeader.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/CreateDropContent.tsx
  • components/waves/leaderboard/time/TimelineToggleHeader.tsx
🧠 Learnings (8)
📚 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: Fix with modernization (no `// eslint-disable` unless explicitly instructed); prefer refactors aligned with React 19.2, React Compiler, and Next.js 16 conventions

Applied to files:

  • components/waves/CreateDropContent.tsx
  • components/waves/leaderboard/time/TimelineToggleHeader.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 `useEffectEvent` for non-reactive logic inside Effects to avoid unnecessary re-runs

Applied to files:

  • components/waves/CreateDropContent.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 **/*.{ts,tsx} : 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`

Applied to files:

  • components/waves/CreateDropContent.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: Effects are a last resort; if there's no external system, remove the Effect and compute during render; if listening to external events but needing the latest props/state without re-running the Effect, use `useEffectEvent`

Applied to files:

  • components/waves/CreateDropContent.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 **/*.{ts,tsx} : 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.)

Applied to files:

  • components/waves/CreateDropContent.tsx
  • components/waves/leaderboard/time/TimelineToggleHeader.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:

  • components/waves/CreateDropContent.tsx
  • components/waves/leaderboard/time/TimelineToggleHeader.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 FontAwesome for icons in React components

Applied to files:

  • components/waves/leaderboard/time/TimelineToggleHeader.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: TypeScript + React functional components with hooks; follow existing code style and naming conventions; maintain clean code standards (measured by SonarQube)

Applied to files:

  • components/waves/leaderboard/time/TimelineToggleHeader.tsx
🧬 Code graph analysis (1)
components/waves/CreateDropContent.tsx (5)
components/drops/create/lexical/transformers/markdownTransformers.ts (1)
  • SAFE_MARKDOWN_TRANSFORMERS (42-42)
components/drops/create/lexical/transformers/MentionTransformer.ts (1)
  • MENTION_TRANSFORMER (4-32)
components/drops/create/lexical/transformers/HastagTransformer.ts (1)
  • HASHTAG_TRANSFORMER (4-32)
components/drops/create/lexical/transformers/ImageTransformer.ts (1)
  • IMAGE_TRANSFORMER (4-22)
components/drops/create/lexical/transformers/EmojiTransformer.ts (1)
  • EMOJI_TRANSFORMER (6-27)
⏰ 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). (1)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (8)
components/waves/leaderboard/time/TimelineToggleHeader.tsx (1)

3-5: React FC typing and FontAwesome imports look correct

Using a named FC import and wiring TimelineToggleHeader as FC<TimelineToggleHeaderProps> matches the React 19 / TS patterns, and the FontAwesome imports for the chevron icon align with the repo’s “use FontAwesome for icons” convention. Based on learnings, this is consistent with the project’s React and icon usage preferences.

Also applies to: 22-29

components/waves/CreateDropContent.tsx (7)

10-14: Importing useEffectEvent for downstream usage looks correct

The added useEffectEvent import matches its usage in the typing indicator logic below; no issues here.


470-482: Markdown transformer composition is clear and consistent

Building the transformer list from SAFE_MARKDOWN_TRANSFORMERS plus the explicit mention/hashtag/image/emoji transformers keeps export behavior centralized and readable; the call site remains type‑safe.


506-529: Computing canSubmit/canAddPart directly is a good simplification

Deriving canSubmit and canAddPart via plain function calls instead of extra useMemo hooks reduces complexity and keeps render‑time logic straightforward without affecting behavior.


612-637: createCurrentDrop part construction remains correct and more readable

The newParts ternary cleanly handles “existing parts but no current content” versus appending a new part for current markdown/files. The logic is consistent with hasPartsInDrop/hasCurrentContent and should behave as before.


871-891: Verify new onDrop behavior with existing parts + current content

The new logic:

  • If there are existing parts (drop?.parts.length > 0) and current content (getMarkdown or files), onDrop now only calls finalizeAndAddDropPart() and returns.
  • The actual submit path (prepareAndSubmitDrop(getUpdatedDrop())) will then occur on a subsequent onDrop call once the current content has been cleared.

Previously, a single onDrop might both incorporate the current content into parts and submit in one go. This change could require two actions (add part, then submit) in that scenario. Please confirm that this matches the intended UX for storm/multi‑part flows and doesn’t regress the common “add last part and send” path.


977-987: Effect dependency update for storm mode reset is correct

Including setIsStormMode in the dependency array is consistent with react-hooks/exhaustive-deps, and the logic still reliably resets storm mode whenever drop is cleared or has no parts.


1050-1058: Chat‑closed guard cleanly disables the composer

The isChatClosed check based on wave.wave.type === ApiWaveType.Chat && !wave.chat.enabled and early return with a simple status message is a straightforward way to prevent composing when chat is disabled, without affecting non‑chat waves.

Please double‑check that wave.chat.enabled is the correct flag for “chat is globally closed” (as opposed to per‑user eligibility) and that this matches backend semantics for disabled chat waves.

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

@simo6529 simo6529 merged commit 9c05e13 into main Dec 11, 2025
8 checks passed
@simo6529 simo6529 deleted the disable-chat-fix branch December 11, 2025 13:00
@coderabbitai coderabbitai Bot mentioned this pull request Dec 16, 2025
@coderabbitai coderabbitai Bot mentioned this pull request Apr 7, 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.

2 participants