@Mat two more things. Firstly, I haven't thought about adding keyboard navigation support yet, i.e. how to allow a user to choose an autocompleted title using just the keyboard. So that's one challenge still lying ahead.
Secondly: If we move the reveal for the popup in *$:/core/ui/* *EditTemplate/body/editor*, inside of the closing </$edit> tag, it would allow editor toolbar commands to work when included in the popup. Nice bonus. Furthermore, it would mean that any commands you add in the popup can also make use of https://tiddlywiki.com/#WidgetMessage%3A%20tm-edit-text-operation We could also extend tm-edit-text to support "replace at caret position" to make the insertion of completed strings easier. On Thursday, July 9, 2020 at 9:19:24 AM UTC+2, Saq Imtiaz wrote: > > Hi Mat, > > Let's hope I haven't been too bold and jinxed us, and that we wont find > some killer bug in my approach ;) > > >> Can I ask, is @Jeds construct of use? It obviously has been very useful >> for my demos, and I also recall Snowgoon bringing up some strenghts >> <https://groups.google.com/d/msg/tiddlywikidev/scGK9fBKsZ8/nN1nF3szAgAJ> >> with it that his solution didn't have. Or maybe your approach covers things >> fully anyway? >> > > I think my approach covers the strengths Snowgoon alluded to, while also > not being a global approach which as he mentioned my not be needed. I think > the major limitation of my approach is that the action-popupcaret widget > has to be fired by the edit widget, to know which text area to work, get > the position of the iframe correctly etc. However since the idea of a caret > position is specific to input/textareas I don't see this as a real issue. I > am not familiar with the details of Jed's approach, so if you feel we are > loosing something useful do point it out. > > >> The use of caret position by character count does seem advantageous >> especially for the subsequent text manipulation. BTW, I'm assuming your >> "floating editor toolbar" also keeps track of start-stop position of the >> selected text. >> > > Yes. That was a super quick hack while on the phone, combining techniques > from my work with Snowgoon's plugin, some tweaks in Streams to do with > dividing text at the caret position, work on your demo, and a request for a > more slimmed down editor toolbar in Streams. > > It also keeps track of the selected text, the tiddler text before the > selected text, and after the selected text. All updated on each keystroke. > > >> >>> - the ability for *edit-text widget* to fire actions on input, taken >>> from this *PR *(https://github.com/Jermolene/TiddlyWiki5/pull/4725 >>> >>> <https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2FJermolene%2FTiddlyWiki5%2Fpull%2F4725&sa=D&sntz=1&usg=AFQjCNEWwFce8VqOqH2TG_nbRy1PtDW3cQ>) >>> >>> No reason to hesitate to use this. The actions part of it can even be >>> made >>> a separate PR to get it merged sooner, or be packaged as a tiny plugin >>> until it is merged. >>> >>> It does sound sensible with a separate primitive to fire actions from >> it. Would that be an actions attribute, as exists in a few other widgets? >> > > Currently it is inputActions, to differentiate from actions attributes on > other widgets that are fired on click, whereas these fire when there is > input into the textarea. > >> >>> - [...] also sets a field in the state tiddler for the popup, >>> telling us the position of the caret. This is the position in characters >>> from the start of the text. We can access this in the popup. >>> >>> :-D Is this number updated by each key stroke as you type? Just curious. >> > > Yes. Though annoyingly the core handling of the reveal widget doesn't > update the position of an already open popup when its state tiddler is > updated. I suspect this is an oversight, and anyway it isn't a deal breaker > for now. Once we better understand if it would be useful, and what the > impact on other things would be, I may open a PR for this. > > I'll get a cleaned up demo for you soon, hopefully today. > Cheers, > > Saq > -- You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/da75e412-f9b7-4457-8aaf-c6158e7df2a3o%40googlegroups.com.
