Skip to content

Conversation

@JounQin
Copy link
Member

@JounQin JounQin commented Dec 19, 2025

close DOC-92

Summary by CodeRabbit

  • Bug Fixes

    • Fixed assistant style compatibility issues affecting layout and rendering.
  • Style

    • Updated styling to use CSS variables for improved consistency.
    • Adjusted container sizing calculations for better responsive behavior.

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

Copilot AI review requested due to automatic review settings December 19, 2025 07:11
@changeset-bot
Copy link

changeset-bot bot commented Dec 19, 2025

🦋 Changeset detected

Latest commit: 777e976

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@alauda/doom Patch

Not sure what this means? Click here to learn what changesets are.

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

@coderabbitai
Copy link

coderabbitai bot commented Dec 19, 2025

Walkthrough

Patch release for @alauda/doom addressing assistant style compatibility. Changes include updating the document title scheduling mechanism in SiteOverrides from requestAnimationFrame to setTimeout with cleanup, and refactoring ai-assistant styles to use CSS variables and adjust sizing calculations.

Changes

Cohort / File(s) Summary
Release metadata
.changeset/two-rabbits-taste.md
Added changeset documenting patch version bump for @alauda/doom with "assistant style compatibility" fix note.
Component effect timing
packages/doom/src/global/SiteOverrides/index.tsx
Replaced requestAnimationFrame with setTimeout (1ms delay) for scheduling document.title update; added cleanup function to clear timeout on unmount/update.
Style refactoring
packages/doom/styles/ai-assistant.module.scss
Replaced hardcoded z-index value with CSS variable --rp-z-index-nav; simplified width calculation by removing calc() wrapper; adjusted height calculation to subtract 2rem and use nested calc().

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Review timing change rationale in SiteOverrides effect (setTimeout vs. requestAnimationFrame trade-offs)
  • Verify cleanup function properly cancels timeout to prevent memory leaks
  • Confirm CSS variable --rp-z-index-nav is defined in the design system

Possibly related PRs

Suggested labels

bug

Poem

🐰 The assistant's style shines bright,
With variables set just right,
Timeouts flush the title true,
Cleanup keeps the DOM anew,
One millisecond, perfectly timed flight!

Pre-merge checks and finishing touches

✅ 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 'fix: assistant style compatibility' directly aligns with the changeset and code modifications, which focus on updating assistant styling across CSS and React components.
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 fix/styling

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.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 19, 2025

Open in StackBlitz

yarn add https://pkg.pr.new/@alauda/doom@225.tgz
yarn add https://pkg.pr.new/@alauda/doom-export@225.tgz

commit: 777e976

Signed-off-by: JounQin <admin@1stg.me>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the AI assistant component's styling and robustness by updating CSS properties for better compatibility and adding proper cleanup to side effects.

  • Updated z-index to use a CSS variable for better maintainability
  • Simplified CSS functions and improved height calculation to account for fixed positioning
  • Added cleanup function to prevent memory leaks when setting document title

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
packages/doom/styles/ai-assistant.module.scss Updated z-index to use CSS variable, simplified width calculation, and improved height calculation to account for spacing
packages/doom/src/global/SiteOverrides/index.tsx Replaced requestAnimationFrame with setTimeout and added cleanup function to prevent memory leaks

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@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 (1)
packages/doom/src/global/SiteOverrides/index.tsx (1)

92-94: Consider aligning the scheduling approach or add cleanup.

This still uses requestAnimationFrame while the document.title update (lines 71-77) was changed to setTimeout. This creates an inconsistency in scheduling approach.

Additionally, there's no cleanup function to cancel the pending RAF if the component unmounts or logoText changes before execution.

🔎 Suggested fix to align with setTimeout approach and add cleanup
-    requestAnimationFrame(() => {
+    const timeoutId = setTimeout(() => {
       setNavBarSpans(logoText)
-    })
+    }, 1)
+
+    return () => {
+      clearTimeout(timeoutId)
+    }
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ed201b0 and 777e976.

📒 Files selected for processing (3)
  • .changeset/two-rabbits-taste.md (1 hunks)
  • packages/doom/src/global/SiteOverrides/index.tsx (1 hunks)
  • packages/doom/styles/ai-assistant.module.scss (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{js,ts,tsx,jsx,json,yml,yaml,md}

📄 CodeRabbit inference engine (AGENTS.md)

Format code with Prettier according to the project's Prettier configuration

Files:

  • packages/doom/src/global/SiteOverrides/index.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript strict mode for type safety

Files:

  • packages/doom/src/global/SiteOverrides/index.tsx
**/*.{js,ts,tsx,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Follow ESLint rules defined in eslint.config.js

Files:

  • packages/doom/src/global/SiteOverrides/index.tsx
🧠 Learnings (2)
📚 Learning: 2025-05-26T09:09:21.339Z
Learnt from: JounQin
Repo: alauda/doom PR: 30
File: src/runtime/components/K8sCrd.tsx:5-5
Timestamp: 2025-05-26T09:09:21.339Z
Learning: The alauda/doom project uses yarn v4 for dependency management, which handles package exports and module resolution correctly, so imports like `rspress/core/theme` work without any ESLint errors.

Applied to files:

  • .changeset/two-rabbits-taste.md
📚 Learning: 2025-06-09T03:10:41.010Z
Learnt from: JounQin
Repo: alauda/doom PR: 75
File: src/cli/load-config.ts:4-7
Timestamp: 2025-06-09T03:10:41.010Z
Learning: The alauda/doom project uses yarn v4 as the package manager, not npm. Always reference yarn commands when suggesting package management operations.

Applied to files:

  • .changeset/two-rabbits-taste.md
⏰ 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). (5)
  • GitHub Check: Build and Lint with Node.js 22 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 24 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 20 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 22 on ubuntu-latest
  • GitHub Check: Build and Lint with Node.js 20 on ubuntu-latest
🔇 Additional comments (3)
packages/doom/styles/ai-assistant.module.scss (2)

7-7: LGTM! Using CSS variable for z-index.

Replacing the hard-coded z-index value with var(--rp-z-index-nav) improves consistency and ensures the assistant panel maintains proper layering relative to the navigation component.


9-10: LGTM! Improved sizing calculations.

The changes correctly:

  1. Remove the unnecessary calc() wrapper from the width's min() function
  2. Adjust the height calculation to subtract 2rem from the viewport height before taking the minimum, which properly accounts for the container's positioning (1rem bottom + spacing for visual breathing room)

These changes improve both the correctness and clarity of the sizing logic.

packages/doom/src/global/SiteOverrides/index.tsx (1)

71-77: Clarify the timing strategy: why setTimeout(1) for title but requestAnimationFrame for navbar?

Lines 71-73 use setTimeout(1) to update document.title, while line 92 uses requestAnimationFrame for setNavBarSpans. These have different timing guarantees—RAF synchronizes with the next paint, while setTimeout(1) defers with minimal delay. The cleanup is correct, but this inconsistency should either be intentional and documented, or unified.

@JounQin JounQin merged commit ea31a4c into main Dec 19, 2025
14 checks passed
@JounQin JounQin deleted the fix/styling branch December 19, 2025 07:16
github-actions bot pushed a commit that referenced this pull request Dec 19, 2025
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