Skip to content

feat(dialog-protocol): widget channels + Image codec for the Mosaico toolbox#93

Merged
facontidavide merged 5 commits into
mainfrom
gor/toolbox-mosaico-deps
May 25, 2026
Merged

feat(dialog-protocol): widget channels + Image codec for the Mosaico toolbox#93
facontidavide merged 5 commits into
mainfrom
gor/toolbox-mosaico-deps

Conversation

@GNERSIS
Copy link
Copy Markdown
Collaborator

@GNERSIS GNERSIS commented May 25, 2026

What

Adds the dialog-protocol widget channels the Mosaico toolbox needs — RangeSlider, SequencePicker date-range, MetadataQueryBar, QDateTimeEdit, and QTableWidget visible-row filtering + cell styling — plus the requestClose panel command, the canonical Image byte codec, and the toolbox object-write API for ObjectStore.

All additions are header-only / additive; no existing plugin ABI break.

Review

Automated code review: no blockers, additive + ABI-safe (inline-only views, recompiled per plugin). Follow-up (non-blocking): visibleRows cannot distinguish null-cleared from missing — now documented; a 3-state contract is deferred. New channels are exercised end-to-end by PJ4 + the Mosaico plugin; dedicated round-trip tests are a follow-up.

🤖 Generated with Claude Code

GNERSIS and others added 2 commits May 25, 2026 20:00
…toolbox

Adds the RangeSlider, SequencePicker date-range, MetadataQueryBar, QDateTimeEdit
and QTableWidget filter/cell-style channels, the requestClose panel command, the
canonical Image byte codec, and the toolbox object-write API the Mosaico plugin
builds on.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adapt the rebased Mosaico-deps work to main's current state:
- ABI sentinel: PJ_toolbox_host_vtable_t grew 72->88 bytes when this
  branch appended register_object_topic / push_owned_object; pin the two
  new tail-slot offsets and bump the size assertion.
- arrow_stream_round_trip_test: a test case added on main still used the
  pre-rebase 1-arg DatastoreToolboxHost(engine); supply the ObjectStore
  the constructor now requires.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@facontidavide facontidavide force-pushed the gor/toolbox-mosaico-deps branch from cf5cc7b to dea2be1 Compare May 25, 2026 18:09
Davide Faconti and others added 3 commits May 25, 2026 20:22
Bring SDK docs in line with the Mosaico-deps surface added on this branch:
- dialog-plugin-guide: add RangeSlider, SequencePicker, MetadataQueryBar,
  QDateTimeEdit and the QTableWidget filter/style setters to the widget
  table; document onHeaderClicked / onQuerySelector / requestClose.
- toolbox-guide: document registerObjectTopic / pushOwnedObject with a
  serializeImage example and the older-host degradation caveat.
- ARCHITECTURE: note the toolbox host's object-topic write slots are
  tail-appended under ABI v5 (struct_size-gated, no version bump) and now
  require an ObjectStore& at construction.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Backward-compatible release: adds the toolbox object-write API and dialog
widget channels (tail-appended ABI slots, additive SDK), so a PATCH bump
over 0.3.0 per the project's 0.MINOR.PATCH convention.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Document the release policy: each PR should propose a version bump —
MINOR for API/ABI breaks, PATCH for backward-compatible changes — with
conanfile.py and CMakeLists.txt kept in sync, and tagging/pushing gated
on explicit approval.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@facontidavide facontidavide merged commit 22b05ab into main May 25, 2026
2 checks passed
@facontidavide facontidavide deleted the gor/toolbox-mosaico-deps branch May 25, 2026 18:27
facontidavide added a commit that referenced this pull request May 26, 2026
* feat(sdk): add pj.settings.v1 service + setButtonIconNamed dialog field

Two additions plugins requested while porting the Mosaico toolbox to be Qt-free.

pj.settings.v1 — an optional, QSettings-like key/value store, Qt-free for plugins.
The whole service lives in the plugin SDK (pj_base), header-only:
- C ABI PJ_settings_store_t/_vtable_t (plugin_data_api.h): string get/set, native
  string-list get/set, contains, remove; getter out-params valid until the next
  call on the store.
