Added toggle for filtering failed tasks#1325
Conversation
This commit introduces a toggle action to filter out successful tasks from the execution page and expand all failed tasks.
|
|
||
| Button_Label_Browse=Browse... | ||
|
|
||
| Action_FilterFailedTasks_Tooltip=Filter Failed Tasks |
There was a problem hiding this comment.
❌
| Action_FilterFailedTasks_Tooltip=Filter Failed Tasks | |
| Action_FilterFailedTasks_Tooltip=Expand Failures |
|
|
||
| public static String Button_Label_Browse; | ||
|
|
||
| public static String Action_FilterFailedTasks_Tooltip; |
| /** | ||
| * | ||
| */ | ||
| public final class ExpandAllFailedTasksAction extends Action implements SelectionSpecificAction { |
There was a problem hiding this comment.
| public final class ExpandAllFailedTasksAction extends Action implements SelectionSpecificAction { | |
| public final class ExpandFailuresAction extends Action implements SelectionSpecificAction { |
❌ the name doesn't correspond to the functionality. We collapse the tree and expand the nodes representing failed progress events.
|
|
||
| this.contentProvider.toggleFilterFailedItems(); | ||
| setChecked(this.contentProvider.isFilterFailedItemsEnabled()); | ||
|
|
| setChecked(this.contentProvider.isFilterFailedItemsEnabled()); | ||
|
|
||
| this.treeViewer.collapseAll(); | ||
|
|
| this.treeViewer.collapseAll(); | ||
|
|
||
| Object rootObject = this.treeViewer.getInput(); | ||
|
|
| toolbarManager.appendToGroup(MultiPageView.PAGE_GROUP, new CollapseAllTreeNodesAction(getPageControl().getViewer())); | ||
| toolbarManager.appendToGroup(MultiPageView.PAGE_GROUP, new ShowFilterAction(getPageControl())); | ||
| ExpandAllFailedTasksAction action = new ExpandAllFailedTasksAction(getPageControl().getViewer()); | ||
| action.setContentProvider((ExecutionPageContentProvider)getPageControl().getViewer().getContentProvider()); |
There was a problem hiding this comment.
❌ this can happen in the action's constructor. Then, you can use the same pattern as around, ie
toolbarManager.appendToGroup(MultiPageView.PAGE_GROUP, new ExpandAllFailedTasksAction(...));
There was a problem hiding this comment.
I didn't add ExecutionPageContentProvider as a constructor parameter, since UiContributionManager also takes an instance of the action and I don't have access to the content provider there.
There was a problem hiding this comment.
By the looks of it, UiContributionManager contributes actions to the tasks view. In other words it's independent from the (execution) view this PR aims to improve. You probably don't need to modify it whatsoever.
| } | ||
|
|
||
| public void toggleFilterFailedItems() { | ||
| this.filterFailedItems = !this.filterFailedItems; |
There was a problem hiding this comment.
❌ Please don't do this. Use explicit getters and setters.
| */ | ||
| public class ExecutionPageContentProvider implements ITreeContentProvider { | ||
|
|
||
| private boolean filterFailedItems = false; |
There was a problem hiding this comment.
❌ This is wrong as the state will get lost when the IDE restarts. Instead, store the state in WorkspaceConfiguration. Then you can initialize the action from the worksace configuration and update it upon a toggle action.
There was a problem hiding this comment.
Scratch that, the proper place to store the state is ExecutionViewState.
donat
left a comment
There was a problem hiding this comment.
❌ And the test coverage is missing. We should have something like ExecutionViewExpandAndCollapseAllTest.
|
@Tanish-Ranjan a gentle ping re:my review. If you are still planning to fix the review items, let me know. |
|
@donat I have fixed all the review items. I am trying to test it thoroughly before submitting it for review. |
This commit introduces a toggle action to filter out successful tasks from the execution page and expand all failed tasks.
Fixes #970
Context
Previously, there was only the option to expand and collapse all tasks, making it harder to focus on failures. This change introduces a toggle action that, when enabled, hides successful tasks from the hierarchy in the execution page. When disabled, the full task hierarchy is restored.
This improvement makes it easier for users to debug failures without unnecessary distractions.