fix: [Note] Title not filled by default #13838#18297
fix: [Note] Title not filled by default #13838#18297FelixMalfait merged 4 commits intotwentyhq:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes a UX regression where creating a Note via the command menu side panel did not auto-focus the title field (typing went into the rich-text body), by ensuring the “new record title cell” is opened/focused when records are opened in the side panel flow.
Changes:
- Trigger title-cell focus for newly created records inside
openRecordInCommandMenu(side panel entry point). - Remove the redundant title-cell opening logic from
useCreateNewIndexRecordto avoid double-invocation. - Add test coverage asserting title-cell focus occurs only for
isNewRecord: true.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/twenty-front/src/modules/ui/utilities/focus/constants/DebugFocusStack.ts | Toggles focus-stack debugging (currently enabled). |
| packages/twenty-front/src/modules/object-record/record-table/hooks/useCreateNewIndexRecord.ts | Removes redundant title-cell focus call after opening side panel record. |
| packages/twenty-front/src/modules/command-menu/hooks/useOpenRecordInCommandMenu.ts | Centralizes new-record title focus for side panel record opens. |
| packages/twenty-front/src/modules/command-menu/hooks/tests/useOpenRecordInCommandMenu.test.tsx | Adds tests for title-cell focus behavior on new record opens. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/twenty-front/src/modules/ui/utilities/focus/constants/DebugFocusStack.ts
Outdated
Show resolved
Hide resolved
packages/twenty-front/src/modules/ui/utilities/focus/constants/DebugFocusStack.ts
Outdated
Show resolved
Hide resolved
Greptile SummaryThis PR successfully fixes the note title auto-focus issue by centralizing the logic in
Confidence Score: 2/5
Important Files Changed
Last reviewed commit: 8d826e6 |
packages/twenty-front/src/modules/ui/utilities/focus/constants/DebugFocusStack.ts
Outdated
Show resolved
Hide resolved
...es/twenty-front/src/modules/command-menu/hooks/__tests__/useOpenRecordInCommandMenu.test.tsx
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
packages/twenty-front/src/modules/command-menu/hooks/useOpenRecordInCommandMenu.ts
Show resolved
Hide resolved
|
🚀 Preview Environment Ready! Your preview environment is available at: http://bore.pub:16874 This environment will automatically shut down when the PR is closed or after 5 hours. |
etiennejouan
left a comment
There was a problem hiding this comment.
LGTM ! Thank you for your contribution !
|
Hey @FelixMalfait! After you've done the QA of your Pull Request, you can mark it as done here. Thank you! |
1 similar comment
|
Hey @FelixMalfait! After you've done the QA of your Pull Request, you can mark it as done here. Thank you! |
|
Thanks @bugisthegod for your contribution! |
Fixes twentyhq#13838 When creating a note from the command menu side panel (e.g. clicking "Add Note" in a related notes section on an Opportunity/company/people page), the title field was not auto-focused — focus point went to body instead. ## Root Cause When a record opens in the side panel, there is no page navigation, so `PageChangeEffect` (which handles title auto-focus for full-page views) never runs. `openNewRecordTitleCell()` was simply never called for the side-panel path. ## Fix `openRecordInCommandMenu` is the single entry point for all side-panel record opens, so title auto-focus is handled there once for all callers. Previously, `useCreateNewIndexRecord` called `openRecordInCommandMenu` and then called `openNewRecordTitleCell` separately, which would have caused a double invocation after this fix. The redundant call has been removed. ## Before https://github.com/user-attachments/assets/df0d9e4f-dc25-4a0d-a49e-898a14f9c0a0 ## After https://github.com/user-attachments/assets/1a5044f7-6bb7-4333-8934-c1081b935e97 --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> (cherry picked from commit 7809f83)

Fixes #13838
When creating a note from the command menu side panel (e.g. clicking "Add Note" in a related notes section on an Opportunity/company/people page), the title field was not auto-focused — focus point went to body instead.
Root Cause
When a record opens in the side panel, there is no page navigation, so
PageChangeEffect(which handles title auto-focus for full-page views) never runs.openNewRecordTitleCell()was simply never called for the side-panel path.Fix
openRecordInCommandMenuis the single entry point for all side-panel record opens, so title auto-focus is handled there once for all callers.Previously,
useCreateNewIndexRecordcalledopenRecordInCommandMenuand then calledopenNewRecordTitleCellseparately, which would have caused a double invocation after this fix. The redundant call has been removed.Before
before.mp4
After
after.mp4