feat(frontend): add UDF parameters from the panel - #7551
Open
carloea2 wants to merge 8 commits into
Open
Conversation
…anel Adding a parameter in the Python UDF properties panel now writes the self.UiParameter(...) declaration into the code, creating open() when the UDF class does not define one. The code stays the single source of truth: the add action only edits the shared Y.Text code buffer and the row appears through the existing parse/merge sync loop.
…r declarations A template whose statements are still commented out parses as a class body holding only comments and a lezer error node. The error node was treated as an anchor statement, so the synthesized open() landed at module level at the end of the file. Filter error nodes out and, when a class or open() body has no real statements yet, insert right after the header line with one extra indent level.
…t rule All placement cases (docstrings, decorators, pass-only, commented-out, and empty bodies) collapse into a single rule shared by class and open(): insert before the first real statement, or right after the header line when the body has none yet. parse() and the insertion share the class discovery and call traversal, and the add form becomes a single always-visible row with the name validation living only in the parser.
…d tables Each placement case is now a single annotated file where '>' marks the inserted lines, so input and expected output are derived from one copy; every case re-parses its result, absorbing the separate round-trip tests. The redundant undecorated-open case and duplicated fixtures are gone.
The standalone name/type/Add strip read as another parameter row. It is now a dashed 'Add parameter' button under the list that opens a draft row in the same three-column grid, confirmed with a check button or Enter and dismissed with close or Escape.
carloea2
marked this pull request as ready for review
August 11, 2026 08:12
Contributor
Automated Reviewer SuggestionsBased on the
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #7551 +/- ##
============================================
- Coverage 87.87% 87.83% -0.05%
Complexity 4275 4275
============================================
Files 1176 1176
Lines 46890 46981 +91
Branches 5228 5247 +19
============================================
+ Hits 41205 41265 +60
- Misses 3961 3987 +26
- Partials 1724 1729 +5
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
Author
|
@aicam can you review it? |
Contributor
Author
|
/request-review @aicam |
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.
What changes were proposed in this PR?
This PR lets users add Python UDF parameters directly from the properties panel.
The parameter list now includes a dashed Add parameter button. Clicking it opens an inline draft row where the user can enter a name, select a supported type, and confirm with the check button or Enter, or cancel with the close button or Escape.
Confirming the draft inserts a
self.UiParameter(...)declaration into the operator's shared Python code. The code remains the single source of truth: the parameter row appears through the existing parse-and-sync flow instead of being written directly into the form model.The insertion logic:
UiParameterdeclarations;open()method when available;open()when it is absent;pass, comments, and empty class bodies;Any related issues, documentation, discussions?
Closes #7552
How was this PR tested?
Manual verification by the author covered the add, confirm/cancel, declaration insertion, and properties-panel synchronization flows.
Frontend CI formatting and lint:
cd frontend yarn format:ciThe command passes.
The updated specifications cover component actions and error states, shared-code insertion and synchronization, declaration placement, identifier sanitization, duplicate names, unsupported types, unsupported classes, and malformed class bodies.
Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code Fable 5 Ultra, OpenAI Codex 5.6 Ultra, and Me