Skip to content

Conversation

@fderuiter
Copy link
Owner

@fderuiter fderuiter commented Jan 21, 2026

This pull request removes the Textual-based Terminal User Interface (TUI) from the codebase and migrates key TUI logic into the core SDK and CLI. It also introduces several improvements to the SDK, including new subject filtering methods, improved job state checks, and enhanced validation for form submissions. The most important changes are summarized below.

Removal of TUI Functionality

  • The TUI application and its related code (imednet/tui/app.py, imednet/tui/form_builder.py) have been fully deleted, and the textual dependency has been removed from pyproject.toml. Users are now directed to use CLI commands instead. [1] [2] [3]
  • TUI entry points in both the CLI (imednet/cli/__init__.py) and example scripts (examples/build_form_payload.py) have been replaced with messages indicating TUI mode is no longer available. [1] [2]

Migration and Enhancement of Business Logic

  • The logic for filtering subjects by site, previously in the TUI, is now available as list_by_site and async_list_by_site methods on the SubjectsEndpoint in the SDK, improving accessibility and testability.

SDK Improvements

  • The Job model now includes is_terminal, is_successful, and is_failed properties for easier job state checks, migrated from TUI logic.
  • The save_form method in FormDesignerClient now includes input validation for CSRF key, form ID, community ID, and revision, ensuring errors are caught early. This logic was migrated from the TUI.

Minor Improvements

  • Added missing type import (List) to imednet/endpoints/subjects.py for type annotations.

google-labs-jules bot and others added 14 commits January 15, 2026 16:20
- Enhanced `Job` model with `is_terminal`, `is_successful`, and `is_failed` properties.
- Added `list_by_site` and `async_list_by_site` to `SubjectsEndpoint` for site-based filtering.
- Added validation to `FormDesignerClient.save_form` for `form_id`, `community_id`, `revision`, and `csrf_key`.
- Added unit tests in `tests/unit/test_tui_migration.py`.
- Removed `imednet/tui` directory.
- Removed `textual` dependency.
Migrated business logic from the deprecated TUI into the core SDK:
- `Job` model: Added `is_terminal`, `is_successful`, `is_failed` properties.
- `SubjectsEndpoint`: Added `list_by_site` and `async_list_by_site` for filtering.
- `FormDesignerClient`: Added input validation to `save_form`.

Removed the TUI application:
- Deleted `imednet/tui` directory.
- Removed `textual` dependency from `pyproject.toml`.
- Updated CLI and examples to reflect removal.

Added verification tests in `tests/unit/test_tui_migration.py`.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Frederick de Ruiter <127706008+fderuiter@users.noreply.github.com>
Refactors `ListGetEndpointMixin` in `imednet/endpoints/_mixins.py` to:
- Enforce strict typing using `TypeVar`, `Protocol`, and generics.
- Decompose `_list_impl` into smaller, focused methods (`_prepare_list_params`, `_execute_sync_list`, `_execute_async_list`).
- Separate sync and async execution paths to avoid runtime type checking.
- Updates `BaseEndpoint` to remove dead code (`_fallback_from_list`) and improve typing.
- Updates `UsersEndpoint` to strict typing.
- Adds `.jules/architect.md` for architectural decision logging.
Refactors `ListGetEndpointMixin` in `imednet/endpoints/_mixins.py` to:
- Enforce strict typing using `TypeVar`, `Protocol`, and generics.
- Decompose `_list_impl` into smaller, focused methods (`_prepare_list_params`, `_execute_sync_list`, `_execute_async_list`).
- Separate sync and async execution paths to avoid runtime type checking.
- Updates `BaseEndpoint` to remove dead code (`_fallback_from_list`) and improve typing.
- Updates `UsersEndpoint` to strict typing.
- Adds `.jules/architect.md` for architectural decision logging.
- Formatted with black.
Reformatted the file using black to comply with project coding standards.
…ct.iscoroutinefunction patterns

Co-authored-by: fderuiter <127706008+fderuiter@users.noreply.github.com>
… imports

Co-authored-by: fderuiter <127706008+fderuiter@users.noreply.github.com>
Co-authored-by: fderuiter <127706008+fderuiter@users.noreply.github.com>
Co-authored-by: fderuiter <127706008+fderuiter@users.noreply.github.com>
Co-authored-by: fderuiter <127706008+fderuiter@users.noreply.github.com>
Co-authored-by: fderuiter <127706008+fderuiter@users.noreply.github.com>
Co-authored-by: fderuiter <127706008+fderuiter@users.noreply.github.com>
@fderuiter fderuiter merged commit f31aa17 into main Jan 28, 2026
13 checks passed
@fderuiter fderuiter deleted the refactor branch January 28, 2026 02:32
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