Skip to content

feat(settings): Create Extra Fields by Formula via built-in JSON editor#874

Closed
akira69 wants to merge 4 commits intoDonkie:masterfrom
akira69:feat/complex-fields-framework
Closed

feat(settings): Create Extra Fields by Formula via built-in JSON editor#874
akira69 wants to merge 4 commits intoDonkie:masterfrom
akira69:feat/complex-fields-framework

Conversation

@akira69
Copy link
Copy Markdown

@akira69 akira69 commented Mar 2, 2026

Now addressed in PR #885

Summary

This PR adds Formula Extra Fields as a user-facing workflow in Settings so people can create reusable calculated values from existing fields without changing stored source data.

In practical use, this helps users build cleaner dates, usage deltas, cost math, and template-ready derived values directly in the app.

betterbugs_recording.webm

User-Facing Outcomes

  • Create per-entity formula fields (Spool, Filament, Manufacturer).
  • Author formulas with a JSON Logic editor and token groups (Operators, Helper Functions, Field References).
  • Validate formulas with sample values and preview before saving.
  • Control where each formula appears: Show, List, Template.
  • Optionally allow list-surface formulas to participate in Hide Columns toggling.
  • Expose selected formula fields in API derived payloads as derived.<key>.

What Changed

1) Formula Authoring Workflow

  • Adds Formula Extra Fields as a first-class workflow in Extra Fields settings.
  • Uses token-based JSON insertion for faster authoring and fewer syntax mistakes.
  • Supports helper-first insertion with compatibility hints and placeholder insertion.

2) create/edit formula field flow

  • new "formula extra fields" section under the "Extra Fields" Settings
image - Formula Extra Field Edit Page (simple) image - Expandable/Collapsable Sections for Clickable Operators, Helper Functions and Field References with considerate layout density image - Type-Aware and clickable functions to fill JSON image

3) Editor + Help UX

  • dark-mode multi-line selection visibility in the JSON editor.
image - Aligned help/settings documentation with formula-focused guidance and terminology. image image image

4) Template/List/API Integration

  • Template-enabled formula fields are available to templates as derived values.
  • List-surface formulas can opt into Hide Columns visibility toggling.
  • API inclusion is field-level via include_in_api, exposed under derived.<key> when derived output is requested.
image
  • template usage example using {derived.your_key}
image
  • API response snippet with derived payload
image

Validation

  • Python syntax check passed for touched backend files.
  • Frontend production build passed (npm ci && npm run build in Dockerized Node build environment).
  • Local Docker runtime verified on port 8874 with successful probe.

Scope Notes

  • Formula-focused scope in this PR.
  • Complex framework is tracked separately in #878.

Upstream Issue / Feature Request Mapping

Fully Addressed

Partially Addressed by Formula Framework

Formula-Resolvable Requests (No Dedicated Issue Found)

  • Time since purchase: {"days_between": [{"var": "created_at"}, {"today": []}]}
  • Remaining value estimate: {"*": [{"var": "price"}, {"/": [{"var": "remaining_weight"}, {"var": "weight"}]}]}

Additional Drying Context

  • Refs Add support for tracking drying of spools #711
    • Custom extra fields plus formula fields can model parts of the drying-tracking workflow, such as storing a manual last_dried timestamp and deriving time-since-last-dried, but this PR does not add first-class drying fields or dedicated drying UI.

@akira69 akira69 closed this Mar 2, 2026
@akira69 akira69 reopened this Mar 2, 2026
@akira69 akira69 changed the title feat(settings): add complex fields and formula field framework feat(settings): formula field framework and JSON authoring UX Mar 7, 2026
@akira69 akira69 force-pushed the feat/complex-fields-framework branch from 74b5b76 to b7cd0cf Compare March 10, 2026 05:42
@akira69 akira69 closed this Mar 10, 2026
@akira69 akira69 deleted the feat/complex-fields-framework branch March 10, 2026 13:13
@akira69 akira69 restored the feat/complex-fields-framework branch March 10, 2026 13:18
@akira69 akira69 reopened this Mar 10, 2026
@akira69 akira69 changed the title feat(settings): formula field framework and JSON authoring UX feat(settings): Create Extra Fields by Formula via built-in JSON editor Mar 12, 2026
@akira69 akira69 closed this Mar 16, 2026
@akira69 akira69 deleted the feat/complex-fields-framework branch March 16, 2026 16:54
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.

Display HEX value on Filament Details page

1 participant