-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[WEB-6038] fix: work item empty title flicker #8618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: preview
Are you sure you want to change the base?
Conversation
|
Linked to Plane Work Item(s) This comment was auto-generated by Plane |
📝 WalkthroughWalkthroughThe title input component's internal state now initializes with the provided value prop when available, falling back to an empty string if none is supplied. This adjustment ensures the component starts with the correct initial value. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Fixes a UI flicker where an issue/work item title briefly renders empty on initial load by initializing local state from the incoming value prop.
Changes:
- Initialize
titlestate with the providedvalueto avoid an initial empty render.
| const { t } = useTranslation(); | ||
| // states | ||
| const [title, setTitle] = useState(""); | ||
| const [title, setTitle] = useState(value || ""); |
Copilot
AI
Feb 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This introduces derived state from a prop: if value changes after mount (e.g., async load / store hydration), title won’t update and the input can stay stale. Consider syncing title when value changes (e.g., in an effect gated by hasUnsavedChanges.current), or making the input fully controlled by value (and removing local title state) to avoid inconsistencies.
| const { t } = useTranslation(); | ||
| // states | ||
| const [title, setTitle] = useState(""); | ||
| const [title, setTitle] = useState(value || ""); |
Copilot
AI
Feb 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer nullish coalescing for defaulting optional props: value || \"\" will also fall back for other falsy values. Using value ?? \"\" is a more precise default for null/undefined.
Description
This PR resolves the flickering empty title issue on initial load for the work item.
Type of Change
Summary by CodeRabbit