Bug 337999 - Undo mark as read command
Summary: Undo mark as read command
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 enhancement with 1 vote (vote)
Target Milestone: 3.10   Edit
Assignee: Tomasz Zarna CLA
QA Contact:
URL:
Whiteboard: sprint=6;effort=2;
Keywords: contributed, noteworthy
Depends on:
Blocks: 342928
  Show dependency tree
 
Reported: 2011-02-23 12:26 EST by Sam Davis CLA
Modified: 2013-09-01 10:20 EDT (History)
3 users (show)

See Also:


Attachments
patch (8.71 KB, patch)
2011-03-01 01:25 EST, Sam Davis CLA
no flags Details | Diff
mylyn/context/zip (13.85 KB, application/octet-stream)
2011-03-01 01:25 EST, Sam Davis CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Davis CLA 2011-02-23 12:26:10 EST
If you accidently mark a query or date bin as read, you have no easy way to find out what had changed. If you mark the incoming bin as read, it empties and then there's no way of finding out what was there, short of examining every task in your task list. There should be an "undo mark as read" command.
Comment 1 Steffen Pingel CLA 2011-02-23 15:58:52 EST
+1 That would be very useful.
Comment 2 Sam Davis CLA 2011-03-01 01:25:55 EST
Created attachment 190020 [details]
patch
Comment 3 Sam Davis CLA 2011-03-01 01:25:57 EST
Created attachment 190021 [details]
mylyn/context/zip
Comment 4 Steffen Pingel CLA 2011-03-01 01:43:31 EST
That looks like a good start. Could you try using the regular workbench operation history to make this work through Edit > Undo (http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/wrkAdv_undo_ide.htm )?
Comment 5 Sam Davis CLA 2011-03-01 02:30:55 EST
That seems like overkill to me - I can't really imagine needing multiple undo, or redo mark as read, and I wouldn't expect it to be in the edit menu.

Maybe you should create a bug for turning all task list operations (DND, delete, etc.) into undoable operations. :)
Comment 6 Jörg Thönnes CLA 2011-05-27 08:36:39 EDT
Any chance to get this implemented using the given patch?
Comment 7 Steffen Pingel CLA 2011-05-27 09:19:30 EDT
The patch is a good start but we'll need to take another pass at this to integrate the implementation with the standard platform mechanism.
Comment 8 Tomasz Zarna CLA 2013-06-14 11:46:19 EDT
Sam's patch on Gerrit: https://git.eclipse.org/r/#/c/13819/
Comment 9 Sam Davis CLA 2013-06-20 18:49:23 EDT
In addition to using the platform undo/redo mechanism, I think we should probably show the undo mark as read command in the mark as menu as well to make it more discoverable. Thoughts?
Comment 10 Tomasz Zarna CLA 2013-06-21 06:18:06 EDT
In case of a task, which has just been marked as read, should the "Undo" command replace the "Mark as Unread" one in the "Mark as" menu? Showing them both may be confusing.
Comment 11 Jörg Thönnes CLA 2013-06-21 06:23:33 EDT
(In reply to comment #10)
> In case of a task, which has just been marked as read, should the "Undo"
> command replace the "Mark as Unread" one in the "Mark as" menu? Showing them
> both may be confusing.

How about "Undo mark as read"?
Comment 12 Sam Davis CLA 2013-06-21 18:51:05 EDT
But doesn't the undo operation undo marking multiple tasks read, not just the selected task? Maybe it should be called "Undo mark tasks read."
Comment 13 Tomasz Zarna CLA 2013-08-12 12:23:44 EDT
In the latest patch set [1], Ctrl+Z and Ctrl+Y work but:

* only when Task List or Task Editor is active
* after marking tasks as read/unread in bulk, undo/redo needs to be done for each task individually
* comment 9 not implemented (yet)

[1] https://git.eclipse.org/r/#/c/13819/3
Comment 14 Tomasz Zarna CLA 2013-08-13 08:12:58 EDT
https://git.eclipse.org/r/#/c/13819/4 :
* Undo/Redo available only when Task List or Task Editor is active
* after marking tasks as read/unread in bulk, Undo/Redo needs to be done for each task individually
* -comment 9 not implemented (yet)-
* no keybindings in the context menu
Comment 15 Sam Davis CLA 2013-08-13 14:13:07 EDT
(In reply to comment #14)
> https://git.eclipse.org/r/#/c/13819/4 :
> * Undo/Redo available only when Task List or Task Editor is active

I think that's the desired behaviour but currently it works when the package explorer is active. It seems the commands get added to the global history so if you mark a task and then rename a resource in the package explorer, you have to undo the latter before undoing the first. I think if possible they should have separate undo/redo histories.

> * after marking tasks as read/unread in bulk, Undo/Redo needs to be done for
> each task individually

We should fix this. I think you can just override execute(ExecutionEvent event, ITaskContainer item). You might have to duplicate or refactor some of the logic in process.

I wonder if the undo/redo commands should show in the mark as menu instead of at the top level?
Comment 16 Tomasz Zarna CLA 2013-08-19 08:20:39 EDT
(In reply to comment #15)
> I wonder if the undo/redo commands should show in the mark as menu instead of at
> the top level?

I agree, but I failed to implement it without a hack [1], so the latest patch set [2] doesn't display Undo/Redo actions in the context menu (they are available in the main menu and via shortcuts). Other than that, the change is ready to review.

[1] https://git.eclipse.org/r/#/c/13819/5/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskListViewActionGroup.java
[2] https://git.eclipse.org/r/#/c/13819/6
Comment 17 Sam Davis CLA 2013-08-22 17:05:25 EDT
I think we shouldn't have the undo/redo commands in the task editor since they prevent using undo/redo when typing in attribute editors.
Comment 18 Sam Davis CLA 2013-08-26 12:54:28 EDT
Tomek's change has been merged. When the task list is active, users can undo/redo marking tasks (un)read from the Edit menu or using the keyboard shortcuts. Thanks very much for the contribution!
Comment 19 Steffen Pingel CLA 2013-08-29 04:08:26 EDT
I have an API tooling error in my workspace for TasksUiUtil.getUndoContext() which is missing an @since tag. This bug is not tagged as [api] and I don't see discussion around exposing the undo context as API. Is that needed? I wonder if the method could be moved to TasksUiInternal instead.

Tomek, Sam, please set up an API baseline against Mylyn 3.9 to detect those problems: http://wiki.eclipse.org/Mylyn/Contributor_Reference#API_Baseline.
Comment 20 Tomasz Zarna CLA 2013-08-29 06:51:25 EDT
(In reply to comment #19)
> I wonder if the method could be moved to TasksUiInternal instead.

https://git.eclipse.org/r/15961

> Tomek, Sam, please set up an API baseline against Mylyn 3.9 to detect those
> problems: http://wiki.eclipse.org/Mylyn/Contributor_Reference#API_Baseline.

I did that, but didn't notice that extracting the Mylyn API zip to the plugins folder doesn't make it appear in the baseline. I fixed that and now see the error. Sorry for the trouble.
Comment 21 Tomasz Zarna CLA 2013-09-01 10:20:16 EDT
Fixed the issue with TasksUiUtil.getUndoContext() in 0ec9ad415a5605216ac532ab1afd2fe1085ade96