Skip to content

UI extension improvements: sorting, registry path, field colors#216

Merged
ptomecek merged 7 commits into
mainfrom
pit/ui-improvements
May 27, 2026
Merged

UI extension improvements: sorting, registry path, field colors#216
ptomecek merged 7 commits into
mainfrom
pit/ui-improvements

Conversation

@ptomecek
Copy link
Copy Markdown
Collaborator

Several small, independent improvements to the Panel-based UI extension in `ccflow/ui/`. All cosmetic / quality-of-life; no behavior changes outside the UI.

Commits

  • Add `sort_children` option to `RegistryBrowser` UI extension. Boolean param (default `True`) that sorts child entries alphabetically by name at every nested `ModelRegistry` level. Set to `False` to restore insertion order.
  • Display selected model's registry path in Summary tab. Shows the full slash-separated registry path at the top of the Summary tab, formatted similarly to the existing Registry Dependencies section. Plumbed through as plain instance attributes (set in lockstep with each model assignment) so the existing model watcher renders both together.
  • Color-code field name, type, and description in Pydantic model viewer. Tiny `_FIELD_STYLES` dict mapping kinds (`name`, `type`, `description`) to inline CSS, applied in `ModelTypeViewer`'s field list and the top "Type:" line. Light syntax-highlighting palette (blue / purple / muted-italic gray). Extending is one dict entry.
  • Default `sort_children` to `True` on both `RegistryBrowser` and `ModelRegistryViewer` so children render alphabetically out of the box.
  • Sort subregistries before models when `sort_children` is enabled — file-browser style: subregistries (alphabetical) first, then leaf models (alphabetical).
  • Render registry dependencies in monospace for visual consistency with the new Registry Path display above them.

Not in this PR

A separate follow-up will tackle viewport-scaling and a draggable sidebar/main divider via `pmui.Page`. Tracking that on its own branch.

ptomecek added 6 commits May 27, 2026 09:19
Adds a boolean sort_children parameter (default False) to RegistryBrowser
and ModelRegistryViewer. When True, child entries are sorted
alphabetically by name at every nested ModelRegistry level. Default
preserves existing insertion-order behavior.

Signed-off-by: Pascal Tomecek <pascal.tomecek@cubistsystematic.com>
Adds the full slash-separated registry path of the currently selected
model to the top of the Summary tab, formatted similarly to the existing
Registry Dependencies section. The path is plumbed from RegistryBrowser
through ModelRegistryViewer and ModelViewer as plain instance
attributes, set in lockstep with (and before) each model assignment so
the existing model watcher renders both together.

Signed-off-by: Pascal Tomecek <pascal.tomecek@cubistsystematic.com>
Introduces a small _FIELD_STYLES dict mapping kinds (name, type,
description) to inline CSS, and applies them in ModelTypeViewer's field
list and the top 'Type:' line. Colors follow a GitHub-light-style
palette (blue for names, purple for types, muted gray italic for
descriptions). Adding a new kind requires only one dict entry.

Signed-off-by: Pascal Tomecek <pascal.tomecek@cubistsystematic.com>
Flips the default for sort_children on both RegistryBrowser and
ModelRegistryViewer so children render alphabetically out of the box.
Set sort_children=False to restore insertion order.

Signed-off-by: Pascal Tomecek <pascal.tomecek@cubistsystematic.com>
When sort_children is enabled, group child entries like a file browser:
subregistries listed first (alphabetical), then leaf models
(alphabetical). Achieved with a tuple sort key (not is_registry, name).

Signed-off-by: Pascal Tomecek <pascal.tomecek@cubistsystematic.com>
Wraps each Registry Dependencies entry in <code> so paths render in the
same monospace font as the Registry Path shown above them.

Signed-off-by: Pascal Tomecek <pascal.tomecek@cubistsystematic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 27, 2026

Test Results

843 tests  ±0   841 ✅ ±0   1m 45s ⏱️ +2s
  1 suites ±0     2 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 902e3e8. ± Comparison against base commit 99a1fd8.

♻️ This comment has been updated with latest results.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 27, 2026

Codecov Report

❌ Patch coverage is 96.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 95.37%. Comparing base (17905fb) to head (902e3e8).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
ccflow/ui/registry.py 94.11% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #216   +/-   ##
=======================================
  Coverage   95.37%   95.37%           
=======================================
  Files         142      142           
  Lines       11404    11428   +24     
  Branches      620      623    +3     
=======================================
+ Hits        10876    10899   +23     
  Misses        399      399           
- Partials      129      130    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Pascal Tomecek <pascal.tomecek@cubistsystematic.com>
@ptomecek ptomecek marked this pull request as ready for review May 27, 2026 16:26
@ptomecek ptomecek merged commit 68a35ff into main May 27, 2026
12 checks passed
@ptomecek ptomecek deleted the pit/ui-improvements branch May 27, 2026 17:46
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