Conversation
Add text edit filter. Delete pip installation
There was a problem hiding this comment.
Pull request overview
This PR appears to be a “2.1” release update that shifts ParamUI toward a single-file consumption model and adds UI enhancements for string parameters (regex validation) plus a small UX tweak for flat parameter tables.
Changes:
- Added regex pattern validation for textbox parameters (live feedback + reject invalid commits).
- Auto-minimized the navigation tree when the parameter hierarchy is flat (root-only).
- Updated README install/docs accordingly and removed legacy packaging entrypoints.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
setup.py |
Removed setuptools-based packaging script (implies moving away from pip install distribution). |
README.md |
Documented regex validation + navigation behavior and updated installation instructions. |
paramui/__init__.py |
Removed package-level re-export (consistent with single-module usage). |
paramui.py |
Implemented regex textbox validation and navigation tree auto-minimize behavior. |
Comments suppressed due to low confidence (5)
paramui.py:771
stepis treated as a regex pattern for any non-empty string (except*.…/folder). This will misclassify sentinel strings likefile/buttonas regex patterns (and even reject initial values that don't match). Consider excluding non-regex sentinel values from pattern registration.
This issue also appears in the following locations of the same file:
- line 809
- line 844
paramui.py:846
- Headless initialization registers regex patterns for any non-empty string
step(even wheninitial_valueis not a string), and doesn't exclude sentinel values likefile. This can cause unexpected validation behavior later. Align the condition with the UI path (string-valued + pattern-looking steps only).
paramui.py:919 - The docstring says valid text becomes "green/default", but the implementation doesn’t set green and (after this PR) hardcodes black for valid text. Update the docstring to match the actual behavior (or change the behavior to truly restore the default color).
This issue also appears on line 983 of the same file.
paramui.py:986
_apply_pattern_colorhardcodesfg='black'for valid input, which doesn’t reliably restore the widget’s original/default foreground (and can be unreadable in dark themes). Prefer resetting to the default foreground instead of forcing black.
paramui.py:813- The new regex-textbox branch triggers for any non-empty string
step. That means sentinel strings likefile(or any other future string-based widget type) will be treated as regex validation. Make the regex branch conditional on successful pattern registration instead (e.g.,variable in self.patterns).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ['Flag', 'Flag 1', True, []], # Checkbox | ||
| ['Text', 'Text Input', 'ABC', []], # Textbox | ||
| ['Name', 'Name', 'Taro', '[A-Za-z ]{0,32}'], # Textbox with regex pattern validation | ||
| ['Options/File', 'File Path', '*.txt', 'file'], # File browser |
Comment on lines
+21
to
26
| ### Method 1: Download to the current folder using wget: | ||
| ```bash | ||
| pip install git+https://github.com/covao/ParamUI | ||
| wget https://raw.githubusercontent.com/covao/ParamUI/main/paramui/paramui.py | ||
| ``` | ||
| ### Method 2: Download the source code | ||
| Download [paramui.py](./paramui/paramui.py) and place it in your project directory |
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.
No description provided.