- Plugin side — sdk::SettingsView + sdk::SettingsValue (plugin_data_api.hpp):
  QSettings-flavored setValue(key, v) overloads (string/int64/double/bool/
  stringlist) and value(key).toString()/.toInt()/.toDouble()/.toBool()
  (QVariant-like), plus valueStringList/contains/remove. Scalars (de)serialize
  via to_chars/from_chars.
- sdk::SettingsStoreService trait (service_traits.hpp).
- Host side — sdk/settings_store_host.hpp (header-only): SettingsBackend interface
  (the GUI app implements it over QSettings), SettingsStoreHost adapter owning the
  getter scratch buffers, InMemorySettingsBackend for tests/headless hosts.
- Unit test (pj_base/tests): scalar/list round-trips, defaults, bool parsing,
  contains/remove.

setButtonIconNamed(widget, icon_id) — dialog field (button_icon_name) so plugins
reference the host's themed icon set instead of shipping SVG bytes; resolution
lives in the host. Mirrors setButtonIcon(svg).

Docs: ARCHITECTURE service list + dialog-sdk-reference updated.

Verified: ./build.sh builds core; settings_store_host_test passes.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* refactor(dialog-protocol): de-Mosaico the dialog protocol

Remove the Mosaico-specific surface that #93 added to the generic dialog
protocol, keeping only generic, reusable building-block channels:

- Drop the MetadataQueryBar channel entirely: setQuery{Keys,Operators,Values,
  Completions,Schema,Feedback} + their WidgetDataView getters, the QuerySelector
  event/builder, and the onQuerySelector callback + dispatch. The query bar is a
  single-plugin widget and no longer lives in the host; plugins own their query
  language and render feedback via generic text fields.
- Drop the Mosaico "every_day" recurrence flag from DateRangeFilter, the
  dateRangeChanged event/builder, and onDateRangeChanged. A generic date-range
  picker emits only (from_iso, to_iso); recurrence is a plugin concern.
- Rename SequencePicker -> DateRangePicker in comments/labels.
- Add a generic setFieldValid(name, ok, tooltip) hook (+ fieldValid/
  fieldValidTooltip readers): the plugin owns the validation rule, the host
  renders the indicator. This also fulfills the validation-indicator gap noted
  in toolbox-porting-gap-analysis.md.

Update dialog-plugin-guide.md, dialog-sdk-reference.md, and
toolbox-porting-gap-analysis.md to match. Builds clean; dialog-protocol tests
pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(sdk): surface settings read faults via Expected; bump to 0.4.0

SettingsView::value/valueStringList/contains now return PJ::Expected so a
host backend fault is reported instead of being silently collapsed into an
absent key. An unbound store (optional service) or a missing key stays a
graceful default in a successful Expected, so !has_value() means exactly a
real host error — consistent with the SDK's other fallible read views.

Also correct the misleading "(v4)" label on the settings and colormap ABI
service comments (both are protocol v1), and add test coverage for the
exception→PJ_error_t path, unbound-view degradation, scratch-buffer read
independence, and the new dialog fields (setButtonIconNamed, setFieldValid,
2-arg dateRangeChanged).

Bump 0.3.1 -> 0.4.0: MINOR, since the dialog-protocol refactor removes
source-visible SDK symbols.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* refactor(dialog-protocol): generalize date hint to two-sided setDateRangePlaceholder

Finish the Layer-1 de-Mosaico cleanup of the dialog protocol: replace the
single-sided setDatePickerEarliest / picker_earliest accessor with a two-sided,
Qt-idiomatic setDateRangePlaceholder(name, earliest_iso, latest_iso) (host
readers dateRangeEarliest / dateRangeLatest, JSON date_range_earliest/latest).
It stays a soft placeholder hint — mirroring QLineEdit::setPlaceholderText, not
a selectable-range constraint — and now lets a DateRangePicker hint both ends of
the dataset's available span.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Davide Faconti <dfaconti@aurynrobotics.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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