fix: avoid mutating cached titleTemplate tag in resolveTitleTemplate#715
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Bundle Size Analysis
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.claude/settings.local.json (1)
1-7: Consider whether.localsettings should be committed.Files with
.localsuffix typically indicate user-specific configurations that shouldn't be version-controlled. If this permission is intended for CI/CD or all developers, consider renaming to.claude/settings.json. Otherwise, consider adding.claude/settings.local.jsonto.gitignore.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.claude/settings.local.json around lines 1 - 7, This file .claude/settings.local.json contains a user-specific permission ("permissions.allow" -> "Bash(pnpm test:*)") that likely shouldn’t be committed; either move the permission into a shared config file (rename to .claude/settings.json and commit) if it is intended for all developers/CI, or restore the file to developer-local state and add .claude/settings.local.json to .gitignore to prevent committing personal settings; update the repository README or CONTRIBUTING to document where to put shared vs local Claude settings.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.claude/settings.local.json:
- Around line 1-7: This file .claude/settings.local.json contains a
user-specific permission ("permissions.allow" -> "Bash(pnpm test:*)") that
likely shouldn’t be committed; either move the permission into a shared config
file (rename to .claude/settings.json and commit) if it is intended for all
developers/CI, or restore the file to developer-local state and add
.claude/settings.local.json to .gitignore to prevent committing personal
settings; update the repository README or CONTRIBUTING to document where to put
shared vs local Claude settings.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 0a38caf3-6411-4e77-a80f-8f4b15edafc5
📒 Files selected for processing (2)
.claude/settings.local.jsonpackages/unhead/src/utils/resolve.ts
resolveTitleTemplate() was mutating the titleTemplate tag in-place (tpl.tag = 'title', tpl.textContent = v), which corrupts the entry's _tags cache on subsequent renders. Now creates a new object instead. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
94f6dcc to
dcc118d
Compare
Summary
resolveTitleTemplate()was mutating thetitleTemplatetag object in-place (tpl.tag = 'title',tpl.textContent = v), which corrupts the entry's_tagscache on subsequent renders. Now creates a new object via spread instead.This is a correctness fix — the mutation could cause stale
titleTemplatedata to persist across re-renders when the entry's_tagscache is reused.Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes