Skip to content

Conversation

@nhatcher
Copy link
Member

No description provided.

@nhatcher nhatcher requested review from Copilot and dg-ac November 13, 2025 21:13
Copilot finished reviewing on behalf of nhatcher November 13, 2025 21:16
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 refactors the name manager component to improve code clarity and add navigation functionality. The changes convert optional props to required props, rename functions for clarity, and implement a feature to navigate to named ranges when clicked.

Key changes:

  • Added navigation to named ranges by clicking on them in the list
  • Converted optional props to required props throughout the component hierarchy
  • Renamed selectedArea to getSelectedArea for better semantic clarity

Reviewed Changes

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

File Description
Workbook.tsx Added imports for token parsing, renamed prop, and implemented onNameSelected callback to handle range navigation
RightDrawer.tsx Updated prop interface and forwarded new onNameSelected callback
NamedRanges.tsx Made all props required, renamed props for clarity, changed list item click behavior to navigate instead of edit, and fixed styling indentation
Comments suppressed due to low confidence (2)

webapp/IronCalc/src/components/RightDrawer/NamedRanges/NamedRanges.tsx:75

  • The conditional check if (!newDefinedName) has been removed on line 75 but was present in the original code. Since newDefinedName is now a required prop (not optional), this removal is correct and the check is no longer needed. This comment is informational only - no action required.
      if (!newDefinedName) return {};

webapp/IronCalc/src/components/RightDrawer/NamedRanges/NamedRanges.tsx:293

  • The conditional check if (deleteDefinedName) is no longer necessary since deleteDefinedName is now a required prop (line 34). Consider removing this check on lines 293 and 304 for consistency with the prop interface changes.
                          if (deleteDefinedName) {

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

@dg-ac
Copy link
Contributor

dg-ac commented Nov 13, 2025

Hi @nhatcher.

I've reviewed the changes and works well in general but I'm afraid we've lost some functionalities and some things are not properly working:

  1. As you see, when adding a new range we suggest a name for it (Range1, Range2, Range3...). Previously, we would check if there was an existing name using that pattern, and would offer the next one. So if there's a Range1 already, the suggested name would be Range 2. Right now we just offer Range1 regardless.

  2. Data is validated only after clicking Apply changes. Before you could see the error messages immediately.

  3. After getting the error "Defined name already exists", I can't move on. Even if I change it, the 'Apply changes' button stays inactive.

image
  1. The placement for the error message "Defined name already exists" is placed under the wrong input (should be right below the Range name one).
image
  1. Clicking on the list items opens their edit view. Ideally, clicking on these should select the specific range in the grid. To edit, we can use the existing Edit button

Thank you!

We do a trick I am not proud of. Because all of our errors are Strings,
we don't have a way to separate a name error from an index error,
for instance. What I do in prepend the error with a string that indicates
where it comes from.
@nhatcher nhatcher force-pushed the name-manager-cleanup branch from e2095a0 to d99278b Compare November 20, 2025 08:22
@nhatcher nhatcher force-pushed the name-manager-cleanup branch from d99278b to 66be0ab Compare November 20, 2025 17:31
@nhatcher nhatcher merged commit 3bb49d1 into main Nov 20, 2025
1 check passed
@nhatcher nhatcher deleted the name-manager-cleanup branch November 20, 2025 20:44
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