Commit Graph
52 Commits
Author SHA1 Message Date
Brian Hackett 46d73b286c Bug 1602489 - Basic eager evaluation support, r=nchevobbe.
Differential Revision: https://phabricator.services.mozilla.com/D56393
2019-12-12 21:48:03 +00:00
Nicolas Chevobbe 7228ed20c6 Bug 1599805 - Fix React props in JSTerm. r=Honza.
Differential Revision: https://phabricator.services.mozilla.com/D55240
2019-11-29 09:59:41 +00:00
Nicolas Chevobbe dbd07ba72f Bug 1597197 - Add a feature-callout badge on the open editor icon. r=Honza.
Differential Revision: https://phabricator.services.mozilla.com/D53394
2019-11-22 13:11:28 +00:00
Dorel Luca 4c4d3df450 Backed out changeset d5baee70482a (bug 1597197) for DevTools failures in test/browser/browser_jsterm_no_input_and_tab_key_pressed.js. CLOSED TREE 2019-11-19 14:59:36 +02:00
Nicolas Chevobbe a1b618312d Bug 1597197 - Add a feature-callout badge on the open editor icon. r=Honza.
Differential Revision: https://phabricator.services.mozilla.com/D53394
2019-11-19 09:27:58 +00:00
Nicolas Chevobbe 810016905d Bug 1595068 - Fix issue with debounced autocompletion in JsTerm. r=Honza,julienw.
The issue was that if a user typed a legitimate letter,
then, quickly after (i.e. before the autocompletion results
are here) hit Enter or Tab, the resulting input value would
be erroneous.
This is because we retrieve the value to insert from the
autocomplete popup, which at that time, is out-of-date, for
this brief moment.
The fix consists in updating the preLabel property of the
autocomplete popup items in order to get the proper
completion if the user ever hit enter, tab or arrow right.
We also take this as an opportunity to have a mechanism
to be able to cancel a registered update.

Differential Revision: https://phabricator.services.mozilla.com/D52376
2019-11-13 16:19:18 +00:00
Nicolas Chevobbe 26e426cf26 Bug 1592550 - Allow saveAs util function to be passed an array of filters. r=Honza.
A new parameter is added, and it expect an array
of filter objects (which contain a pattern and
a label properties), which are going to be used
by the save file dialog.

Depends on D51070

Differential Revision: https://phabricator.services.mozilla.com/D51078
2019-11-01 09:26:18 +00:00
Nicolas Chevobbe 9d78560f27 Bug 1592308 - Add keyboard shortcut for loading / saving from console input. r=Honza.
Ctrl+O (Cmd+O on OSX) will load file content into the console input.
Ctrl+S (Cmd+S on OSX) will show the file dialog for the user
to save the console input content into a file.

A test is added to ensure this works as expected.

Differential Revision: https://phabricator.services.mozilla.com/D51070
2019-10-30 10:26:49 +00:00
Itiel f6e0472863 Bug 1590212 - More RTL fixes to the console editor r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D49986
2019-10-29 12:40:13 +00:00
Narcis Beleuzu d77346d4db Backed out changeset 3534c1bfbd8e (bug 1590212) as per Itiel`s request. CLOSED TREE 2019-10-29 14:11:43 +02:00
Itiel f7f1e63e87 Bug 1590212 - More RTL fixes to the console editor r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D49986
2019-10-29 07:59:04 +00:00
Nicolas Chevobbe 8c9f69ba14 Bug 1576568 - Enable editor mode everywhere. r=Honza.
The focus previous element function needed to be modified
in order to not find non-visible elements.

Differential Revision: https://phabricator.services.mozilla.com/D49729
2019-10-21 08:39:42 +00:00
Nicolas Chevobbe 34038617bf Bug 1589592 - Fix Console Editor styling in RTL languages. r=Honza.
Differential Revision: https://phabricator.services.mozilla.com/D49717
2019-10-18 12:46:58 +00:00
Armando Ferreira 2df3915410 Bug 1567372 - Add a reverse search button to the Editor Toolbar. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D45095
2019-09-17 21:58:17 +00:00
Nicolas Chevobbe 772c8014f3 Bug 1579366 - Update completion text when autocomplete is disabled and popup isn't opened. r=Honza.
If the user triggered a force autocomplete (with Ctrl + Space)
that would result in having only the completion text, writing another
letter wouldn't update the completion text, that could then lead
into having an erroneous expression in the input.
This patch fixes this issue and add a test case to make sure we
don't regress this.

Differential Revision: https://phabricator.services.mozilla.com/D44976
2019-09-06 13:35:55 +00:00
Nicolas Chevobbe bdbccc5e0c Bug 1578283 - Don't scroll jsterm viewport when inserting a tab character. r=Honza.
When we wanted to insert a string in the webconsole input,
we were setting the input value, and setting the cursor
manually. But since the editor setCursor function is calling
alignLine, there could be cases where the editor scroll position
would jump, feeling awkward for the user.
It turns out we can simplify this code a lot since codeMirror
provides a replaceRange function, which is a perfect replacement
for what we were using, without having to manage the cursor position.

The only downside to that is that inserting characters this
way *does* fire a `changes` event, that we are listening to
in the JsTerm to request autocompletion (which we don't need
as we only insert characters when accepting a completion or
adding a tab).
To mitigate that, we pass a specific jsterm origin string to
replaceRange, which let's us discriminate in the changes event
listener if those changes originate from jsterm only actions.

A test is added to ensure this works as expected (the test was
failing without the fix).

Differential Revision: https://phabricator.services.mozilla.com/D44466
2019-09-04 09:02:09 +00:00
Nicolas Chevobbe f0ef51ac2a Bug 1558417 - Add onboarding UI for Editor. r=Honza.
The onboarding UI is displayed on top of the Editor.
A dismiss button hides it forever (this is handled via
a pref that is set to false when clicking the button).

We take this as an opportunity to polish the Editor UI/wording
a bit.

Differential Revision: https://phabricator.services.mozilla.com/D43621
2019-08-28 15:42:36 +00:00
Gurzau Raul 3e14510bdc Backed out changeset 9aa911cc3fcf (bug 1558417) for failing at browser_jsterm_editor_toolbar.js on a CLOSED TREE. 2019-08-28 17:12:00 +03:00
Nicolas Chevobbe d34a3453e6 Bug 1558417 - Add onboarding UI for Editor. r=Honza.
The onboarding UI is displayed on top of the Editor.
A dismiss button hides it forever (this is handled via
a pref that is set to false when clicking the button).

We take this as an opportunity to polish the Editor UI/wording
a bit.

Differential Revision: https://phabricator.services.mozilla.com/D43621
2019-08-28 11:47:49 +00:00
Nicolas Chevobbe 497a619e4d Bug 1576563 - Evaluate selected text if a selection exists in console input. r=Honza.
This is something Scratchpad allowed and that people
told me they were relying on. With Scratchpad being
deprecated, it makes sense to implement it in the
WebConsole as it's quite easy to do so.
A test is added to ensure this works as expected.

Differential Revision: https://phabricator.services.mozilla.com/D43394
2019-08-26 14:28:38 +00:00
Nicolas Chevobbe ba939ca6ed Bug 1465149 - Remove old jsterm code. r=jdescottes.
Since we modified the Editor to be accessible, we got
the green light to remove the old JsTerm code.
This means we can remove the preference for the codeMirror
input, and clean the WebConsole react app a bit.
This also mean we can avoid running a lot of our tests
twice.
Finally, some test helpers had to take argument with
specific shape to work against old jsterm (e.g. checkInputCompletionValue),
that we can now remove to make tests easier to read.

Differential Revision: https://phabricator.services.mozilla.com/D40172
2019-08-04 09:38:25 +00:00
Nicolas Chevobbe ea8be2c775 Bug 1554857 - Add editor mode button in input. r=ladybenko.
The button is then hidden when in editor mode.
A test is added to ensure the button is displayed
when it's expected, and that clicking on it does
open the editor.

Differential Revision: https://phabricator.services.mozilla.com/D39203
2019-08-03 08:30:16 +00:00
Nicolas Chevobbe 80d2f1cc80 Bug 1568143 - Don't use JsTerm reference to evaluate code. r=jdescottes.
JSTerm `execute` function is renamed to `_execute` to emphasize
that it's a private function.
A `dispatchEvaluateExpression` is added to the WebConsoleWrapper
so other panels can use that if they need to.
A test helper is added to be able to evaluate without grabbing
the jsterm reference, and tests are modified to use the new
helper, or the existing `executeAndWaitForMessage`.

Differential Revision: https://phabricator.services.mozilla.com/D39024
2019-08-02 11:50:28 +00:00
Nicolas Chevobbe 25a1093676 Bug 1567174 - Move expression evaluation to a proper Redux action. r=jdescottes.
The goal is to not directly use the panel.hud.ui.proxy reference
directly from the JsTerm, so we're in better shape when Fission
comes.
It's also a nice refactor to make the JSTerm component more
React-like.
As a nice benefit, we can handle telemetry and history persistence
from their middleware.
As the `requestEvaluation` method is removed from the JSTerm, some
callsites needed to be updated to still work.

Differential Revision: https://phabricator.services.mozilla.com/D39022
2019-08-02 11:49:21 +00:00
Ciure Andrei 74372a9da1 Backed out 2 changesets (bug 1568143, bug 1567174) for causing browser_ext_addon_debugging_netmonitor.js to perma fail CLOSED TREE
Backed out changeset a8faaa1c722e (bug 1568143)
Backed out changeset 5dddaeb1e952 (bug 1567174)
2019-08-02 00:50:34 +03:00
Nicolas Chevobbe a81a1e8f40 Bug 1568143 - Don't use JsTerm reference to evaluate code. r=jdescottes.
JSTerm `execute` function is renamed to `_execute` to emphasize
that it's a private function.
A `dispatchEvaluateExpression` is added to the WebConsoleWrapper
so other panels can use that if they need to.
A test helper is added to be able to evaluate without grabbing
the jsterm reference, and tests are modified to use the new
helper, or the existing `executeAndWaitForMessage`.

Differential Revision: https://phabricator.services.mozilla.com/D39024
2019-08-01 06:52:25 +00:00
Nicolas Chevobbe c2ebae7e8a Bug 1567174 - Move expression evaluation to a proper Redux action. r=jdescottes.
The goal is to not directly use the panel.hud.ui.proxy reference
directly from the JsTerm, so we're in better shape when Fission
comes.
It's also a nice refactor to make the JSTerm component more
React-like.
As a nice benefit, we can handle telemetry and history persistence
from their middleware.
As the `requestEvaluation` method is removed from the JSTerm, some
callsites needed to be updated to still work.

Differential Revision: https://phabricator.services.mozilla.com/D39022
2019-08-01 06:47:41 +00:00
Arun Kumar Mohan d9a6da5ba8 Bug 1554901 - Refactor onInputKeyDown method to remove disabled complexity eslint rule. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D39488
2019-07-27 14:59:36 +00:00
Armando Ferreira 2b4b284157 Bug 1558201 - Disable history navigation with Arrow keys in Editor mode. r=nchevobbe
In editor mode, there are dedicated icons to history navigation  (See Bug [[ https://bugzilla.mozilla.org/show_bug.cgi?id=1558198 | 1558198 ]]).
Removing the arrow up/down history navigation which is troublesome when working with multi-line snippets.

Differential Revision: https://phabricator.services.mozilla.com/D39262
2019-07-26 18:23:59 +00:00
Nicolas Chevobbe 81db9f8b46 Bug 1569190 - Remove JSTerm outputNode getter. r=jdescottes.
The reference isn't used within the component itself,
and is available in the webConsoleUI.
Callsites are updated.

Differential Revision: https://phabricator.services.mozilla.com/D39505
2019-07-26 16:39:08 +00:00
Nicolas Chevobbe 064fc18bff Bug 1569187 - Move blur event listeners outside of JSTerm. r=jdescottes.
Differential Revision: https://phabricator.services.mozilla.com/D39510
2019-07-26 15:50:07 +00:00
Nicolas Chevobbe 54543aef96 Bug 1553180 - Move outputNode clear from JsTerm to webconsoleUI. r=jdescottes.
There's no reason it should be JsTerm's responsability
to clear the output node.

Differential Revision: https://phabricator.services.mozilla.com/D39508
2019-07-26 15:49:53 +00:00
Nicolas Chevobbe d34a531e46 Bug 1568439 - Move webconsole-l10n to utils/l10n. r=jdescottes.
Differential Revision: https://phabricator.services.mozilla.com/D39159
2019-07-24 11:11:34 +00:00
Alexandre Poirot 3f55d2085a Bug 1568203 - Removed unused requestEvaluation's frame argument. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D39052
2019-07-24 08:35:48 +00:00
Alexandre Poirot 633271ffe8 Bug 1568185 - Remove unused bindObjectActor argument from console actor. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D39051
2019-07-24 08:35:41 +00:00
Bogdan Tara 3423c8474d Backed out 2 changesets (bug 1568203, bug 1568185) for ES lint failure on eval-with-debugger.js CLOSED TREE
Backed out changeset adc394f833f9 (bug 1568203)
Backed out changeset 46c3a1fdc706 (bug 1568185)
2019-07-24 11:24:51 +03:00
Alexandre Poirot f345168351 Bug 1568203 - Removed unused requestEvaluation's frame argument. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D39052
2019-07-24 07:48:01 +00:00
Alexandre Poirot b46a73620c Bug 1568185 - Remove unused bindObjectActor argument from console actor. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D39051
2019-07-24 07:47:55 +00:00
Armando Ferreira b06f32a5f3 Bug 1558198 - Add history navigation buttons in Editor toolbar. r=nchevobbe
Adding History navigation to Editor toolbar

Differential Revision: https://phabricator.services.mozilla.com/D38951
2019-07-23 18:36:01 +00:00
Nicolas Chevobbe c489070ddb Bug 1567370 - Add a close button to the Editor Toolbar. r=Honza.
The button display the same icon that will be used
in the console input when in inline-mode to toggle
the editor mode, active.
A test is added to ensure the button works as expected.

Differential Revision: https://phabricator.services.mozilla.com/D38622
2019-07-19 14:10:06 +00:00
Nicolas Chevobbe 99d1b11f63 Bug 1567167 - Remove webConsoleClient getter from JSTerm. r=jdescottes.
Differential Revision: https://phabricator.services.mozilla.com/D38615
2019-07-19 08:29:54 +00:00
Nicolas Chevobbe f2889e192d Bug 1567167 - Remove clearNetworkRequests from JsTerm destroy function. r=jdescottes.
This shouldn't be JSTerm's responsability to call
this function. Furthermore, the function clear
some references in the WebConsoleFront, which are
going to be destroyed anyway.

Differential Revision: https://phabricator.services.mozilla.com/D38614
2019-07-19 08:28:48 +00:00
Nicolas Chevobbe 319b6d8fbf Bug 1567167 - Remove copyObject function from JSTerm. r=jdescottes.
The function is only called from the context-menu,
where we already have all the references we need.
So we can move the function code directly in the
menu item callback.

Differential Revision: https://phabricator.services.mozilla.com/D38613
2019-07-19 08:28:24 +00:00
Nicolas Chevobbe bec1f2e8d5 Bug 1567167 - Remove unused gSequenceId function in JSTerm . r=jdescottes.
Differential Revision: https://phabricator.services.mozilla.com/D38612
2019-07-19 08:27:59 +00:00
Nicolas Chevobbe db0b64398f Bug 1554877 - Make JsTerm editor resizable. r=Honza.
We add a GridElementWidthResizer to handle the editor width.
The width is then persisted in a pref.
A test is added to ensure this works as expected.

Differential Revision: https://phabricator.services.mozilla.com/D37687
2019-07-18 05:51:44 +00:00
Nicolas Chevobbe d2bf50f8de Bug 1534706 - Don't focus ConfirmDialog when displaying it. r=Honza
Some people found that the ConfirmDialog was getting into their
way when typing into the console, as it was stealing the focus.
This patch fixes this by not focusing the ConfirmDialog when
we show it, so the user can still type.
This means that we now handle the dialog confirm and dismiss from
JSTerm, when the former is displayed.

Since it wasn't clear how you could close the popup, we add a close
button that makes it very obvious.

This means we can drop the key handler in the dialog as the jsterm
is always focused.
We also simply remove the feature to open the MDN link on `?` key
stroke as it's not discoverable and was the only part of the
panel where you could do such thing.

Existing tests are adapted and extended to cover the new behaviour.

Differential Revision: https://phabricator.services.mozilla.com/D36174
2019-07-09 12:28:38 +00:00
Nicolas Chevobbe a597824b4b Bug 1558248 - Don't clear the completion text when it starts with the typed letters. r=fvsch.
We were clearing the completion text all the time to prevent
a visual glitch while typing (See Bug 1491776). But since we
are now waiting for 75ms before calling the autocomplete
function (which triggers the autocompletion text update), we
have a flash of the completion text, which isn't ideal.
In this patch, we check if the typed letters match the begining
of the completion text, and if they do, we don't clear the
completion text.
In the same time, we set the completion text in absolute position
so it doesn't jump when the new letter is added in the CodeMirror
document.
Finally, we change how the Editor pipe events from CodeMirror to
include parameters, so we can use them in JsTerm.

Differential Revision: https://phabricator.services.mozilla.com/D36163
2019-07-07 10:38:08 +00:00
Victor Porof b7732ae890 Bug 1561435 - Format devtools/client/, a=automatic-formatting
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D35884
2019-07-05 11:24:38 +02:00
Bryan Kok 1e624665a3 Bug 1519315 - Display CodeMirror's gutter in console input when devtools.webconsole.input.editor is true. r=Honza.
Differential Revision: https://phabricator.services.mozilla.com/D33995
2019-06-28 16:27:55 +00:00
Nicolas Chevobbe fd515fe424 Bug 1519312 - Render the console input to the left of the panel when editor preference is true; r=Honza.
When the editor preference is true, a CSS class is added to
the panel that allow us to shift the layout to a CSS Grid, where
the input panel is on the left and the output on the right.

A toolbar is added to be able to execute an expression when in
editor mode.

Differential Revision: https://phabricator.services.mozilla.com/D17096
2019-06-27 13:13:32 +00:00