Skip to content

🐛(frontend) preserve title when adding an emoji - #2586

Open
fch-aa wants to merge 1 commit into
suitenumerique:mainfrom
fch-aa:fix/preserve-title-when-adding-emoji
Open

🐛(frontend) preserve title when adding an emoji#2586
fch-aa wants to merge 1 commit into
suitenumerique:mainfrom
fch-aa:fix/preserve-title-when-adding-emoji

Conversation

@fch-aa

@fch-aa fch-aa commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Fixes #2529

Purpose

Fix a race condition when renaming a newly created page and immediately adding
an emoji. The emoji update previously reused the stale document title, causing
the new title to disappear.

Proposal

  • Keep the latest submitted title available to the emoji action
  • Add a regression test covering rename followed immediately by emoji addition

Validated with:

  • corepack yarn lint
  • corepack yarn test — 55 Yjs and 304 Impress tests
  • Targeted DocHeader emoji tests
  • Stylelint and the Next.js production build

Video

2026-08-14.13-34-09.mp4

External contributions

Thank you for your contribution! 🎉

General requirements

CI requirements

  • I made sure that all existing tests are passing
  • I have signed off my commits with git commit --signoff (DCO compliance)
  • I have signed my commits with my SSH or GPG key (git commit -S)
  • My commit messages follow the required format: <gitmoji>(type) title description
  • I have added a changelog entry under ## [Unreleased] section (if noticeable change)

AI requirements

  • I used AI assistance to produce part or all of this contribution
  • I have read, reviewed, understood and can explain the code I am submitting
  • I can jump in a call or a chat to explain my work to a maintainer

The emoji action could reuse a stale document title while a rename was being
submitted, replacing the new title with the emoji alone.

Keep the latest submitted title in the header and cover the interaction
with a regression test.

Signed-off-by: fch-aa <21101725+fch-aa@users.noreply.github.com>
@fch-aa
fch-aa force-pushed the fix/preserve-title-when-adding-emoji branch from 5daf3cd to 11938f4 Compare August 14, 2026 11:57
@fch-aa
fch-aa marked this pull request as ready for review August 14, 2026 11:58
@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 4cf83a03-f6c3-482e-9183-9344c02e9f5a

📥 Commits

Reviewing files that changed from the base of the PR and between fb984ab and 11938f4.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • src/frontend/apps/impress/src/features/docs/doc-header/__tests__/DocHeaderEmoji.spec.tsx
  • src/frontend/apps/impress/src/features/docs/doc-header/components/DocHeader.tsx
  • src/frontend/apps/impress/src/features/docs/doc-header/components/DocTitle.tsx

Walkthrough

DocTitle reports sanitized title changes through a new optional callback. DocHeader stores the latest title in a ref and uses it for emoji additions and removals. Tests cover editing the title immediately before adding an emoji. The changelog records the fix.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 11938

This localized frontend fix preserves the latest page title when an emoji is added immediately after renaming; no actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: antolc, ovgodd

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the frontend fix that preserves the document title when adding an emoji.
Description check ✅ Passed The description clearly explains the race condition, the proposed fix, regression coverage, and validation performed.
Linked Issues check ✅ Passed The changes address issue #2529 by preserving the latest title during emoji updates and adding a regression test.
Out of Scope Changes check ✅ Passed The changelog entry, implementation changes, and regression tests are directly related to issue #2529.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@virgile-dev
virgile-dev requested review from AntoLC and Ovgodd and removed request for AntoLC August 18, 2026 08:41
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.

🐛(Bug) Adding an emoji removes the title

1 participant