Skip to content

view: editing an Int cell writes 5.0 #2064

Closed

Description

@shunichironomura

Warning

This content was written by an AI agent and must be verified by a human developer. After human verification, this alert may be removed.

Found in the review of #2057, which adds the experimental view. It does not block that PR; #2059 fixed the findings that did. Paths refer to #2059's head.

Problem

literalFor in web/view/src/main.ts turns the text typed into a cell into a literal. It treats dimension !== null as "this is a quantity".

  • An Int node also has a dimension ("Int"), so typing 5 writes 5.0, which fails to type-check.
  • In a table whose cells have different units, unit is null, so 5 becomes 5.0 with no unit.

Proposed fix

  • Let the view model say a node's element type, or whether and how a cell is editable. Build a quantity literal only for a quantity.
  • Move literalFor into a pure module and test it.

Activity

  1. added
    bugSomething isn't working
    webviewThe experimental view (web/view, graphcal view, graphcal/viewModel)
    on Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingwebviewThe experimental view (web/view, graphcal view, graphcal/viewModel)

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions