New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 657982 link

Starred by 6 users

Issue metadata

Status: Verified
Owner:
Closed: Dec 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Feature

Blocked on:
issue 662081


Show other hotlists

Hotlists containing this issue:
Hotlist-1


Sign in to add a comment

DevTools: Improve Snippet workflow

Project Member Reported by einbinder@chromium.org, Oct 20 2016

Issue description

Today, the process of running snippets is tedious and hard to discover:

1. Switch to the Sources panel
2. Switch to the Snippets tab
3. Open your snippet
4. Run the snippet

Steps 1 and 2 can be bypassed if your snippet is already open, but this means crowding your Source panel with these's snippets tabs.

It should be possible to both discover and invoke from anywhere within DevTools without having to switch contexts to do so.

 

Comment 1 by chowse@chromium.org, Oct 20 2016

Goals (feel free to add any I've forgotten):

- Make snippets accessible and createable from the Command Menu (using a ! prefix).
- Provide a way to access the Command Menu, initialized to show snippets, from the Console.
- Preload DevTools with some useful/example snippets.
- Add a more visible means of creating snippets from the Navigator (vs. requiring a right-click)
- (opt) Make snippets directly accessible from the console (e.g. "My Helpful Snippet" can be invoked as "console.snippet.myHelpfulSnippet()")

Comment 2 Deleted

Project Member

Comment 3 by bugdroid1@chromium.org, Oct 20 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9f279cdef07d7a89a55a6a5d8c8eea225e4adbed

commit 9f279cdef07d7a89a55a6a5d8c8eea225e4adbed
Author: einbinder <einbinder@chromium.org>
Date: Thu Oct 20 23:24:16 2016

DevTools: New snippet button and icon

BUG= 657982 

Review-Url: https://chromiumcodereview.appspot.com/2442543002
Cr-Commit-Position: refs/heads/master@{#426644}

[modify] https://crrev.com/9f279cdef07d7a89a55a6a5d8c8eea225e4adbed/third_party/WebKit/LayoutTests/inspector/network/network-toggle-type-filter-expected.txt
[modify] https://crrev.com/9f279cdef07d7a89a55a6a5d8c8eea225e4adbed/third_party/WebKit/Source/devtools/BUILD.gn
[modify] https://crrev.com/9f279cdef07d7a89a55a6a5d8c8eea225e4adbed/third_party/WebKit/Source/devtools/front_end/Images/src/optimize_png.hashes
[modify] https://crrev.com/9f279cdef07d7a89a55a6a5d8c8eea225e4adbed/third_party/WebKit/Source/devtools/front_end/Images/src/svg2png.hashes
[modify] https://crrev.com/9f279cdef07d7a89a55a6a5d8c8eea225e4adbed/third_party/WebKit/Source/devtools/front_end/Images/src/toolbarButtonGlyphs.svg
[modify] https://crrev.com/9f279cdef07d7a89a55a6a5d8c8eea225e4adbed/third_party/WebKit/Source/devtools/front_end/Images/toolbarButtonGlyphs.png
[modify] https://crrev.com/9f279cdef07d7a89a55a6a5d8c8eea225e4adbed/third_party/WebKit/Source/devtools/front_end/Images/toolbarButtonGlyphs_2x.png
[modify] https://crrev.com/9f279cdef07d7a89a55a6a5d8c8eea225e4adbed/third_party/WebKit/Source/devtools/front_end/common/ResourceType.js
[modify] https://crrev.com/9f279cdef07d7a89a55a6a5d8c8eea225e4adbed/third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js
[modify] https://crrev.com/9f279cdef07d7a89a55a6a5d8c8eea225e4adbed/third_party/WebKit/Source/devtools/front_end/sources/NavigatorView.js
[modify] https://crrev.com/9f279cdef07d7a89a55a6a5d8c8eea225e4adbed/third_party/WebKit/Source/devtools/front_end/sources/SourcesNavigator.js
[modify] https://crrev.com/9f279cdef07d7a89a55a6a5d8c8eea225e4adbed/third_party/WebKit/Source/devtools/front_end/sources/module.json
[add] https://crrev.com/9f279cdef07d7a89a55a6a5d8c8eea225e4adbed/third_party/WebKit/Source/devtools/front_end/sources/navigatorTree.css
[modify] https://crrev.com/9f279cdef07d7a89a55a6a5d8c8eea225e4adbed/third_party/WebKit/Source/devtools/front_end/sources/navigatorView.css

Comment 4 by chowse@chromium.org, Oct 20 2016

Labels: -Type-Bug Type-Feature
Thanks for the suggestion, woxxom. I certainly agree that tabs on the narrow sidebar make Snippets more difficult to discover. However, the scope of this bug was to make snippets more accessible anywhere within DevTools, not just the Sources panel. The initial summary was a little too broad to capture this. I've updated it accordingly.

If you feel like filing a bug to address the Navigator sidebar's shortcomings, feel free to CC me on it. Improving these sidebars is something I hope we can address and more demand will help get it prioritized sooner.

Comment 5 by chowse@chromium.org, Oct 20 2016

Description: Show this description

Comment 6 Deleted

Blockedon: 662081

Comment 9 by l...@chromium.org, Nov 18 2016

Blockedon: 666783

Comment 10 by l...@chromium.org, Nov 18 2016

Blockedon: -666783
Cc: einbinder@chromium.org paulir...@chromium.org pfeldman@chromium.org
 Issue 666783  has been merged into this issue.

Comment 11 by l...@chromium.org, Nov 18 2016

Cc: -einbinder@chromium.org
Copied from the duplicate bug, as reported by user:
"
To reduce the number of steps needed to trigger a snippet, what if we introduced a "snippet:" syntax in the DevTools console. Typing the name of the snippet after snippet: would begin to autocomplete it based on filename. The developer can then hit enter to run the snippet without needing to leave the console at all.

e.g 

snippet: conso
snippet: console-image.js
         console-formatters.js
[hits enter -> runs]

Request from Twitter: https://twitter.com/darcy/status/799662234590937089
"
Status: Verified (was: Assigned)

Comment 13 by woxxom@gmail.com, Jun 19 2018

Now this issue is relevant again: the Snippets panel is almost completely undiscoverable.
That's because "File system" and "Overrides" panels were added recently.

Currently I have to make two additional clicks EVERY TIME I open devtools just to show the Snippets panel.
Of course I could widen the navigation pane on the left but it's a bad "solution" as I don't need it to be that wide in 99% of cases.

A possible solution would be adding the ability to customize the order of sub-panels.
For example, by dragging just like the devtools top panels.

A better solution would be to make Snippets much more easy to discover and access.
Maybe show the sub-panel titles vertically like other advanced IDE do - Visual Studio (not VSCode), for example.

Sign in to add a comment