Thanks to visit codestin.com
Credit goes to github.com

Skip to content

relates to #4647: enable parameter edit#150

Open
vladavoX wants to merge 4 commits into
feature/parametrization-routefrom
parameter-edit
Open

relates to #4647: enable parameter edit#150
vladavoX wants to merge 4 commits into
feature/parametrization-routefrom
parameter-edit

Conversation

@vladavoX

@vladavoX vladavoX commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Type of change

  • Bug fix
  • New feature
  • Refactor / internal improvement
  • Dependency update
  • Docs / tooling

Related issue

Testing

  • Tested manually in After Effects
  • Unit tests added / updated
  • Existing tests pass (yarn test)

After Effects version tested:
OS tested on:

Screenshots

Checklist

  • yarn biome passes (or yarn biome:fix was run)
  • yarn build completes without errors
  • No new TypeScript errors

Base automatically changed from parametrization-and-scripts to feature/parametrization-route April 17, 2026 09:42
@vladavoX vladavoX changed the title Enable parameter edit relates to #4647: enable parameter edit Apr 17, 2026

@vladavoX vladavoX left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Review

Overview

Implements parameter editing for parametrized layers. Key additions:

  • ParameterDialog — new modal for editing static/dynamic parameter settings (value, parameter name with regex validation, default value, mandatory flag)
  • SortableLayerItem — layer rows extracted into a sortable component, enabling layer drag-and-drop reordering
  • Checkbox — upgraded to support controlled (checked) alongside uncontrolled (defaultChecked)
  • ensureHashPrefix / stripHashPrefix — symmetric util helpers for #-prefixed values
  • LayerBase.label — new required field on the type

Issues

Bug — Static save retains stale dynamic fields (ParameterDialog.tsx:158-170)

When saving in Static mode, the spread carries over mandatory and defaultValue from the previous Dynamic configuration:

: {
    ...currentParametrization,   // ← keeps mandatory, defaultValue from dynamic mode
    expression: false,
    value: staticValue,
  };

Any downstream code reading mandatory or defaultValue without first checking expression === true will see stale data. These should be explicitly cleared in the static branch.


Edit button not respecting disabled prop (ParametrizedLayers.tsx:566-572)

The Edit button has no disabled attribute, so users can open the parameter dialog even when the parent's disabled prop is true. The drag handle correctly checks isFilterActive — the edit button should too.


PARAM_NAME_REGEX defined locally instead of in utils.ts (ParameterDialog.tsx:112)

SCRIPT_PARAMETER_NAME_REGEX lives in utils.ts. PARAM_NAME_REGEX should also live there so both are in one place and accessible to any future validation logic.


defaultV is an opaque variable name (ParameterDialog.tsx:139)

defaultV is unclear at a glance. Rename to paramDefaultValue or similar — defaultValue is already destructured above, so a distinct but readable name avoids both shadowing and the abbreviation.


Code Quality

  • checkProps spread in Checkbox — clean solution to the uncontrolled/controlled switch without duplicating the <input>.
  • key trick on ParameterDialog (ParametrizedLayers.tsx:865) — correct pattern to reset dialog state on open/close; intentional and clear.
  • handleLayerDragEnd clears selection — reasonable UX; drag reorders so prior selection is ambiguous.
  • isFilterActive computation correctly gates drag when disabled, filter, or type query is active.
  • State initialization in ParameterDialog — relies on key prop to reset when reopened for a different layer; valid approach.

@vladavoX vladavoX marked this pull request as ready for review April 17, 2026 12:00
@vladavoX vladavoX requested a review from danixeee April 17, 2026 12:00
@vladavoX vladavoX force-pushed the feature/parametrization-route branch from d6aeb1f to 673cd6a Compare April 24, 2026 13:24
@vladavoX vladavoX force-pushed the feature/parametrization-route branch from 673cd6a to ba3a055 Compare April 29, 2026 14:38
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.

1 participant