Skip to content

Conversation

@dg-ac
Copy link
Contributor

@dg-ac dg-ac commented Nov 19, 2025

This PR introduces two quality-of-life improvements to the sheet tab buttons, making them more intuitive and aligned with typical spreadsheet behavior.


1. Right-click opens the options menu

Users can now open the sheet options menu using right-click, same way as in most spreadsheet applications.

image

2. Sheet names can be edited inline

Double-clicking a sheet tab now turns it into an inline text input, allowing users to rename the sheet directly.
Previously, renaming required a separate dialog, which interrupted workflow.

Additionally, selecting “Rename sheet” from the menu now automatically focuses the input.

image

Testing

  • Right-click on a sheet tab opens the correct options menu.
  • Double-clicking a sheet tab enables inline name editing.
  • Pressing Enter saves the new sheet name; pressing Escape cancels it.
  • Choosing Rename sheet from the menu focuses the inline input.
  • Verify behavior on multiple sheets, including pinned/renamed ones.
  • Confirm proper behavior on desktop and mobile.

@nhatcher nhatcher requested a review from Copilot November 19, 2025 04:29
@nhatcher nhatcher self-assigned this Nov 19, 2025
Copilot finished reviewing on behalf of nhatcher November 19, 2025 04:30
Copy link
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

This PR replaces the dialog-based sheet renaming workflow with inline editing and adds right-click menu support, improving the user experience to match common spreadsheet applications.

Key Changes:

  • Right-click on sheet tabs now opens the options menu directly
  • Double-clicking sheet tabs enables inline name editing
  • Removed the separate rename dialog component

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
SheetTabBar.tsx Added height: 100% to the Sheets container for proper layout
SheetTab.tsx Implemented inline editing with input field, context menu support via right-click, updated styling for active states, and keyboard handling (Enter/Escape)
SheetRenameDialog.tsx Removed dialog component as it's replaced by inline editing

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


useLayoutEffect(() => {
if (isEditing && measureRef.current) {
void editingName;
Copy link

Copilot AI Nov 19, 2025

Choose a reason for hiding this comment

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

This statement void editingName; serves no purpose other than to satisfy the ESLint exhaustive-deps rule. Consider using a comment like // Intentionally depend on editingName or add it to the dependency array explicitly with a comment explaining why it's needed for the side effect, rather than using void.

Suggested change
void editingName;

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

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

Correct, this is HACK

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure how to proceed here 😕
Removing this causes a linter error

event.stopPropagation();
event.preventDefault();
handleStartEditing();
}}
Copy link

Copilot AI Nov 19, 2025

Choose a reason for hiding this comment

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

Double-click is not keyboard-accessible. Users navigating with keyboard should be able to enter edit mode. Consider adding keyboard support, such as pressing Enter or F2 when the tab has focus, similar to standard spreadsheet applications.

Suggested change
}}
}}
onKeyDown={(event: React.KeyboardEvent) => {
if (!isEditing && (event.key === "Enter" || event.key === "F2")) {
event.stopPropagation();
event.preventDefault();
handleStartEditing();
}
}}

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

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

Please don't just copy/paste this code. But we need to think first how to change the name from the keyboard

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have already an idea for that but until now we haven't thought much about keyboard support. As an example, hitting 'Tab' only works for the workbook grid, it doesn't really work on the toolbox nor the footer...

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