Bug 154561 - Web Inspector: TimelineRuler should have a "select all" mode
Summary: Web Inspector: TimelineRuler should have a "select all" mode
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Matt Baker
URL:
Keywords: InRadar
Depends on: 154613
Blocks: 153033
  Show dependency treegraph
 
Reported: 2016-02-22 15:41 PST by Matt Baker
Modified: 2016-02-24 09:56 PST (History)
8 users (show)

See Also:


Attachments
[Patch] Proposed Fix (6.14 KB, patch)
2016-02-22 16:17 PST, Matt Baker
no flags Details | Formatted Diff | Diff
[Video] "select all" behavior (488.33 KB, video/mp4)
2016-02-23 22:07 PST, Matt Baker
no flags Details
[Patch] Proposed Fix (7.67 KB, patch)
2016-02-23 22:20 PST, Matt Baker
no flags Details | Formatted Diff | Diff
[Patch] Proposed Fix (7.33 KB, patch)
2016-02-24 08:50 PST, Matt Baker
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Baker 2016-02-22 15:41:27 PST
* SUMMARY
TimelineRuler should have a "select all" mode. When active, selection handles should be hidden, and the selection start and end properties should return the ruler's start and ends times. Clicking & dragging to create a new selection should cause the ruler to no longer "select all".

UI making use of this mode will be added in: https://bugs.webkit.org/show_bug.cgi?id=153033.
Comment 1 Radar WebKit Bug Importer 2016-02-22 15:41:51 PST
<rdar://problem/24779872>
Comment 2 Matt Baker 2016-02-22 16:17:19 PST
Created attachment 271964 [details]
[Patch] Proposed Fix
Comment 3 Timothy Hatcher 2016-02-22 16:35:03 PST
Comment on attachment 271964 [details]
[Patch] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=271964&action=review

> Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js:265
> +    set selectAll(x)

entireRangeSelected? select, as a verb bothers me, as a property name.

> Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js:297
> +        return this._selectAll ? this._endTime : this._selectionEndTime;

This is still a bounded time. I suspect this will cause things to filter out when you zoom in to tighten the time range. Does this result get used?
Comment 4 Matt Baker 2016-02-22 16:46:43 PST
(In reply to comment #3)
> Comment on attachment 271964 [details]
> [Patch] Proposed Fix
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=271964&action=review
> 
> > Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js:265
> > +    set selectAll(x)
> 
> entireRangeSelected? select, as a verb bothers me, as a property name.
> 
> > Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js:297
> > +        return this._selectAll ? this._endTime : this._selectionEndTime;
> 
> This is still a bounded time. I suspect this will cause things to filter out
> when you zoom in to tighten the time range. Does this result get used?

We could use the default selection bounds (0 and Infinity), and make the necessary adjustments to timeline views.
Comment 5 Timothy Hatcher 2016-02-22 16:49:00 PST
(In reply to comment #4)
> (In reply to comment #3)
> > Comment on attachment 271964 [details]
> > [Patch] Proposed Fix
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=271964&action=review
> > 
> > > Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js:265
> > > +    set selectAll(x)
> > 
> > entireRangeSelected? select, as a verb bothers me, as a property name.
> > 
> > > Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js:297
> > > +        return this._selectAll ? this._endTime : this._selectionEndTime;
> > 
> > This is still a bounded time. I suspect this will cause things to filter out
> > when you zoom in to tighten the time range. Does this result get used?
> 
> We could use the default selection bounds (0 and Infinity), and make the
> necessary adjustments to timeline views.

That would be easier to understand.
Comment 6 Matt Baker 2016-02-22 16:51:42 PST
(In reply to comment #5)
> (In reply to comment #4)
> > (In reply to comment #3)
> > > Comment on attachment 271964 [details]
> > > [Patch] Proposed Fix
> > > 
> > > View in context:
> > > https://bugs.webkit.org/attachment.cgi?id=271964&action=review
> > > 
> > > > Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js:265
> > > > +    set selectAll(x)
> > > 
> > > entireRangeSelected? select, as a verb bothers me, as a property name.
> > > 
> > > > Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js:297
> > > > +        return this._selectAll ? this._endTime : this._selectionEndTime;
> > > 
> > > This is still a bounded time. I suspect this will cause things to filter out
> > > when you zoom in to tighten the time range. Does this result get used?
> > 
> > We could use the default selection bounds (0 and Infinity), and make the
> > necessary adjustments to timeline views.
> 
> That would be easier to understand.

The grid-based timeline views handle this fine, but OverviewTimelineView and MemoryTimelineView will need special handling for selectionEndTime === Infinity.
Comment 7 Matt Baker 2016-02-23 22:07:20 PST
Created attachment 272090 [details]
[Video] "select all" behavior

Doubling-clicking the ruler toggles the ruler between the user-defined selection (if any), and "everything selected".

It's a convenient interaction for the initiated, but not very discoverable. Upcoming UI (see https://webkit.org/b/153033) will make it accessible.
Comment 8 Matt Baker 2016-02-23 22:20:06 PST
Created attachment 272093 [details]
[Patch] Proposed Fix
Comment 9 Timothy Hatcher 2016-02-24 07:55:52 PST
Comment on attachment 272093 [details]
[Patch] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=272093&action=review

> Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js:304
> +        return this._selectionStartTime === this._zeroTime && this._selectionEndTime === Number.MAX_VALUE;

You might need to add this in set zeroTime().

if (this.entireRangeSelected) { this._selectionStartTime = newZeroTime; }

> Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js:708
> +    _handleDoubleClick(event)
> +    {
> +        if (this.entireRangeSelected) {
> +            this.selectionStartTime = this._lastSelectionStartTime;
> +            this.selectionEndTime = this._lastSelectionEndTime;
> +        } else {
> +            this._lastSelectionStartTime = this.selectionStartTime;
> +            this._lastSelectionEndTime = this.selectionEndTime;
> +
> +            this.selectEntireRange();
> +        }
> +    }

I like double click to get the entire range. I don't think double click to go back to the previous selection is as clear or compelling. The user can always just drag out a new selection.

But this is fine as-is.
Comment 10 Matt Baker 2016-02-24 08:50:36 PST
Created attachment 272115 [details]
[Patch] Proposed Fix
Comment 11 WebKit Commit Bot 2016-02-24 09:41:37 PST
Comment on attachment 272115 [details]
[Patch] Proposed Fix

Clearing flags on attachment: 272115

Committed r197034: <http://trac.webkit.org/changeset/197034>
Comment 12 WebKit Commit Bot 2016-02-24 09:41:41 PST
All reviewed patches have been landed.  Closing bug.
Comment 13 Timothy Hatcher 2016-02-24 09:46:54 PST
Comment on attachment 272115 [details]
[Patch] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=272115&action=review

> Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js:179
> +        if (this.entireRangeSelected)
> +            this.selectionStartTime = this._zeroTime;

This needed to happen before "this._zeroTime = x", otherwise the getter for entireRangeSelected will fail, because _selectionStartTime will not equal _zeroTime anymore.
Comment 14 Timothy Hatcher 2016-02-24 09:52:29 PST
I'll land a follow up fix.
Comment 15 Timothy Hatcher 2016-02-24 09:56:30 PST
Landed a follow up in https://trac.webkit.org/r197035.