feat(dialog-protocol): widget channels + Image codec for the Mosaico toolbox#93
Merged
Conversation
…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>
cf5cc7b to
dea2be1
Compare
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
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
requestClosepanel command, the canonicalImagebyte codec, and the toolbox object-write API forObjectStore.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):
visibleRowscannot 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