Repository navigation
feat(core): support global and contextual downIsGood configuration (#3297) - #3323
FrancescoCastaldi wants to merge 7 commits into
Conversation
|
Someone is attempting to deploy a commit to the Evidence Team on Vercel. A member of the Team first needs to authorize it. |
|
Hi @archiewood @hughess! 👋 Whenever you have a moment, could you please take a look at this PR and approve the CI workflow? Thank you! |
|
@FrancescoCastaldi do you have any examples where this configuration would be useful? We typically see |
|
@hughess Sure — the main use case comes from financial and cost-oriented dashboards where the majority of metrics on a page (or section) benefit from inverted polarity. Concrete examples:
The pattern is: when a dashboard page or section is thematically about costs, errors, or durations, the default polarity inverts for the whole group — not for isolated metrics. Setting it once at page or wrapper level removes repetition and reduces the risk of forgetting it on one component (which creates a confusing inconsistency for the end user). Even though Happy to simplify the scope if needed — for instance, we could start with just the |
|
That makes sense, thanks for the background. I think to start we should only apply the option at the page level - we can add the project configuration option later assuming the page one works well. If you're able to update to only have this at page level, I can get the process started to get this change in! |
ae1fa8f to
c1b85d0
Compare
|
@hughess Updated! As requested, I've narrowed the scope to support The PR has also been cleanly restructured into 6 atomic commits:
Ready for review whenever you get a chance! |
|
/upstream |
|
Imported for internal review, this PR will be updated when it merges. |
|
Thanks @FrancescoCastaldi, appreciate you narrowing the scope! I've brought this into our internal repo and made a few follow-up changes on top of your commit:
It'll sync back here with your authorship when it merges. This PR will show as closed rather than merged, which is expected for the mirror. |
|
@hughess That's awesome, thanks a lot for catching those schema default edge cases and integrating it into Studio and the docs! Excited to see it land. Thanks again! 🙌 |
… drop downIsGood alias
|
@hughess Just pushed those exact follow-up tweaks to this PR branch as well ( |
Closes #3297
Description
This PR introduces global, page-level, and wrapper-context
downIsGood(down_is_good) default configuration for<Delta>,<BigValue>,<Table>, and related comparison components.In cost and finance dashboards, an increase is often negative (costs went up) and a decrease is positive (costs went down). Previously, authors had to add
down_is_good={true}to each individual component.Changes
<DeltaDefaults>tag:DeltaDefaultsContext(delta-defaults.context.svelte.ts)<DeltaDefaults down_is_good={true}>/<DeltaDefaults downIsGood={true}>wrapper componentdown_is_goodanddownIsGoodtoprojectRootPageFrontmatterSchemaandprojectLayoutSchemapageSettingsSchemaand CLI page settings resolution to pass layout & frontmatter defaultsdefaultsanddeltablocks tothemeConfigSchemaandthemeOverridesSchemaDeltaDisplay:comparison.down_is_good/downIsGood)<DeltaDefaults>contextdown_is_good/downIsGood)falsedelta-defaults.test.tsfor schema validation and default inheritancefiles.server.test.ts