Skip to content

Edit: an open text edit stands down the Project-panel Clear redirect (#2227) - #2263

Merged
bflatastic merged 1 commit into
storytold:mainfrom
SusieeTheLinuxUser:fix/2227-clear-text-edit-standdown
Oct 29, 2026
Merged

bflatastic merged 1 commit into
storytold:mainfrom
SusieeTheLinuxUser:fix/2227-clear-text-edit-standdown

Conversation

@SusieeTheLinuxUser

@SusieeTheLinuxUser SusieeTheLinuxUser commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #2227

What was wrong

Edit ▸ Clear follows panel focus. With the Project panel focused, it redirects to project.delete, which removes the Project selection straight away when nothing uses it (the delete_items::guard prompt only opens for items compositions use). If a text edit was open in the canvas while the Project panel kept focus, Clear deleted the composition being typed into, without asking. Undo brought the item back but not the active composition.

What changed

In crates/ui-egui/src/menus/ (split in #2491):

The Render Queue redirect and every other edit.clear path are unchanged.

Tests

  • ui_project_delete::clear_with_the_project_focused_stands_down_during_a_text_edit. Setup: the active composition is selected in the Project panel, a text edit is open, and the Project panel has focus. It sends Clear through menus::invoke, the path the menu, the shortcut and the control channel share. It then checks that the composition survives, the project is unchanged and the text edit stays open.
  • It fails on main and passes with the fix.

Run: cargo test -p effectcraft-ui-egui --test it clear_with_the_project_focused_stands_down

Counts

  • cargo test -p effectcraft-ui-egui (rebased onto origin/main @ 990fa66): lib 312 passed, 0 failed, 3 ignored. Integration: 604 passed, 0 failed, 12 ignored.
  • cargo clippy -p effectcraft-ui-egui --all-targets -- -D warnings and cargo fmt --check: clean.

Written by GLM-5.3-Flash in ZCode, then reviewed with Claude Code and by me (@SusieeTheLinuxUser) before submitting.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Prevented Edit > Clear from deleting a selected composition while a text edit is active in the Project panel. Clear is unavailable during the edit, which remains open and leaves the project 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 7c21ba3 and 63f1698.

Files selected for processing: 2
  • crates/ui-egui/src/menus/entries.rs
  • crates/ui-egui/src/menus/invoke.rs

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

Walkthrough

When the Project panel is focused during a text edit, Edit > Clear is disabled and its invocation does not delete project items. An integration test checks that the composition, project, and text edit remain unchanged.

Changes: Project Clear during text editing

Layer / File(s) Summary
Guard Project Clear during text editing
crates/ui-egui/src/menus/entries.rs, crates/ui-egui/src/menus/invoke.rs, crates/ui-egui/tests/it/ui_project_delete.rs
The menu entry is disabled during an active text edit. Invoking the command in that state does not route to project deletion. The integration test checks that the composition, project, and text edit remain unchanged.

Priority: Normal

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

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: aiongg

Merge Risk: Minimal · up to 63f16

The change preserves the composition during text editing, with no unresolved merge-blocking risk identified.

Pre-merge checks: Passed 4
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title states that an open text edit now stops the Project-panel Clear redirect. The raw summary confirms this: edit.clear is disabled during a text edit in entries.rs, and invoke.rs returns Value:…
Linked Issues check Passed Issue #2227 requires the Project-panel Clear redirect to stand down during an open text edit, or to use delete confirmation. menus::invoke now returns Value::Null without deleting when the Project…
Out of Scope Changes check Passed The changes are limited to the Project-panel edit.clear enabled-state check, its matching invoke redirect, and a focused regression test. These changes directly implement and verify issue #2227. N…
Full details: Title check

Explanation

The title states that an open text edit now stops the Project-panel Clear redirect. The raw summary confirms this: edit.clear is disabled during a text edit in entries.rs, and invoke.rs returns Value::Null in that state, plus a new test covers it. The title matches the main change. The title does not name the Render Queue path, but the PR objectives describe it as unchanged, so that omission is acceptable. The title's issue reference (#2227) conflicts with the PR objectives, which name the PR as #2263 and cite #2227 as the linked issue. The title is accurate in substance.

Full details: Linked Issues check

Explanation

Issue #2227 requires the Project-panel Clear redirect to stand down during an open text edit, or to use delete confirmation. menus::invoke now returns Value::Null without deleting when the Project panel has focus and text_edit is active. entry_enabled also disables edit.clear in that state. The added integration test verifies that the composition, project, and text edit remain unchanged.

Full details: Out of Scope Changes check

Explanation

The changes are limited to the Project-panel edit.clear enabled-state check, its matching invoke redirect, and a focused regression test. These changes directly implement and verify issue #2227. No unrelated behavior is identified.

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.

ChristopherLinnett added a commit to ChristopherLinnett/effectcraft that referenced this pull request Oct 27, 2026
…-panel Clear redirect (storytold#2227) (@SusieeTheLinuxUser)

# Conflicts:
#	crates/ui-egui/src/menus.rs
ChristopherLinnett added a commit to ChristopherLinnett/effectcraft that referenced this pull request Oct 27, 2026
…also with Project focused (storytold#2227)

storytold#2263 made Edit ▸ Clear with the Project panel focused do nothing during a text edit, and greyed
it out, so the composition being typed into isn't deleted. Main's stand-down rule from storytold#2096
handles every other Project-panel redirect another way: the redirect steps aside and the command
acts on the edit. Clear now follows that one rule: during an edit it falls through to the
engine's Clear, which deletes the selected text as it does from any other panel or through
engine.execute. The composition survives, the edit stays open and the menu item stays enabled.
With no edit open, Clear with Project focused still deletes the Project selection.
@TimotheusG

TimotheusG commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

I recovered this topic from the closed integration batch #2284 onto upstream bc4b48f, preserving its batch follow-ups and contributor attribution. I have not opened a competing replacement PR or changed your branch; this is available for updating the existing PR.

Original #2263 refreshed to current modules, plus batch fix 2168565: Clear deletes selected text while editing, rather than deleting the composition or becoming a no-op.

Standalone CI verified, October 27: the full upstream CI gate passed on this exact recovery commit, independently of the other recovery branches. CI run. This includes formatting, strict workspace/all-target Clippy with warnings denied, workspace lib/bin/integration tests, GPU tests, doctests, PDF dependency checks, layering, asset checks, WebAssembly checks, and the unchanged-lockfile check.

The test log records 3772 passing nextest tests and 233 passing GPU tests. The standard upstream configuration retains its 31 existing opt-in/ignored tests; no additional tests were disabled for this recovery.

The fork's workflow-registration blocker is resolved. The recovery branch contains this topic only, based directly on bc4b48f; it does not require the other batch topics to pass CI. Its published commit is unchanged from the original recovery note. Normal upstream CI will still run when the author or a maintainer adopts it.

@bflatastic

Copy link
Copy Markdown
Member

Hi @SusieeTheLinuxUser, thanks for this PR! main has changed a lot since it was opened, and it now conflicts with main, so it needs a rebase before we can review it for merging.

Most of the conflict comes from the shared module layout (#2491), which moved or split files this PR touches:

  • crates/ui-egui/src/menus.rs was split: most of its code is now in menus/*.rs

When you rebase, please also make sure it fits the other recent changes:

CI (cargo xtask ci) now runs on PRs. Once it's green on the rebased branch, we'll take a look. Thank you!

…torytold#2227)

Edit > Clear follows panel focus: with the Project panel focused it
redirects to project.delete, which removes the selection at once when
nothing uses it. With a text edit open, that deletes the composition
being typed into — the user is working in it — and undo restores the
item but not the active composition. During a text edit the redirect
stands down (Clear does nothing) and the Edit menu's Clear entry is
disabled, mirroring how Deselect All stands down in storytold#2096.

Co-Authored-By: GLM-5.3-Flash <noreply@z.ai>
@SusieeTheLinuxUser
SusieeTheLinuxUser force-pushed the fix/2227-clear-text-edit-standdown branch from 7c21ba3 to 63f1698 Compare October 29, 2026 04:30
@SusieeTheLinuxUser

Copy link
Copy Markdown
Contributor Author

Rebased onto main (990fa66) and moved into the #2491 layout (menus/invoke.rs, menus/entries.rs). cargo clippy --all-targets -- -D warnings, cargo fmt --check and the touched crate's tests pass locally. Could you approve the CI workflow run? Thanks!

@bflatastic
bflatastic merged commit f20dfcb into storytold:main Oct 29, 2026
1 check passed
@bflatastic

Copy link
Copy Markdown
Member

Merged, thank you @SusieeTheLinuxUser! It landed on main with a batch of community PRs, after a full workspace build and test run on Windows against the refactored main (fmt, strict clippy, about 4,100 tests, layers, assets and wasm).

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.

Edit > Clear deletes the composition being typed into when the Project panel is focused, with no confirmation

3 participants