Skip to content

Conversation

@yaisog
Copy link
Contributor

@yaisog yaisog commented Jan 15, 2026

Initially, this should have been an optimization to improve the readability check of the filters that determine the visibility of the individual fields, see #9526.

However, there was a bunch of pre-5.3.0 code in there that was also partially duplicated and it was not really formatted in a readable way. So this turned into a major refactor.

No functionality should have changed, except that the new field name button now also gets focused when pressing the "Add" or "Delete" buttons, not just when using the respective keyboard shortcuts. Oh, and the focusing was somewhat broken anyway, because the CSS selector that was constructed was not usually valid (it CSSescaped the tiddler title, which the class assignment in the ViewTemplate did not).

I did some testing without problems, but since this is a tiddler that is central to the EditTemplate, I recommend more testing by other parties.

@netlify
Copy link

netlify bot commented Jan 15, 2026

Deploy Preview for tiddlywiki-previews ready!

Name Link
🔨 Latest commit 09af519
🔍 Latest deploy log https://app.netlify.com/projects/tiddlywiki-previews/deploys/696fc724c72af30008fc5d54
😎 Deploy Preview https://deploy-preview-9582--tiddlywiki-previews.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link

Confirmed: yaisog has already signed the Contributor License Agreement (see contributing.md)

@github-actions
Copy link

github-actions bot commented Jan 15, 2026

📊 Build Size Comparison: empty.html

Branch Size
Base (master) 2449.9 KB
PR 2449.9 KB

Diff: ⬆️ Increase: +0.0 KB


✅ Change Note Status

All change notes are properly formatted and validated!

📝 $:/changenotes/5.4.0/#9582

Type: enhancement | Category: internal
Release: 5.4.0

Refactor code for EditTemplate fields

🔗 #9582

👥 Contributors: yaisog


📖 Change Note Guidelines

Change notes help track and communicate changes effectively. See the full documentation for details.

@yaisog yaisog marked this pull request as ready for review January 15, 2026 18:41
@saqimtiaz
Copy link
Member

We should ensure that the bug reported in #9574 is not related to any chnages in the edit template before we refactor it.

@yaisog
Copy link
Contributor Author

yaisog commented Jan 19, 2026

Hi @saqimtiaz, the field editor only captures the ((delete-field)) and ((add-field)) keys. It does transclude the keyboard-driven-input macro, as does the tags input, so that's where I would start looking. I would venture to claim that the problem is not related to the template that this PR is about.
We should leave the PR open until that is solved, though, just in case.

@saqimtiaz
Copy link
Member

I would venture to claim that this has nothing to do with the template that this PR is about.

I suspect the same and I think I recall a refactoring of the keyboard-driven-input macro that is a more likely culprit. We just have to be sure to test these different changes that can touch upon the edit template carefully before release, as this is an area we have often had regressions in.

@saqimtiaz
Copy link
Member

@yaisog in light of your work on this PR, could you please reflect on whether the $fieldmangler widget is still needed or whether it could potentially be deprecated in favour of $action-listops? I am not suggesting that we consider that as part of this PR, but in light of the recfactoring work you have done your insight would be appreciated.

@yaisog
Copy link
Contributor Author

yaisog commented Jan 19, 2026

Hi @saqimtiaz, the <$fieldmangler> was only used with the tm-add-field message in an undocumented way (by assigning a value directly). By changing this to an ActionSetFieldWidget, the FieldManglerWidget is no longer necessary. I removed it from the template.
The ActionListopsWidget would probably only be needed in the tags template.

@yaisog
Copy link
Contributor Author

yaisog commented Jan 20, 2026

I think I recall a refactoring of the keyboard-driven-input macro that is a more likely culprit

Hi @saqimtiaz, I had a look. It is both. keyboard-driven-input expects to be passed inputAcceptVariantActions (there is no default) that execute when by default Ctrl-Enter is pressed. These actions are not defined in the macro transclusion in the fields editor. I'll fix this.

@yaisog
Copy link
Contributor Author

yaisog commented Jan 20, 2026

I added the parameter inputAcceptVariantActions to the keyboard-driven-input call and assigned the save-tiddler-actions that are defined in the surrounding EditTemplate. Ctrl-Enter in the name input field now works again.
I'll make another PR for the tags input field.

The partly resolves #9574.

@saqimtiaz
Copy link
Member

Excellent, thank you @yaisog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready

Development

Successfully merging this pull request may close these issues.

3 participants