Repository navigation
Cut 5 Textual/widget import chains out of toad.client (22 -> 17) - #2228
Merged
Merged
Conversation
- Move Textual-only toad.client.fragment_states to toad.widgets.fragment_states (only imported by toad.widgets.transcript_history), eliminating the last toad.widgets import under toad.client.
- Type SettingsDeclaration and ObjectConfiguration against toolkit-neutral ViewSettingsOwner (toad.client.view_settings) instead of Textual's DOMNode-derived SettingsScope, freeing toad.client.{message_files,prompt_composer,sort_control} from Textual.
- AgentBase.change_project: call shared FlashHost.flash_success() instead of Textual's view.feedback.flash(Content(...), style='success'), removing textual.content from toad.agent and fixing Qt parity.
- toad.directory & toad.path_search_ranking: replace textual._partition.partition and textual.cache.LRUCache with stdlib helpers, freeing toad.client.project_paths from Textual.
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.
Summary
Cuts 5 unnecessary Textual /
toad.widgetsimport chains out oftoad.client:src/toad/client/fragment_states.pytosrc/toad/widgets/fragment_states.py(its sole importer istoad.widgets.transcript_history), removing the lasttoad.widgetsimport undertoad.client.SettingsDeclaration(setting_declarations.py) andObjectConfiguration(object_configuration.py) from Textual'sSettingsScope(DOMNode) to toolkit-neutralViewSettingsOwner(toad.client.view_settings), which everySettingsDeclaration(scopes=...)already uses.view.feedback.flash(Content(...), style='success')inAgentBase.change_project(agent.py) withview.flash_success(...)(FlashHost), droppingtextual.contentfromtoad.agentand makingchange_projectwork on Qt too.textual._partition.partitionindirectory.pyandtextual.cache.LRUCacheinpath_search_ranking.pywith stdlib helpers, freeingtoad.client.project_pathsfrom Textual.Checks
toad.client -> textualcount dropped from 22 -> 17 (0toad.widgetsimports undertoad.client).tools/guarded_imports.py: 0.pytest -q tests/guards/test_shared_hook_sequences.py tests/model/test_message_files.py tests/guards/test_deleted_interface_mechanisms.py tests/guards/test_test_layers.py: 60 passed.