Skip to content

0.8.0: the config window keeps no global config beside the global state (ObjectState 4) - #30

Merged
trissim merged 1 commit into
mainfrom
refactor/objectstate-4-one-global-config-holder
Oct 12, 2026
Merged

trissim merged 1 commit into
mainfrom
refactor/objectstate-4-one-global-config-holder

Conversation

@trissim

@trissim trissim commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

ObjectState 4.0.0 (OpenHCSDev/ObjectState#56) makes the state registered at the global scope the one holder of the global config: an edit of that state is the live global config, mark_saved is the saved one, restore_saved and a checkpoint restore put both back. Everything the config window did to keep the old stores in step with the state is therefore derived, and is deleted.

Deleted from pyqt_reactive.windows.config_window, with the reason

Deleted Reason
ConfigEditSession.apply_code_edit_context (wrote the live store on a code edit) derived: the next line applies the code edit to the form, which edits the state
GlobalConfigContextCheckpoint, capture_global_context, restore_global_context (store captured and put back beside the state checkpoint in save_config) derived: ObjectStateTransactionCheckpoint.restore(state) restores the global state
publish_saved_global_config (saved and live writes after mark_saved) derived: mark_saved is the save
restore_global_context_if_dirty, _original_live_global_config (live store put back on cancel) derived: the restore policy calls restore_saved on the state
global_context_dirty, mark_global_field_changed and its parameter_changed connection unused once the two above are gone (only they read the flag)
saving, begin_save_callback, end_save_callback unused: only guarded mark_global_field_changed
is_global_config unused after the above
ConfigWindow._apply_config_from_code_document forwarding: it only called CodeEditorFormUpdater.update_form_from_instance

No other caller of the removed ObjectState names in src (grep for every removed name); tests/test_provenance_navigation.py renames set_global_config_for_editing to set_global_config.

Test

tests/test_config_window.py::test_global_config_follows_the_window_through_edit_cancel_save_and_failed_save: through a window on the registered global state, a code edit, a cancel, a save the participant refuses and a save move the live and the saved global config and what a registered descendant inherits, with nothing but the state.

Callers

Removed public members of ConfigEditSession, so this is 0.8.0. OpenHCS tests/unit/pyqt_gui/test_config_window_transaction.py uses several of them (listed for the OpenHCS bump). Behaviour: a window whose global-config state is not registered at the global scope no longer changes the global config.

Requires objectstate>=4.0.0,<5, formbridge>=0.1.4,<0.2. Full suite in a fresh venv with both from PyPI: 594 passed, 1 skipped. Ruff fatal checks and the added-lines check pass.

🤖 Generated with Claude Code

ObjectState 4 makes the state registered at the global scope the one holder
of the global config, so everything the window did to keep the stores in
step with that state is derived and deleted: the live write on a code edit,
the capture and restore of the stores beside the state checkpoint, the
saved and live writes after mark_saved, the restore of the live store on
cancel, and the dirty and saving flags that only guarded them.

Requires objectstate>=4.0.0,<5 and formbridge>=0.1.4,<0.2. CHANGELOG.md
lists each removed name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 12, 2026 17:17
@trissim
trissim merged commit 1c0f35f into main Oct 12, 2026
12 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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