Skip to content

Accept a scalar table-column format as a legacy alias for number - #53

Merged
TanayBensuYurtturk merged 2 commits into
mainfrom
TanayBensuYurtturk/cf-legacy-format-compat
Jul 30, 2026
Merged

Accept a scalar table-column format as a legacy alias for number#53
TanayBensuYurtturk merged 2 commits into
mainfrom
TanayBensuYurtturk/cf-legacy-format-compat

Conversation

@TanayBensuYurtturk

Copy link
Copy Markdown
Contributor

Makes a table column's format polymorphic so pre-existing dashboards keep working.

  • A scalar format string (e.g. format: currency) is the legacy value-display shorthand — a custom UnmarshalYAML folds it into number on load.
  • A list format is the ordered conditional-format layers (unchanged).
  • Schema: format is now oneOf(string, array); number is retained, so number and a list format can coexist (value display + coloring on the same column).

Adds a backward-compat unmarshal test and documents the alias in the create-dashboard skill and dashboard docs.

…lias for `number`

A table column's `format` is now polymorphic: a scalar string is the legacy
value-display shorthand (folded into `number` on load), a list is the ordered
conditional-format layers. A custom UnmarshalYAML plus a `oneOf` schema keep
pre-existing `format: currency` dashboards valid, while `number` and a list
`format` can coexist (value display + coloring). Adds a backward-compat test
and documents the alias in the skill and docs.
Comment thread pkg/dashboard/model.go Outdated
@greptile-apps

greptile-apps Bot commented Jul 30, 2026

Copy link
Copy Markdown

Fix All in Conductor

Prompt To Fix All With AI
### Issue 1
pkg/dashboard/model.go:183
**YAML aliases are rejected**

When a table column's `format` uses a YAML alias to a valid scalar or layer sequence, this switch sees an alias node and enters the error branch, causing the dashboard to fail loading instead of decoding the anchored value.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "feat(dashboards): accept a scalar table-..." | Re-trigger Greptile

A `format: *anchor` alias node hit the error branch instead of decoding the
anchored scalar/sequence, failing the load. Follow the alias to its target
before dispatching. Also simplifies the unmarshaler (anonymous struct, single
struct assignment) and adds an alias regression test.
@greptile-apps

greptile-apps Bot commented Jul 30, 2026

Copy link
Copy Markdown

Reviews (2): Last reviewed commit: "fix(dashboards): resolve YAML aliases in..." | Re-trigger Greptile

@TanayBensuYurtturk
TanayBensuYurtturk merged commit f09ea38 into main Jul 30, 2026
3 checks passed
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.

2 participants