Bug 182917 - [Dialogs] Improve progress in FilteredItemsSelectionDialog
Summary: [Dialogs] Improve progress in FilteredItemsSelectionDialog
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 RC2   Edit
Assignee: Krzysztof Michalski CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed, polish
Depends on:
Blocks: 178256 180470 183143
  Show dependency tree
 
Reported: 2007-04-18 06:24 EDT by Markus Keller CLA
Modified: 2007-06-22 07:06 EDT (History)
3 users (show)

See Also:


Attachments
Proposition of changes (4.47 KB, patch)
2007-05-16 14:03 EDT, Krzysztof Michalski CLA
no flags Details | Diff
Proposition of modifications 001 (7.19 KB, patch)
2007-05-23 16:26 EDT, Krzysztof Michalski CLA
no flags Details | Diff
Proposition of modifications 002 (13.08 KB, patch)
2007-05-24 09:49 EDT, Krzysztof Michalski CLA
no flags Details | Diff
Patch refreshed to head (12.21 KB, patch)
2007-05-24 11:41 EDT, Krzysztof Michalski CLA
no flags Details | Diff
Typos fix (1.39 KB, patch)
2007-05-24 13:56 EDT, Krzysztof Michalski CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2007-04-18 06:24:54 EDT
I20070417-0800

Progress notification in the FilteredItemsSelectionDialog needs some polish:

- FilterJob#filterContent(GranualProgressMonitor) keeps 50% of the progress monitor for virtually no work (checking whether the PM has been cancelled and remembering results, which is a short-running operation). Due to the GranualProgressMonitor's coarse-grained updates, this results in only 40% of the PM being actually used for reporting search progress from #fillContentProvider(..).
=> The implementor's search job should get about 95% of the total PM.

- The GranualProgressMonitor's decision to show only 20 discrete progress states is not helpful in practice. There's no good reason why the user should be informed of an update from 5% to 6%, but not for an update from 35% to 36%.
=> The best way to handle progress updates is not by displaying only selected progress steps, but by throttling the RefreshCacheJob to run only every 200ms.

See also 178256 for delaying progress updates after filter changes.
Comment 1 Krzysztof Michalski CLA 2007-05-16 14:03:04 EDT
Created attachment 67469 [details]
Proposition of changes
Comment 2 Markus Keller CLA 2007-05-22 10:14:38 EDT
The patch does not fix the problem in FilterJob#filterContent(..) that just 500 of  1000 ticks are available for reporting progress in the client's content provider.

Furthermore, I would delay the RefreshProgressMessageJob a bit longer initially, e.g. 500 ms.
Comment 3 Tod Creasey CLA 2007-05-22 11:37:44 EDT
This will have to wait until 3.4
Comment 4 Tod Creasey CLA 2007-05-23 08:06:42 EDT
As this is blocking RC2 bugs this should be done for RC2.
Comment 5 Krzysztof Michalski CLA 2007-05-23 16:26:34 EDT
Created attachment 68451 [details]
Proposition of modifications 001
Comment 6 Tod Creasey CLA 2007-05-23 16:32:16 EDT
schedulePrgressRefresh is mispelled

what is this code in internalWorked about? It seems awfully complicated so it will need some documentation

if ((((int) (((worked - work) * 10) / totalWork)) < ((int) ((worked * 10) / totalWork)))|| (((int) ((worked * 10) / totalWork)) == 0))
				if (!isCanceled())
					updateProgressMessage();
Comment 7 Szymon Brandys CLA 2007-05-24 04:56:57 EDT
Method ContentProvider#setProgressMessage should be removed. It is no longer used.
Comment 8 Szymon Brandys CLA 2007-05-24 05:17:29 EDT
From the GranualProgressMonitor constructor isFiltering argument should be removed. It is not used.
Comment 9 Markus Keller CLA 2007-05-24 05:24:27 EDT
(In reply to comment #5)
> Created an attachment (id=68451) [details]
> Proposition of modifications 001

- constructor FilterHistoryJob() has a wrong Javadoc
- GranualProgressMonitor(..) Javadoc: remove "@param contentProvider"
- schedulePrgressRefresh(): spelling error and broken @param Javadoc

- first part of comment 0 / comment 2 not fixed

- The change in updateProgressLabel() is problematic: Letting clients set the message to "" will interfere with the RefreshProgressMessageJob. Note that clients can also call refresh() or scheduleProgressMessageRefresh(), which will both set the progress message to "". You have to ensure that
a) progress is being updated as long as a filter job is running
b) progress is only set to "" after filter job is done
I think this cannot be done without having a field somewhere that stores the current message.
Comment 10 Krzysztof Michalski CLA 2007-05-24 09:49:38 EDT
Created attachment 68570 [details]
Proposition of modifications 002
Comment 11 Tod Creasey CLA 2007-05-24 10:51:13 EDT
Szymon could you refersh this patch against HEAD please
Comment 12 Markus Keller CLA 2007-05-24 11:23:31 EDT
(In reply to comment #10)
> Created an attachment (id=68570) [details]
> Proposition of modifications 002

Looks good in the runtime workbench when I change schedule(); in
RefreshProgressMessageJob.scheduleProgressRefresh(..) to this:

  //Schedule with initial delay to avoid flickering when the user types quickly:
  schedule(200);

Please add this initial delay to the updated patch.
Comment 13 Krzysztof Michalski CLA 2007-05-24 11:41:36 EDT
Created attachment 68597 [details]
Patch refreshed to head

Updated according to Markus comment.
Comment 14 Markus Keller CLA 2007-05-24 12:12:16 EDT
The version in HEAD looked good in a quick test drive.

Problems in the source:
- "receiver" was spelled correctly in 1.47. "reciever" is wrong.
- Please add the suggested documentation (or a variation) from comment 12. The next one reading the source should see immediately why the delay is necessary.
Comment 15 Krzysztof Michalski CLA 2007-05-24 13:56:14 EDT
Created attachment 68624 [details]
Typos fix
Comment 16 Tod Creasey CLA 2007-05-24 14:09:26 EDT
Typo patch released.