Skip to content

custom formatting of numeric metadata #1941

Description

@gwennlbh

would be useful for a lot of things: for example for camera settings (see #1449), it'd allow us to show more intuitive displays of:

  • shutter speed: 1/250 instead of 0.04 (value < 1 ? "1/" & $round(1/value) : value)
  • maybe ISO rating: ISO 1600 instead of 1600 ("ISO " & value)
  • f-number/aperture: f/2.4 instead of 2.4 ("f/" & value)

using custom units is not that interesting cuz we cant do prefixes nor dynamic formatting (for example, shutter speeds >= 1 would not use the 1/ notation) (and well, it's not there yet)

spec:

shutter_speed:
  unit: seconds
  presentation: value < 1 ? "1/" & $round(1/value) : value
  # or, if we add a python-esque $format / $fmt
  display: value < 1 ? $fmt("1/{value}", $) : value

problem is what to do when the user wants to edit the value.

a better idea would be 2 kinds of displays:

  • prefix and/or suffix: just add them around the input { prefix?: string, suffix?: string }
  • format (and opt. parse): turn the field into a text field, show format(value), and parse back into number with parse(formatted) { format: string, parse?: string }
    • we can still show ranges & incre/decr buttons:

call it presentation cuz we already do that for enum metadata (to force dropdowns)

Activity

  1. updated Effort Hours and Priority Medium on Jul 17, 2026
  2. added theissue type on Jul 17, 2026
  3. added this to the InsectDetective milestone on Jul 20, 2026
  4. moved this from Todo to In Progress in Time planningon Jul 30, 2026
  5. 1 remaining item

  6. updated Time spent 47 mins and Hours spent 0.7908333333333334 on Jul 30, 2026
  7. added a commit that references this issue on Jul 30, 2026
    a36fd0a
  8. updated Time spent 48 mins and Hours spent 0.8075 on Jul 30, 2026
  9. added a commit that references this issue on Jul 30, 2026
    121060f
  10. moved this from In Progress to Done in Time planningon Jul 30, 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

    No labels
    No labels

    Fields

    Priority

    Medium

    Deadline

    Jan 9, 2027

    Effort

    Hours

    Figma

    None yet

    Area

    Protocols

    Time spent

    1.3 hours

    Hours spent

    1.3369444444444445

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions