01:42:58 RRSAgent has joined #undomanager 01:42:58 logging to https://www.w3.org/2019/09/18-undomanager-irc 01:43:01 RRSAgent, make logs public 01:43:11 koalie has changed the topic to: https://w3c.github.io/tpac-breakouts/sessions.html 01:43:35 koalie has left #undomanager 08:31:41 RRSAgent has joined #undomanager 08:31:41 logging to https://www.w3.org/2019/09/18-undomanager-irc 08:32:01 Meeting: UndoManager API 08:32:13 RSSAgent: Meeting: UndoManager API 08:32:25 RRSAgent Meeting: UndoManager API 08:32:28 heycam has joined #undomanager 08:32:36 RRSAgent Scribe: Devin Rousso 08:32:43 RRSAgent ScribeNick: drousso 08:33:08 Meeting: UndoManager API 08:33:10 Scribe: Devin Rousso 08:33:19 ScribeNick: drousso 08:33:55 RRSAgent create minutes 08:34:16 megan: system apps dont have access to these functions 08:34:22 megan: system apps have hidden contenteditable 08:34:27 smaug has joined #undomanager 08:34:40 (oops, I meant web apps, not system apps, for the last message) 08:35:00 megan: platforms that have keyboards can do undo/redo with command/control Z/Y 08:35:09 megan: without a keyboard, systems usually have gestures to allow for undo 08:35:26 megan: but no way for web apps to know what these gestures are to enable undo/redo in content rich editors 08:35:36 jyasskin has joined #undomanager 08:35:49 Zakim has joined #undomanager 08:35:52 megan: on macOS, anything in Edit menu or triple-tap (examples) wouldn't notify the web content 08:36:48 megan: API would allow interactive web applications to undo/redo more easily 08:36:56 megan: proposal also allows for multiple undo/redo stacks 08:37:36 megan: UndoItem has `undo`/`redo` functions and a `label` string for displaying (e.g. Edit menu) to inform user 08:38:19 megan: UndoManager has a "stack" of items which can be accessed `item(n)`, as well as a current `position` and a total `length` 08:38:30 megan: undo is "below" `position`, redo is "above" 08:38:54 megan: UndoManager able to add items to the top and undo/redo the item at `posiiton` 08:39:20 megan: extend element to create an `undoManager` per-element 08:40:11 megan: `undoScope` defines the scope for `undoManager`, where items would crawl up the tree to find the closest `undoScope` 08:41:20 megan: ability to coalesce/merge items in the stack, so that items can individually be put onto the undo stack, but can be done all at once during undo/redo 08:41:29 megan: set via a `merge` flag on each item 08:42:29 whsieh (prepares demo) 08:43:37 sanketj has joined #undomanager 08:44:11 whsieh (demo of drawing text on an iPad, and explaining that each stroke is added to the undo manager, and undo/redo is coalesced for strokes in quick succession) 08:45:23 whsieh (demo/explanation of how CodeMirror uses a hidden `contenteditable` to handle modifications, and how this doesn't work well with Edit > Undo/Redo) 08:46:23 whsieh (continued demo showing how CodeMirror could take advantage of an UndoManager to let CodeMirror properly handle Edit > Undo/Redo, including setting the label) 08:46:44 q+ 08:46:46 NavidZ_ has joined #undomanager 08:46:49 danclark has joined #undomanager 08:46:54 q+ 08:46:54 q+ 08:46:59 q+ 08:47:02 grisha_ has joined #undomanager 08:47:04 mustaq has joined #undomanager 08:47:05 birtles has joined #undomanager 08:47:14 q+ 08:47:17 https://rniwa.github.io/undo-api/ 08:47:21 https://whsieh.github.io/UndoManager/ 08:47:25 ack jyasskin 08:47:34 q+ 08:47:38 takeru_ has joined #undomanager 08:47:52 jyasskin can the label match languages with the system? 08:47:57 dmurph has joined #undomanager 08:48:07 whsieh seems like a similar problem to any other API vended from the DOM 08:48:13 queue+ 08:48:19 whsieh not a new problem to UndoManager 08:48:39 rniwa would be weird for a chinese/japanese user to see a language that was in english 08:49:00 whsieh cocoa platforms solved this by making the property names "localizedLabel" so it's obvious to the developer 08:49:08 queue 08:49:31 ack smaug 08:49:32 rniwa alternative approach that couldve been taken would be to have a limited list of labels that are hardcoded, but that wouldnt be extensible/flexble 08:49:47 q+ persontomyright 08:49:57 MasayaIkeo has joined #undomanager 08:49:58 smaug how does this integrate with existing undo manager? Firefox has internal undo manager. is this API on top of browser, or can user agent add items to undo stack? 08:50:20 queue+ 08:50:26 rniwa browser looks at currently active focusable area and walks up DOM tree to find first ancestor with `undoManager` and adds items to that 08:50:46 ack heycam 08:50:48 rniwa callbacks in that case are browser "functions" 08:50:49 q- 08:51:06 q+ 08:51:15 saschanaz has joined #undomanager 08:52:21 heycam this is a bit different than other cases of page text being used in chrome, as it's possibly the first time it's used in conjunction with system text 08:52:30 whsieh that is a bit odd 08:52:55 heycam what's the advantage of merging being in the API vs having the developer doing it themselves? 08:53:00 whsieh mainly for convenience 08:53:32 rniwa browser could do its own things, so the only way to be able to merge with the browser is to have an API level merge since the browser created the item 08:53:55 heycam so both system and user items are present in the list? 08:53:59 whsieh rniwa yes 08:54:46 rniwa right now, execCommand cant really be used because of how it affects the undo/redo stack, which isn't otherwise able to be affected by script (without this proposal) 08:55:15 ack NavidZ_ 08:55:20 whsieh if you want to augment/override an existing execCommand, you might want to replace the default label 08:56:21 NavidZ_ does the crawl up the ancestor keep going if the stack is empty? 08:56:40 whsieh no, we want to stop if you reach an ancestor that has an undo manager but its stack is empty 08:56:51 ack sanketj 08:56:57 q+ 08:56:58 whsieh otherwise, if you kept undoing it would suddenly start undoing things elsewhere on the page 08:57:20 sanketj is the label idea a concept that's from the mac? 08:57:21 whsieh it exists on macos and ios 08:57:28 sanketj other apps can customize that? 08:57:32 whsieh yes, native apps can customize it 08:58:00 rniwa this label is important for accessibility, like for cases where the user cant see what UI is on the screen 08:58:35 sanketj what about pages that already have the concept of an undo manager? 08:58:46 sidvishnoi has joined #undomanager 08:58:52 rniwa ideally, those pages would sync with the undo manager 08:59:04 sanketj you'd have to plug into using this UndoManager API in order to do this functionality? 08:59:14 ack danclark 08:59:20 rniwa yes, since the OS itself doesn't have such a primitive, so there needs to be an API 08:59:48 danclark what's the fragility of this if the page has been modified since an undo function was created? 09:00:09 danclark like if some scripted action modifies the state of the DOM after an undo item was added 09:00:24 whsieh this a problem right now if you built your own undo stack system 09:01:20 danclark old edge HTML would try to apply something reasonable to undo/redo items as a result of scripted actions 09:01:35 rniwa that assumes that scripted actions are as a result of some interaction, which isn't the case here 09:02:32 rniwa we could add something in the future that could do that sort of "house keeping" 09:02:40 ack dmurph 09:03:30 dmurph would be cool if undo state could be serialized/saved, so you could come back later and undo a bunch of stuff 09:03:44 dmurph but it seems like that isn't completely possible due to the browser items 09:04:10 whsieh we could probably serialize most regular text actions, but there are some actions that wouldn't be serializable 09:04:56 rniwa you could use a MutationObserver to see what the browsers doing (at least for user commands), and serialize it yourself to save/restore 09:05:20 dmurph potential abuse scenarios? something spamming the stack? 09:05:30 whsieh probably want to gate this on some sort of user interaction/activation 09:05:52 whsieh most actions are probably as a result of a user action 09:06:16 q- 09:06:16 whsieh might also want some maximum list of items in the list, as without that you may run into memory/performance issues 09:06:44 dmurph there could be a conflict between serializing for save/restore and having a limit on the number of items 09:06:59 christianliebel has joined #undomanager 09:07:10 whsieh thats true, but it's a potential tradeoff that we'll have to make and we'll see if it's really requested 09:07:40 grisha_ setting a restriction may have problems for huge documents with things like find and replace 09:07:45 ack persontomyright 09:07:46 whsieh you could merge them all together though 09:09:02 q+ 09:09:02 johannas i feel like we'd likely only put one item on the undo stack, so we get the callbacks, but we'd still maintain our own stack 09:09:34 johannas collaborative editing might cause the undo stack to grow or shrink from the other person 09:09:52 q+ 09:09:57 johannas and using the undo stack may not work nicely with preserving the local undo stack between people who are collaborating 09:10:19 q+ to talk about how abuse only hurts yourself 09:10:23 johannas gating behind a user gesture may prevent collaborative editing undo/redo since they can happen whenever 09:10:29 whsieh that is still being considered 09:11:40 whsieh adding a new undo would remove all existing redo items 09:13:52 sanketj it seems like what he really wants is a way of setting the undo/redo label independently of adding/removing items from the stack 09:14:02 rniwa that would be harder to do at a native level 09:15:50 ack mustaq 09:16:03 johannas this proposal is nice because modals wouldn't be able to break/pollute the main undo stack since you can scope it to a node 09:16:38 ack birtles 09:16:40 mustaq (sorry i missed this) 09:16:49 rniwa whatever the browser does right now, this wouldn't affect that 09:18:09 birtles would cross origin navigation keeps the undo/redo stack? 09:18:22 rniwa this hasn't been defined in the spec yet 09:18:44 s/birtles/musaq (for last message) 09:18:53 s/birtles/mustaq (for last message) 09:19:20 birtles is there interop between browsers for what gets added by the browser to the undo/redo stack? is there a way to check? 09:19:44 rniwa undo/redo behavior is really dependent on the platform, and probably can't be spec 09:19:57 birtles can a web developer inspect and figure out what is getting added? 09:20:10 rniwa you may be able to intercept various events and check the stack or the DOM 09:20:28 birtles worried about adding a redundant item because the system already added it 09:20:47 rniwa we could add an undo "change" event that would be fired (i missed the rest) 09:21:38 birtles are values on the undo item preserved? 09:21:56 ack heycam 09:22:04 whsieh yes, but we should also probably add some sort of `data` that can be held by the item 09:22:49 q+ johannes 09:23:21 heycam on platforms where form control scoping isn't per-page, would form control items automatically create their own scope? 09:23:45 rniwa the spec could be made to allow the platform to do different things 09:24:20 whsieh is it difficult to add this functionality? 09:24:24 heycam possibly not 09:24:44 whsieh WebKit has the opposite problem, where everything is global, so WebKit has to do the work to split it up 09:24:58 heycam the API should probably be flexible between platforms then 09:25:02 rniwa yes, we agree 09:25:15 ack christianliebel 09:25:18 q- johannes 09:26:03 christianliebel what happens if i use an english OS but the app is a different language? what would the label do then? 09:26:19 christianliebel what's the "interaction" between the system, app, and page's languages? 09:26:38 christianliebel what about if any of those are changed in the middle of editing? 09:26:50 whsieh this may also be a problem on macOS right now too 09:27:03 christianliebel having a set of predefined operations may be useful 09:27:31 whsieh that would help the editor case, but we'd like this to be powerful enough to handle feasibly anything that would want to be undoable on the web 09:27:42 rniwa labeling undo/redo doesn't appear to be a macOS only thing either 09:28:02 ack jyasskin 09:28:02 jyasskin, you wanted to talk about how abuse only hurts yourself 09:29:04 jyasskin limiting abuse seems like it only would hurt the page that's doing the abuse 09:29:16 s/limiting abuse/abuse/ 09:29:32 whsieh that could potentially hurt other tabs too, like having a huge undo stack and switching between tabs 09:30:41 present+ 09:30:47 present+ 09:30:47 present+ 09:31:00 present+ 09:31:05 present+ Mustaq Ahmed 09:31:10 present+ whsieh 09:31:13 present+ rniwa 09:31:20 present+ megan 09:31:20 RRSAgent make logs public 09:33:21 MasayaIk_ has joined #undomanager 10:06:29 MasayaIkeo has joined #undomanager 12:07:21 christianliebel has joined #undomanager 13:19:06 Zakim has left #undomanager 16:24:46 dom has joined #undomanager 16:24:50 RRSAgent, draft minutes 16:24:50 I have made the request to generate https://www.w3.org/2019/09/18-undomanager-minutes.html dom 16:24:56 RRSAgent, make log public 16:26:34 dom has left #undomanager