Skip to content

fix: [Note] Title not filled by default #13838#18297

Merged
FelixMalfait merged 4 commits intotwentyhq:mainfrom
bugisthegod:fix/Note-Title-not-default-filled
Mar 2, 2026
Merged

fix: [Note] Title not filled by default #13838#18297
FelixMalfait merged 4 commits intotwentyhq:mainfrom
bugisthegod:fix/Note-Title-not-default-filled

Conversation

@bugisthegod
Copy link
Copy Markdown
Contributor

@bugisthegod bugisthegod commented Feb 27, 2026

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

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

before.mp4

After

after.mp4

Copilot AI review requested due to automatic review settings February 27, 2026 18:48
Copy link
Copy Markdown
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

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 useCreateNewIndexRecord to 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.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 4 files

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Feb 27, 2026

Greptile Summary

This PR successfully fixes the note title auto-focus issue by centralizing the logic in openRecordInCommandMenu, eliminating duplicate calls and ensuring title fields receive focus when notes are created in the side panel.

  • Centralizes title auto-focus logic in useOpenRecordInCommandMenu to handle all side-panel record opens
  • Removes redundant openRecordTitleCell call from useCreateNewIndexRecord to prevent double invocation
  • Adds comprehensive tests to verify the new behavior works correctly
  • CRITICAL: DEBUG_FOCUS_STACK flag accidentally left enabled - will cause excessive logging in production

Confidence Score: 2/5

  • Critical issue with debug flag enabled - must be fixed before merge
  • The core fix is well-implemented with proper testing, but the accidentally enabled debug flag is a critical issue that would cause excessive logging in production and potential performance impact
  • DebugFocusStack.ts requires immediate attention - debug flag must be set to false

Important Files Changed

Filename Overview
packages/twenty-front/src/modules/ui/utilities/focus/constants/DebugFocusStack.ts Debug flag accidentally left enabled - critical issue that will cause excessive logging in production
packages/twenty-front/src/modules/command-menu/hooks/tests/useOpenRecordInCommandMenu.test.tsx Added comprehensive tests for new title cell auto-focus behavior; minor improvement needed in assertion specificity
packages/twenty-front/src/modules/command-menu/hooks/useOpenRecordInCommandMenu.ts Centralizes title cell auto-focus logic for side panel opens; correctly handles new record state with proper field lookup
packages/twenty-front/src/modules/object-record/record-table/hooks/useCreateNewIndexRecord.ts Removes redundant title cell opening logic to prevent double invocation; correctly delegates to centralized implementation

Last reviewed commit: 8d826e6

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

4 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

bugisthegod and others added 2 commits February 27, 2026 18:52
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 27, 2026

🚀 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.

Copy link
Copy Markdown
Contributor

@etiennejouan etiennejouan left a comment

Choose a reason for hiding this comment

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

LGTM ! Thank you for your contribution !

@FelixMalfait FelixMalfait added this pull request to the merge queue Mar 2, 2026
Merged via the queue into twentyhq:main with commit 7809f83 Mar 2, 2026
67 checks passed
@twenty-eng-sync
Copy link
Copy Markdown

Hey @FelixMalfait! After you've done the QA of your Pull Request, you can mark it as done here. Thank you!

1 similar comment
@twenty-eng-sync
Copy link
Copy Markdown

Hey @FelixMalfait! After you've done the QA of your Pull Request, you can mark it as done here. Thank you!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 2, 2026

Thanks @bugisthegod for your contribution!
This marks your 5th PR on the repo. You're top 5% of all our contributors 🎉
See contributor page - Share on LinkedIn - Share on Twitter

Contributions

@bugisthegod bugisthegod deleted the fix/Note-Title-not-default-filled branch March 2, 2026 20:54
groovydr pushed a commit to fuse-gtm/fuse-v1 that referenced this pull request Mar 5, 2026
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Note] Title not filled by default

5 participants