Skip to content

fix(dialog): drop the toggle from free text properties - #275

Merged
skjnldsv merged 2 commits into
mainfrom
fix/note-field-without-toggle
Sep 8, 2026
Merged

skjnldsv merged 2 commits into
mainfrom
fix/note-field-without-toggle

Conversation

@skjnldsv

@skjnldsv skjnldsv commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

The note field had a switch beside it: the textarea stayed disabled until the switch was flipped on, and flipping it off was how a note got removed. An empty text field already says "no note", so free text now renders without a toggle, always editable, and an empty one means the property is unset — which is what a required note already did.

The rule is isLongTextProperty, not the note's own class. A password or an expiry keeps its toggle, because "on with no value yet" is a state worth expressing there and switching one off says something an empty value does not.

Clearing the text is now the only way to unset such a property, so a pending edit is flushed when the field unmounts; the 500 ms debounce would otherwise keep the old note when the dialog closes right after typing.

Also sticks the action bars to the bottom of the panel — they were positioned by the panel's own bottom padding and floated above short forms.

Four new tests cover free text rendering without a toggle, a password keeping one, clearing a field dispatching setProperty(class, null), and a pending edit surviving unmount.

👾 This pull request was assisted by Claude Code, commits carry an Assisted-by trailer.

The bars were positioned by the panel's own bottom padding, which left them
floating above the content when the form was shorter than the dialog.

Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
A note has an obvious empty state, so the switch beside it only added a step:
the field was disabled until it was flipped on, and flipping it off was the way
to remove a note. Render free text without a toggle instead, always editable,
and let an empty field mean the property is unset — which is what a required
note already did.

Clearing the text is now the only way to unset such a property, so a pending
edit is flushed when the field goes away; the debounce would otherwise keep the
old note when the dialog closes right after typing.

Properties that are not free text keep their toggle: for a password or an
expiry, "on with no value yet" is a state worth expressing, and switching one
off says something the empty value alone does not.

Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
@skjnldsv skjnldsv added the bug Something isn't working label Sep 8, 2026
@codecov

codecov Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.91%. Comparing base (72bfbe7) to head (d206a01).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #275      +/-   ##
==========================================
+ Coverage   79.06%   79.91%   +0.85%     
==========================================
  Files          27       27              
  Lines         726      727       +1     
  Branches      202      202              
==========================================
+ Hits          574      581       +7     
+ Misses        133      127       -6     
  Partials       19       19              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@skjnldsv
skjnldsv marked this pull request as ready for review September 8, 2026 13:30
@skjnldsv
skjnldsv merged commit f73517b into main Sep 8, 2026
17 checks passed
@skjnldsv
skjnldsv deleted the fix/note-field-without-toggle branch September 8, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant