Skip to content

Eliminate duplicate style computation in MentionMenu#16

Merged
akshad-exe merged 2 commits into
feature/tiptapfrom
copilot/sub-pr-14-again
Feb 8, 2026
Merged

Eliminate duplicate style computation in MentionMenu#16
akshad-exe merged 2 commits into
feature/tiptapfrom
copilot/sub-pr-14-again

Conversation

Copilot AI commented Feb 8, 2026

Copy link
Copy Markdown
Contributor

Addresses code review feedback to remove duplicate positioning logic in MentionMenu.tsx.

Changes

  • Hoisted style object computation before the filteredNotes.length === 0 branch
  • Removed duplicate computation from non-empty branch

Before:

if (filteredNotes.length === 0) {
  const style = noTransform ? {...} : {...}
  return <div style={style}>...</div>
}
const style = noTransform ? {...} : {...}  // Duplicate
return <div style={style}>...</div>

After:

const style = noTransform ? {...} : {...}
if (filteredNotes.length === 0) {
  return <div style={style}>...</div>
}
return <div style={style}>...</div>

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Address feedback on Tiptap feature implementation Eliminate duplicate style computation in MentionMenu Feb 8, 2026
Copilot AI requested a review from akshad-exe February 8, 2026 03:24
@akshad-exe akshad-exe marked this pull request as ready for review February 8, 2026 03:24
Copilot AI review requested due to automatic review settings February 8, 2026 03:24
@akshad-exe akshad-exe merged commit 0914542 into feature/tiptap Feb 8, 2026
2 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Removes duplicated inline style computation in MentionMenu by hoisting the positioning style object so both the empty and non-empty branches reuse it.

Changes:

  • Hoisted style computation above the filteredNotes.length === 0 early-return branch
  • Removed the duplicated style computation from the non-empty branch

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

3 participants