Skip to content

MILAB-3299: rename metadata columns from the column header menu - #142

Merged
AStaroverov merged 2 commits into
mainfrom
MILAB-3299_rename-metadata-columns
Nov 12, 2026
Merged

AStaroverov merged 2 commits into
mainfrom
MILAB-3299_rename-metadata-columns

Conversation

@AStaroverov

@AStaroverov AStaroverov commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

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:

  • an empty name is rejected;
  • a name another metadata column already carries is rejected, ignoring case and surrounding spaces;
  • a column may keep its own name or change only its case;
  • Add Column suggests the first free Metadata Column N instead 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/columnId domain (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

  • Downstream blocks keep their picks: they reference a metadata column by its export name metadata.<id>, which is keyed by the column id and does not change on rename.
  • The column's spec does change (label annotation and pl7.app/columnId domain), 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 for metadataLabelIssue and defaultMetadataLabel) and pnpm check pass.
  • Not yet tried in the desktop app.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no actionable issues were found.

Summary

Adds metadata-column renaming through the column header menu.

  • Metadata columns can be renamed from their header menu.
  • The workspace uses block-tools 2.19.1.

Important touched types:

  • ColumnDialog: new union describing the open dialog. Add mode carries valueType; rename mode carries columnId.
  • 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 its label.
  • MTValueType: the supported metadata value types. Its definition is unchanged; it now belongs to the add variant of ColumnDialog.

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 --> H
Loading

Reviews (1) · Last reviewed commit: "MILAB-3299: bump block-tools to 2.19.1" · Reviewed by Greptile

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.
@AStaroverov

Copy link
Copy Markdown
Contributor Author

@greptileai

@AStaroverov
AStaroverov added this pull request to the merge queue Nov 12, 2026
Merged via the queue into main with commit ef5538c Nov 12, 2026
12 checks passed
@AStaroverov
AStaroverov deleted the MILAB-3299_rename-metadata-columns branch November 12, 2026 08:51
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