Skip to content

Fades: Create refuses a shape that is not a string over a selection - #1053

Merged
aiongg merged 1 commit into
storytold:mainfrom
dotCooCoo:fix/non-string-params
Oct 25, 2026
Merged

aiongg merged 1 commit into
storytold:mainfrom
dotCooCoo:fix/non-string-params

Conversation

@dotCooCoo

@dotCooCoo dotCooCoo commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

On main, edit.fades_create over tracks and a range reads a shape of null, true or 1 as absent and makes Equal Power fades. The clip form (clip, side, length) already refuses a shape that is not a string.

  • Both forms now take shape only as a fade shape name. Leaving it out still gives Equal Power. Any other value, an unknown name included, returns an error that lists the accepted shapes (linear|equal power|s-curve|exponential|logarithmic), and the session is unchanged.

New test range_fades_refuse_a_shape_that_is_not_a_shape_name (engine): "bad", null, true and 1 are each refused over a range, and the session and undo history stay as they were. On main it fails on null.

The branch merges cleanly with main at ee050db. It conflicts with #976 in the first lines of fades_create, where #976 adds in_shape and out_shape; a merge keeps both changes.

Checks:

Summary by CodeRabbit

  • Bug Fixes
    • Fade creation now reports an error when the shape is not one of the supported values, rather than accepting an invalid value.
    • Omitting the shape continues to use the equal-power default.
    • Invalid fade shapes no longer alter the session or its undo history.

edit.fades_create over tracks and a range read a null, boolean or number
shape as absent and made Equal Power fades. It now returns an error that
lists the accepted shapes, as the clip form already did, and leaves the
session and the undo history unchanged.
@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between ee050db and a41f254.

Files selected for processing: 1
  • crates/engine/src/cmd/edit.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

Walkthrough

edit.fades_create now parses the shape parameter directly. An omitted value defaults to EqualPower; unrecognized values return an error. A test checks that invalid values do not change the session or undo history.

Changes: Fade shape validation

Layer / File(s) Summary
Parse and test fade shapes
crates/engine/src/cmd/edit.rs
The command defaults an omitted shape to EqualPower and rejects supplied values that are not recognized strings. The test checks invalid values and confirms that the session and undo history remain unchanged.

Priority: Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Possibly related PRs

Suggested reviewers: echelon, reoniazx

Merge Risk: Minimal · up to a41f2

The fade-shape validation change is ready to merge.

Architecture risk: Low · up to a41f2

The change affects 1 system.

Changed systems: crates

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — crates (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in crates/engine/src/cmd/edit.rs: edit.fades_create now parses shape from the JSON value directly. Omission defaults to EqualPower; supplied values must be recognized fade-shape strings or the command returns an error listing the accepted shapes.
  • observed — Modified behavior in crates/engine/src/cmd/edit.rs: Removed the targeted-fade check that separately rejected non-string shape values; shape parsing earlier in the function now handles supplied values.
  • observed — Modified behavior in crates/engine/src/cmd/edit.rs: Added a test asserting that range fades reject string, null, boolean, and numeric invalid shapes without changing the session or undo history.
Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly describes the main change: range fade creation now rejects non-string shape values.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@aiongg
aiongg merged commit a8ca533 into storytold:main Oct 25, 2026
3 checks passed
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