Skip to content

Contextual Task Bar: the Smooth tool shows its Fidelity and Tool Options - #7835

Open
dotCooCoo wants to merge 2 commits into
storytold:mainfrom
dotCooCoo:feat/contextual-task-bar-smooth-free-transform
Open

dotCooCoo wants to merge 2 commits into
storytold:mainfrom
dotCooCoo:feat/contextual-task-bar-smooth-free-transform

Conversation

@dotCooCoo

@dotCooCoo dotCooCoo commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

What and why

The contextual task bar did not show while the Smooth tool was in use, even with a path selected. The bar's overview page lists the Smooth tool among the tools for which the bar shows that tool's options (Contextual Task Bar overview), and the Smooth tool's help page describes one option, Fidelity, which sets how many anchor points the tool adds to a path (Smooth tool). Neither page lists the bar's items or their order, so the items below are VectorCraft's own rules.

  • While the Smooth tool is in use with a path it can smooth selected (three or more anchors, or two joined by a curve, on its own or inside a selected group), the bar shows a Fidelity field and Tool Options…, which opens the Smooth tool's options (tool.options).
  • The field sets the tool's Fidelity with tool.setOption. crates/ui-egui/src/dialogs/freehand.rs now has fidelity_field and fidelity_unit helpers that both the dialog and the bar use, so the bar's field has the same range, unit (screen pixels) and steps as the field in the options.
  • With nothing selected, or only straight lines or type selected, the Smooth tool shows no bar. The bar leaves out the selection tools' actions, the Fill and Stroke chips, Recolor Artwork and Lock. On a canvas too narrow for the field, More Options lists Fidelity, which opens the tool's options.
  • can_smooth (crates/tools/src/draw2/gesture.rs) holds the check the Smooth tool's cursor already made, and the bar uses the same function. The bar keeps its answer for the document's revision, so it does not walk the selection on every frame.
  • The drawing of each bar item and the Artboard tool's items moved into helpers in crates/ui-egui/src/canvas/task_bar.rs, with no change to what they draw.
  • docs/target-app-parity.md has one line for the Smooth tool's bar, and its handle line now names the Smooth tool among the tools that show the bar. No command or user-visible string was added.

How it was tested

New tests in crates/ui-egui/src/tests/taskbar.rs, each failing without the change:

  • the_smooth_tool_shows_fidelity_and_tool_options_for_a_path: with an ellipse selected and the Smooth tool in use, the bar has Tool Options… and More Options and none of Fill, Stroke, Recolor Artwork, Lock, Duplicate, Edit Path, Offset Path, Simplify or Smooth. Typing 7 in the Fidelity field sets the tool's fidelity to 7 and keeps the tool and the selection, and Tool Options… opens the Smooth tool's options with 7.
  • the_smooth_tool_shows_no_bar_without_a_path_to_smooth: no bar with nothing, a straight line or type selected; a bar with Fidelity for a path and a line together; on one canvas the bar follows each change of the selection; with the Selection tool the bar shows Duplicate and no Fidelity.

The branch is one commit on main at 8f339eeaa1, and main had not moved when this was posted. Checks on the final tree: main at that commit does not build (crates/trace/src/seam.rs:87), so these ran with the one-line fix from #7831 applied to that file:

  • cargo fmt --all -- --check
  • cargo clippy -p vectorcraft-tools --all-targets -- -D warnings and cargo clippy -p vectorcraft-ui-egui --all-targets -- -D warnings
  • cargo check --workspace --tests
  • cargo test -p vectorcraft-ui-egui --lib taskbar::: 40 passed
  • cargo test -p vectorcraft-ui-egui --lib dialogs::freehand: 15 passed
  • cargo test -p vectorcraft-tools --lib smooth: 26 passed
  • cargo xtask brands, layers and assets
  • cargo xtask ci runs in this pull request's CI.

Checklist

  • cargo xtask ci passes (fmt, clippy, tests, assets, brands, layers, wasm).
  • No panics in shipped code: no unwrap(), expect(), panic!, unreachable!, todo! or
    unimplemented! outside tests, and no unchecked indexing on data from files, parameters or
    messages. Errors are returned as Result and shown to the user
    (why and how).
  • Clean-room: nothing copied from Adobe products or GPL/AGPL code (AGENTS.md).
  • Every new asset has a row in ASSETS.md.

