Bug 156223 - Web Inspector: Should not allow selecting no Timelines when editing in Timeline tab
Summary: Web Inspector: Should not allow selecting no Timelines when editing in Timeli...
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:
Blocks:
 
Reported: 2016-04-04 20:10 PDT by Joseph Pecoraro
Modified: 2016-04-05 15:32 PDT (History)
8 users (show)

See Also:


Attachments
[Patch] Proposed Fix (4.85 KB, patch)
2016-04-05 13:35 PDT, Matt Baker
no flags Details | Formatted Diff | Diff
[Patch] Proposed Fix (4.82 KB, patch)
2016-04-05 14:29 PDT, 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 Joseph Pecoraro 2016-04-04 20:10:20 PDT
* SUMMARY
Should not allow selecting no Timelines when editing in Timeline panel.

* STEPS TO REPRODUCE
1. Open inspector
2. Show Timelines tab
3. Click "Edit"
4. Uncheck all Timelines
5. Click "Done"
  => Poor UI

I would expect that you can't click "Done" unless at least one timeline is selected.
Comment 1 Radar WebKit Bug Importer 2016-04-05 08:13:51 PDT
<rdar://problem/25552221>
Comment 2 Matt Baker 2016-04-05 13:01:25 PDT
We could either:

a) Disable "Done" if no timeline are selected.
b) Prevent deselecting the last timeline.

I think I like the original suggestion (a).
Comment 3 Timothy Hatcher 2016-04-05 13:23:08 PDT
I like option A too.
Comment 4 Matt Baker 2016-04-05 13:35:23 PDT
Created attachment 275686 [details]
[Patch] Proposed Fix
Comment 5 Joseph Pecoraro 2016-04-05 14:14:51 PDT
Comment on attachment 275686 [details]
[Patch] Proposed Fix

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

r=me, but test switching to "change" event

> Source/WebInspectorUI/UserInterface/Views/TimelineTreeElement.js:90
> +        button.addEventListener(WebInspector.TreeElementStatusButton.Event.Clicked, () => { this._dispatchEnabledDidChangeEvent(); });

Seems this click handler would be better off as:

    checkboxElement.addEventListener("change", () => { this._dispatchEnabledDidChangeEvent(); });

Instead of relying on TreeElementStatusButton clicked events, which might not change the checkbox state. And you are guaranteed that this will happen _after_ the checkbox changes. Right now I am not sure of the order.

Note, you need both this and the _clickHandler method, since programmatically changing the checked state of an input does not dispatch a "change" event.
Comment 6 Matt Baker 2016-04-05 14:29:23 PDT
Created attachment 275696 [details]
[Patch] Proposed Fix
Comment 7 WebKit Commit Bot 2016-04-05 15:32:07 PDT
Comment on attachment 275696 [details]
[Patch] Proposed Fix

Clearing flags on attachment: 275696

Committed r199077: <http://trac.webkit.org/changeset/199077>
Comment 8 WebKit Commit Bot 2016-04-05 15:32:12 PDT
All reviewed patches have been landed.  Closing bug.