Skip to content

Conversation

@james-strauss-uwa
Copy link
Collaborator

@james-strauss-uwa james-strauss-uwa commented Jan 7, 2026

Just added the "filled" class to the icons if the flags are enabled.

Also, only show precious and positional if field is an Application Argument. Added a "knockout if" around the icon display HTML elements.

Summary by Sourcery

Restrict display of precious and positional parameter controls to application arguments and visually distinguish enabled flags in the parameter table UI.

Bug Fixes:

  • Ensure precious and positional icons are only shown for application argument fields in the parameter table.

Enhancements:

  • Add visual indication for enabled precious and positional flags by using filled icons in the parameter table UI.

…vious. Only show precious and positional if field is an Application Argument
@james-strauss-uwa james-strauss-uwa self-assigned this Jan 7, 2026
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Jan 7, 2026

Reviewer's Guide

Update the node parameter table UI so precious/positional icons are only shown for application arguments and visually indicate enabled state with filled material icons, plus a minor TypeScript style tweak.

Flow diagram for conditional rendering of precious and positional icons

flowchart TD
  A[Render_parameter_row] --> B{parameterType === Daliuge.FieldType.Application}
  B -->|No| C[Do_not_render_precious_or_positional_icons]
  B -->|Yes| D{Setting.ALLOW_COMPONENT_EDITING}
  D -->|No| E[Do_not_render_precious_or_positional_icons]
  D -->|Yes| F{isPrecious}
  F -->|Yes| G[Render_precious_button_with_filled_diamond_icon]
  F -->|No| H[Render_precious_button_with_outline_diamond_icon]
  G --> I[Button_click_calls_togglePrecious]
  H --> I

  D --> J{isPositionalArgument}
  J -->|Yes| K[Render_positional_button_with_filled_location_on_icon]
  J -->|No| L[Render_positional_button_with_outline_location_on_icon]
  K --> M[Button_click_calls_togglePositionalArgument]
  L --> M
Loading

File-Level Changes

Change Details Files
Gate display and styling of precious and positional flag icons in the node parameter table based on parameter type and flag state.
  • Wrap precious and positional flag button blocks in a knockout condition that checks parameterType() equals Daliuge.FieldType.Application so they only render for application arguments.
  • Keep existing ALLOW_COMPONENT_EDITING guard while nesting it inside the new parameter type condition to preserve edit-permission behavior.
  • Apply the 'filled' CSS class to the diamond icon when isPrecious() is true and to the location_on icon when isPositionalArgument() is true, leaving the disabled-state icons unfilled.
  • Retain existing tooltips and click bindings for toggling precious and positional flags, only changing icon styling and visibility conditions.
templates/node_parameter_table.html
Minor formatting fix in Field TypeScript helper method declaration.
  • Add spacing around the equals sign in the getHelpHtml arrow function definition to match project style.
src/Field.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • The precious/positional button markup is now duplicated between the true/false cases primarily to toggle the filled class; consider using a css binding (or similar) to conditionally add filled on a single <button>/<i> block for each control to reduce repetition.
  • The Setting.findValue(Setting.ALLOW_COMPONENT_EDITING) condition is repeated separately for precious and positional controls; you could wrap both under a single ko if to simplify the template and make the editing gate more obvious.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The precious/positional button markup is now duplicated between the true/false cases primarily to toggle the `filled` class; consider using a `css` binding (or similar) to conditionally add `filled` on a single `<button>/<i>` block for each control to reduce repetition.
- The `Setting.findValue(Setting.ALLOW_COMPONENT_EDITING)` condition is repeated separately for precious and positional controls; you could wrap both under a single `ko if` to simplify the template and make the editing gate more obvious.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

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