Repository navigation
MILAB-3299: rename metadata columns from the column header menu - #142
Merged
Merged
Conversation
Each metadata column header menu gets a Rename item that reuses the Add Column dialog. The dialog rejects an empty name and a name another metadata column already carries (ignoring case and surrounding spaces), for both adding and renaming, since a global metadata column is exported under its label and two columns sharing one would be exported as one.
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Metadata columns can be renamed from the column header menu: Rename sits next to Delete and opens the Add Column dialog in rename mode, filled in with the current name.
The dialog now checks the name for both adding and renaming:
Metadata Column Ninstead of one that may already be taken.Why names must stay unique
A global metadata column is exported with its label as the
pl7.app/columnIddomain (workflow/src/metadata.lib.tengo). Two columns sharing a label are exported as one column and lose each other's values. Metadata import already guarded against this; the Add Column dialog did not.Effect on downstream blocks
metadata.<id>, which is keyed by the column id and does not change on rename.pl7.app/columnIddomain), so downstream blocks go stale and need a re-run, as after any other Samples & Data edit.No model, workflow or kind changes.
Checks
ui:pnpm test(new cases formetadataLabelIssueanddefaultMetadataLabel) andpnpm checkpass.

Confidence Score: 5/5
The PR appears safe to merge; no actionable issues were found.Summary
Adds metadata-column renaming through the column header menu.
Important touched types:
ColumnDialog: new union describing the open dialog. Add mode carriesvalueType; rename mode carriescolumnId.MTColumn: a metadata column with an identity, label, value type, and sample values. Its definition is unchanged; the new helpers use it to check names, and rename changes only itslabel.MTValueType: the supported metadata value types. Its definition is unchanged; it now belongs to the add variant ofColumnDialog.AStaroverov explicitly describes the changed export spec as intentional: renaming changes the spec and requires downstream blocks to run again.
Review checks were source-based. Tests and desktop behavior were not run; local dependencies were unavailable.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Add column] --> C[Shared column dialog] B[Rename from header menu] --> C C --> D{Name is valid?} D -->|No| E[Show error and disable submit] D -->|Yes: add| F[Create typed column with new id] D -->|Yes: rename| G[Change label and keep id and values] F --> H[Save model] G --> HReviews (1) · Last reviewed commit: "MILAB-3299: bump block-tools to 2.19.1" · Reviewed by Greptile