Skip to content

fix(ui): preserve sheet scopes in Name Box choices - #4287

Open
MMexicann wants to merge 3 commits into
storytold:mainfrom
MMexicann:patch-31
Open

MMexicann wants to merge 3 commits into
storytold:mainfrom
MMexicann:patch-31

Conversation

@MMexicann

@MMexicann MMexicann commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The Name Box dropdown displayed foreign sheet-local names without their scope and sent that bare name to Go To. A local name could fail to resolve from another sheet or navigate to a same-named workbook range.

Reuse the existing Go To range-name resolver so foreign names retain their quoted sheet scope, active-sheet shadowing is respected, and non-range names are excluded. Build the list inside the open popup.

Validation

Added a UI regression with workbook Spot, local 'Bob''s'!Spot, and constant Rate. It checks distinct range choices, excludes the constant, and clicks the qualified entry to verify navigation to Bob's/D4. Current main, existing Go To tests, public APIs and the complete two-file diff were reviewed; the live Name Box PR search found no competing scope correction.

Neither cargo nor rustc is available here. The UI regression, app rendering and cargo xtask ci were not run locally. Hosted CI passed on b869c7c505eff5c6ddd060bd5836ec9818769bf1: four successful checks and two skipped coverage jobs. CodeRabbit reported no actionable comments; its separate Clippy tool did not complete.

Summary by CodeRabbit

  • New Features
    • The Name Box dropdown now lists names available to the active workbook and sheet, including workbook-scoped range names. Names that refer to another sheet display that sheet’s scope for clarity; selecting one navigates to the sheet and selects the referenced range.
    • Constants are not shown in the dropdown. When no document is active, the dropdown is empty.

Use the Go To range-name resolver for dropdown entries, including foreign sheet scopes and non-range filtering. Build the list only while the popup is open.
Exercise the actual dropdown with same-named workbook and foreign sheet ranges, exclude a constant, and click the qualified local name to verify navigation.
@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Name Box dropdown now gets its entries from go_to_names for the active workbook and sheet. An interaction test checks name display and navigation to a selected foreign-sheet range.

Changes: Name Box name listing

Layer / File(s) Summary
Load and select names
crates/ui-egui/src/formula_bar.rs, crates/ui-egui/tests/it/interaction.rs
The dropdown uses go_to_names for the active sheet, or an empty list when no document is active. The test checks qualified sheet names, workbook names, exclusion of constants, and navigation to D4 on the selected sheet.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: aiongg, echelon

Merge Risk: Minimal · up to b869c

The Name Box dropdown now lists range names with the correct sheet scope and navigates to them, reusing the Go To resolver. The change is small and easy to revert, and it has a regression test. Wait for hosted CI before merging.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the Name Box dropdown now keeps sheet scopes (quoted sheet qualifiers for foreign sheet-local names) in its choices. The raw summary says the dropdown now takes its li…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title names the main change: the Name Box dropdown now keeps sheet scopes (quoted sheet qualifiers for foreign sheet-local names) in its choices. The raw summary says the dropdown now takes its list from gridcraft_engine::cmd::edit::go_to_names, and the added interaction test checks the quoted sheet scope, the workbook-scoped range, and the excluded constant. The title uses the 'fix(ui)' convention and is specific enough for a teammate scanning history. It does not cover the switch to the Go To resolver, but that is a detail, not the main point.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

Clippy (1.99.1)

Clippy execution timed out

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 973a105 and b869c7c.

Files selected for processing: 1

  • crates/ui-egui/tests/it/interaction.rs
Files skipped from review as they are similar to previous changes: 1

  • crates/ui-egui/tests/it/interaction.rs

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.

Apply the exact array-layout correction reported by cargo fmt in hosted CI.
emrahoksak pushed a commit to emrahoksak/girdcraft- that referenced this pull request Nov 18, 2026

This branch has not been deployed

No deployments
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.

1 participant