Summary by CodeRabbit

  • New Features
    • The Smooth tool now displays a contextual task bar when the selection contains a smoothable path, with a Fidelity control and Tool Options. Changing Fidelity updates the tool setting.
    • The task bar responds to selection changes and remains hidden when no smoothable path is selected.
  • Documentation
    • Updated the contextual task bar guide to cover the Smooth tool’s controls and behavior.

While the Smooth tool is in use with a path it can smooth selected, the
bar shows the tool's Fidelity field and Tool Options..., which opens the
Smooth tool's options. The field sets Fidelity through tool.setOption
with the same range, unit and steps as the field in the options dialog.
With nothing smoothable selected, the tool shows no bar. The bar leaves
out the selection tools' actions and the Fill, Stroke, Recolor Artwork
and Lock controls. On a canvas too narrow for the field, More Options
lists Fidelity, which opens the tool's options.

The Smooth tool's cursor and the bar share one check of the selection,
which the bar keeps for the document's revision.
@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 32 seconds.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between f459465 and e5f5bbd.

Files selected for processing: 6

  • crates/tools/src/draw2.rs
  • crates/tools/src/draw2/gesture.rs
  • crates/ui-egui/src/canvas/task_bar.rs
  • crates/ui-egui/src/dialogs/freehand.rs
  • crates/ui-egui/src/tests/taskbar.rs
  • docs/target-app-parity.md

No actionable comments were generated in the recent review.

Walkthrough

The Smooth tool now has a contextual task bar for eligible selections. It displays Fidelity and Tool Options, applies changed Fidelity values through tool.setOption, and omits the bar when no selected path can be smoothed.

Changes: Smooth tool task bar

Layer / File(s) Summary
Smooth selection eligibility
crates/tools/src/draw2.rs, crates/tools/src/draw2/gesture.rs
The public can_smooth function checks selected paths for smoothing eligibility. has_selected_smooth_path delegates to it.
Task-bar controls and validation
crates/ui-egui/src/canvas/task_bar.rs, crates/ui-egui/src/dialogs/freehand.rs, crates/ui-egui/src/tests/taskbar.rs, docs/target-app-parity.md
The task bar displays Fidelity and Tool Options for eligible Smooth selections. Fidelity changes use tool.setOption. The Fidelity field helpers, task-bar tests, and parity documentation cover these controls and their eligibility conditions.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant ContextualTaskBar
  participant can_smooth
  participant SmoothTool
  participant SmoothOptionsDialog
  ContextualTaskBar->>can_smooth: Check document and selection
  can_smooth-->>ContextualTaskBar: Return eligibility result
  User->>ContextualTaskBar: Change Fidelity
  ContextualTaskBar->>SmoothTool: Send tool.setOption with Fidelity
  User->>ContextualTaskBar: Select More Options
  ContextualTaskBar->>SmoothOptionsDialog: Open Smooth tool options
Loading

Suggested reviewers: bflatastic, mockydevs, aiongg

Merge Risk: Minimal · previous review f4594

The Smooth tool gets a contextual bar with Fidelity and Tool Options for smoothable selections. No concrete defects were found in the changed code. The CI build failure in the trace crate predates this change and is tracked separately.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the Smooth tool's Contextual Task Bar change: the bar now shows a Fidelity field and Tool Options for the Smooth tool. The changeset matches this, including the task_bar.rs, freehand.r…
Description check Passed The description follows the template's sections: 'What and why', 'How it was tested', and 'Checklist'. It explains the motivation, the behaviour, the helpers, and the new tests, and it lists the check…
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.
Full details: Title check

Explanation

The title names the Smooth tool's Contextual Task Bar change: the bar now shows a Fidelity field and Tool Options for the Smooth tool. The changeset matches this, including the task_bar.rs, freehand.rs, gesture.rs, and test changes. The title is specific and short.

Full details: Description check

Explanation

The description follows the template's sections: 'What and why', 'How it was tested', and 'Checklist'. It explains the motivation, the behaviour, the helpers, and the new tests, and it lists the checks run. The first template checklist item (cargo xtask ci) is left unchecked, and the description says CI runs in the PR. The description also reports that main does not build and that a one-line fix from #7831 was applied, which a reviewer should note. The description is thorough and mostly complete.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 8f339ee and f459465.

Files selected for processing: 6

  • crates/tools/src/draw2.rs
  • crates/tools/src/draw2/gesture.rs
  • crates/ui-egui/src/canvas/task_bar.rs
  • crates/ui-egui/src/dialogs/freehand.rs
  • crates/ui-egui/src/tests/taskbar.rs
  • docs/target-app-parity.md

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

This branch has not been deployed

No deployments
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