Skip to content

Batch variable column vanishes during a backspace rename (cosmetic) #54

Description

@szrudi

Context

Follow-up to #52 (safe variable rename via backspace, v1.8.3).

When you rename a batch variable by backspacing its name down to the empty
placeholder {{}} and retyping, the value is now correctly preserved (#52).
But during the transient {{}} state, that variable's column disappears from
the batch table
, then reappears with its value once you type the new name.

The data is safe the whole time — it's parked under the internal empty-string
key and reattaches on retype — but the column visually vanishing is alarming
(looks like the values were lost). Confirmed in real use.

Why it happens

The batch table builds its columns from detectVariables(widgets), which
deliberately excludes the empty placeholder {{}} (an empty name isn't a real
column). So while a variable sits at {{}} mid-rename, there's no column to
render its parked value under.

Proposed improvement

Keep the column visible during an in-progress rename: have BatchPanel also
surface the transient {{}} as a column, with a muted placeholder header (e.g.
"(naming…)") so the value never appears to vanish. Contained change to
client/src/components/BatchPanel.tsx; needs a little special-casing for the
empty placeholder (header rendering + keeping substitution/other logic unaffected,
since they still key off non-empty variables).

Cosmetic/UX only — no data-loss risk either way. Priority: low.

References

  • Rename heuristic + the empty-key bridge: client/src/state/useLabelStore.ts
    (updateWidget) and docs/ARCHITECTURE.md "Variable rename heuristic".
  • Export already strips the empty key (client/src/lib/labelFile.ts
    withoutEmptyKey).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions