Skip to content

fix(thread): respect is_optional on dataset selection screen#647

Merged
mosoriob merged 5 commits intomasterfrom
feat/raw-outputs-fallback
May 4, 2026
Merged

fix(thread): respect is_optional on dataset selection screen#647
mosoriob merged 5 commits intomasterfrom
feat/raw-outputs-fallback

Conversation

@mosoriob
Copy link
Copy Markdown
Contributor

@mosoriob mosoriob commented May 3, 2026

Summary

Thread datasets selection UI treated optional model inputs as required: orange warning icon, "None selected" gating model done state.

is_optional was wired through REST API (Phase 12-02/03/04) but the thread page reads via Apollo get_thread directly against Hasura, bypassing REST plumbing. Junction column was never selected, mapped, or rendered.

Changes

  • queries/thread/get.graphql + get-subscription.graphql: select is_optional on modelcatalog_configuration_input junction
  • util/graphql_adapter.ts: map item.is_optional -> ModelIO.isOptional
  • screens/models/reducers.ts: add isOptional?: boolean to ModelIO
  • screens/modeling/thread/thread-expansion-datasets.ts:
    • getStatus skips optional inputs when computing done
    • modelDone short-circuits true on optional inputs
    • renderRequiredDatasetRow renders grey info icon + (optional) label instead of orange warning when optional and unselected

Test plan

  • Load thread with hello world file input test model
  • Optional Input row shows grey info icon + "(optional)" suffix when nothing selected (not orange warning)
  • Required Input row still shows orange warning when nothing selected
  • Model header status no longer flags warning if only optional inputs are unset
  • Selecting a dataset for the optional input still works (green check)
  • Required input selection still gates model done state

Follow-up

mint-datasets.ts has the same pattern — tracked in .planning/todos/pending/2026-05-03-mint-datasets-optional-input-warning.md.

Companion bump: dynamo PR https://github.com/In-For-Disaster-Analytics/dynamo/pull/6

mosoriob added 5 commits May 3, 2026 19:28
Thread datasets UI treated optional model inputs as required: orange
warning icon, "None selected" gating model done state. is_optional was
wired through REST API but the thread page reads via Apollo get_thread
directly against Hasura, bypassing REST plumbing.

- Select is_optional on modelcatalog_configuration_input junction in
  get_thread + get_thread_subscription
- Map item.is_optional -> ModelIO.isOptional in graphql_adapter
- Add isOptional?: boolean to ModelIO interface
- thread-expansion-datasets: skip optional inputs in getStatus and
  modelDone; render grey info icon + (optional) label when optional and
  unselected, instead of orange warning
…nselected

mint-datasets._selectThreadDatasets gated allok on bindings.length==0
without checking input.isOptional, so the Framing -> Parameters Continue
button alerted 'Please select atleast one dataset' for any unselected
optional input. Skip the ok=false branch when input.isOptional.
Per-input log line shows model, input name, isOptional, dataset count,
dt count, empty/blocks flags. Per-model summary shows ok. Final allok
logged. Helps diagnose 'Please select atleast one dataset' alerts.
- Grey info icon + (optional) label for empty optional inputs in dataset selection section
- Orange warning icon retained for required empty inputs
- Gating logic (blocks = empty && !input.isOptional) unchanged
- Debug console.groupCollapsed block preserved verbatim
@mosoriob mosoriob merged commit 888ec50 into master May 4, 2026
5 of 6 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.

1 participant