Skip to content

Conversation

@james-strauss-uwa
Copy link
Collaborator

@james-strauss-uwa james-strauss-uwa commented Oct 10, 2025

Updated ParameterTable UI to remove 'defaultValue' column.
Removed 'resetToDefault' functionality, this is replaced by just removing the Field from the GraphConfig.
Removed the 'defaultValue' attribute from the LG graph schema (V4).
Updated unit test LogicalGraph JSON to remove the 'defaultValue' attribute.
Removed 'defaultValue' inputs from the 'edit field' modal dialog.

One unrelated change where I created a constant for the string name of the 'appclass' field. It is used in one place.

Summary by Sourcery

Remove the 'defaultValue' attribute and associated functionality from the Field class, UI, schema, and tests, replacing resetToDefault with field removal in GraphConfig and adding a constant for the 'appclass' field name.

Enhancements:

  • Drop 'defaultValue' property and related getters/setters from Field class and utilities
  • Remove defaultValue column, inputs, sorting, and reset-to-default actions from ParameterTable UI and edit dialogs
  • Simplify edit value workflow by always treating fields through GraphConfigField and setting only the value
  • Replace resetToDefault functionality with removing the Field from GraphConfig

Tests:

  • Update LogicalGraph JSON test fixtures to remove defaultValue attribute

Chores:

  • Remove 'defaultValue' attribute from lg.graph.v4.schema
  • Introduce constant for Daliuge.FieldName.APP_CLASS and use it for 'appclass' field

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Oct 10, 2025

Reviewer's Guide

This PR removes the legacy “defaultValue” attribute from the Field model, UI, data schema, and tests—simplifying parameter editing to operate solely on current values—and extracts a constant for the “appclass” field name.

Class diagram for Field class after removing 'defaultValue' attribute

classDiagram
    class Field {
        -displayText : ko.Observable<string>
        -value : ko.Observable<string>
        -description : ko.Observable<string>
        -readonly : ko.Observable<boolean>
        -type : ko.Observable<Daliuge.DataType>
        -precious : ko.Observable<boolean>
        -options : ko.ObservableArray<string>
        -positional : ko.Observable<boolean>
        -parameterType : ko.Observable<Daliuge.FieldType>
        -usage : ko.Observable<Daliuge.FieldUsage>
        -encoding : ko.Observable<string>
        -isEvent : ko.Observable<boolean>
        -node : Node
        -issues : ko.ObservableArray<{issue:Errors.Issue, validity:Errors.Validity}>
        +constructor(id, displayText, value, description, readonly, type, precious, options, positional, parameterType, usage)
        +getValue() : string
        +setValue(value: string) : Field
        +getDescription() : string
        +setDescription(value: string) : Field
        +getType() : Daliuge.DataType
        +setType(type: Daliuge.DataType) : Field
        +getOptions() : string[]
        +addOption(option: string) : Field
        +removeOption(index: number) : Field
        +editOption(optionIndex: number, newVal: string) : Field
        +clear() : Field
        +shallowCopy() : Field
        +getFieldValue() : string
        +copyWithIds(src: Field, node: Node, id: FieldId) : Field
    }
Loading

File-Level Changes

Change Details Files
Strip defaultValue from Field model and underlying data handling
  • Removed defaultValue observable, constructor parameter, getters/setters, toggle/reset methods
  • Updated JSON import/export (toJSON, copy, shallowCopy, static factory) to exclude defaultValue
  • Refactored getDescriptionText and type-specific utilities to drop defaultValue logic
src/Field.ts
src/Utils.ts
src/Modals.ts
src/Eagle.ts
src/Node.ts
src/RightClick.ts
src/main.ts
Clean up ParameterTable UI and editing flows
  • Deleted defaultValue branches from sorting, cell rendering, and column visibility in ParameterTable
  • Adjusted requestEditValueField signature to remove defaultValue flag and always edit value
  • Removed “Reset to Default” actions/buttons from table rows and edit-field modal
src/ParameterTable.ts
templates/node_parameter_table.html
templates/modals/edit_field.html
Update graph schema and test data
  • Dropped defaultValue attribute from static/lg.graph.v4.schema
  • Refreshed sample LogicalGraph JSON in e2e test data to remove defaultValue entries
static/lg.graph.v4.schema
e2e/data/LoopWithBranch.graph
Extract APP_CLASS constant and replace inline string
  • Added APP_CLASS member to Daliuge.FieldName enum
  • Replaced hard-coded "appclass" with Daliuge.FieldName.APP_CLASS in Utils
src/Daliuge.ts
src/Utils.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

@james-strauss-uwa james-strauss-uwa self-assigned this Oct 10, 2025
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 there - I've reviewed your changes - here's some feedback:

  • After removing defaultValue from the graph schema, please bump the schema version (e.g. to v5) so consumers can detect the change.
  • Add fallback logic when loading older graphs that still include defaultValue to ensure smooth upgrades and avoid missing-attribute errors.
  • The new APP_CLASS constant is placed in the DataType enum but is actually a field name; consider moving it into the FieldName enum for clarity.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- After removing defaultValue from the graph schema, please bump the schema version (e.g. to v5) so consumers can detect the change.
- Add fallback logic when loading older graphs that still include defaultValue to ensure smooth upgrades and avoid missing-attribute errors.
- The new APP_CLASS constant is placed in the DataType enum but is actually a field name; consider moving it into the FieldName enum for clarity.

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.

Copy link
Collaborator

@M-Wicenec M-Wicenec left a comment

Choose a reason for hiding this comment

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

from a code and bug perspective i found no issues and this pr is ready to merge

one question to discuss is if there are any graphs where the default values where seriously used. removing default value capability from such a graph would mean loss of data. is this a concern?

another question is if there are any further changes necessary on the daliuge side? if any likely just for tests or updates to palettes/ graphs.

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.

3 participants