Commit Graph
251 Commits
Author SHA1 Message Date
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
Armando Ferreira 67ff266803 Bug 1540722 - Copy link location should work for learn-more links. r=nchevobbe
Support for coping link location from within the Console panel (through the context menu) can be extended and cover learn more links too.

Differential Revision: https://phabricator.services.mozilla.com/D38546
2019-07-23 18:34:08 +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 39eeb06393 Bug 1565781 - Fix ConsoleTable with nested holey array. r=Honza.
A test is added to ensure this is fixed properly.
We also fix the Array previewer to properly return
undefined for unknown array properties, rather than null.

Differential Revision: https://phabricator.services.mozilla.com/D38467
2019-07-18 12:04:42 +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 68aacc044c Bug 1565963 - Add props to NotificationBox to render top and bottom borders. r=Honza.
We need this in the console to put the borders on the
right position, depending on the NotificationBox place.

Differential Revision: https://phabricator.services.mozilla.com/D38039
2019-07-18 05:51:24 +00:00
Nicolas Chevobbe a1ef07d3e3 Bug 1565962 - Refactor webconsole layout. r=Honza.
Since we now have a GridElementWidthResizer element, we can
get rid of the SplitBox wrapping the SideBar, and have all
major elements as child of the App element, controlled by
a CSS Grid.

This makes it easy to change the console layout when toggling
the editor mode (re-ordering element in JS, changing the CSS
grid templates, and placing the element in different areas).
This also means we can take advantage of subgrid to align
the sidebar toolbar with the filter bar for example.

As the part of the stylesheet dedicated to layout grew, it
made sense to have it all in a separate stylesheet, App.css,
that lives next to the App component.

Differential Revision: https://phabricator.services.mozilla.com/D38038
2019-07-18 09:02:46 +00:00
Nicolas Chevobbe 5b16c0c2f8 Bug 1567067 - Fix PropTypes error in Message.js .r=Honza.
Differential Revision: https://phabricator.services.mozilla.com/D38454
2019-07-18 08:55:36 +00:00
Armando Ferreira 00945f5389 Bug 1546347 - Message location on CSS Warnings has an erroneous title attribute. r=nchevobbe
Adding a new opcional property to Frame.js, messageSource, which will allows us to know the source of the Message. We will be using this property to display the correct tooltip message.

Differential Revision: https://phabricator.services.mozilla.com/D38139
2019-07-18 06:17:16 +00:00
Armando Ferreira 285b1a4450 Bug 1524115 - When clicking and selecting source text on a collapsible message, the message expansion is toggled after releasing the mouse. r=nchevobbe
When clicking and selecting source text on a collapsible message, the message expansion is toggled after releasing the mouse

Differential Revision: https://phabricator.services.mozilla.com/D37607
2019-07-17 15:48:56 +00:00
Nicolas Chevobbe 9d703719af Bug 1564138 - Fix DevTools PropTypes errors when updating eslint. r=Ola.
Differential Revision: https://phabricator.services.mozilla.com/D38093
2019-07-17 10:35:44 +00:00
Nicolas Chevobbe 6fca865e74 Bug 1564363 - Close the network detail on Escape. r=Honza.
We use the openNetworkDetails prop which is already in use
in the netmonitor to collapse the message if the parameter
passed to the function is falsy (i.e. the panel is already
displayed)

Depends on D37388

Differential Revision: https://phabricator.services.mozilla.com/D37389
2019-07-09 10:50:50 +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 567783311c Bug 1563914 - Fix ConsoleTable with invalid headers. r=Honza.
Differential Revision: https://phabricator.services.mozilla.com/D37164
2019-07-09 08:47:58 +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
Nicolas Chevobbe 17ca16f4eb Bug 1562914 - Fix PropTypes error in FilterBar in split console. r=Honza.
Differential Revision: https://phabricator.services.mozilla.com/D36618
2019-07-03 11:15:28 +00:00
Nicolas Chevobbe 3bae049ef3 Bug 1562839 - Put editor mode behind a pref. r=Honza.
Differential Revision: https://phabricator.services.mozilla.com/D36582
2019-07-03 11:14:22 +00: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 0582dd5cf9 Bug 1519105 - Add a keyboard shortcut to switch between inline and editor mode. r=Honza.
We use Cmd/Ctrl + B to switch between inline and editor mode. This
should be familiar for VSCode users as it toggles the file sidebar.
When changing the layout, we persist the choice into the editor pref
so the user keeps the same layout the next time they open the console.

Differential Revision: https://phabricator.services.mozilla.com/D34718
2019-06-28 09:25:59 +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
tanhengyeow 49725b775c Bug 1561676 - WebSocket panel crashes in WebConsole. r=nchevobbe,Honza
Hide WebSocketsPanel in console.

Differential Revision: https://phabricator.services.mozilla.com/D36158
2019-06-27 11:54:37 +00:00
Nicolas Chevobbe 0c025c858a Bug 1560320 - Dismiss autocomplete on Ctrl+A on OSX. r=Honza.
Ctrl + A moves the cursor to the beginning of the line,
so we need to dismiss autocomplete.
A test case is added to make sure this behaves as
expected.

Differential Revision: https://phabricator.services.mozilla.com/D35573
2019-06-27 11:48:34 +00:00
Nicolas Chevobbe 476067b92d Bug 1559329 - Set "group similar messages" to true by default. r=Honza.
This was making browser_webconsole_scroll.js fail.
After some investigation, I found that the `isInWarningGroup`
prop, a function defined in `mapStateToProp` was causing a
re-rendering (because we were creating a new function each
time), impacting the shouldScrollToBottom behaviour.

To fix this, we no longer create a `isInWarningGroup` prop,
but directly use the `isMessageInWarningGroup` selector, which
was modified to take an array of visible messages instead of
the whole state.

Differential Revision: https://phabricator.services.mozilla.com/D35016
2019-06-27 11:42:15 +00:00
Armando Ferreira a3c043f6be Bug 1522104 - Re-organise devtools/client/webconsole/components/ folder. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D35932
2019-06-26 09:19:54 +00:00
Dickson Tan f743c4ae4c Bug 1544773 - fix clicking on disclosures in the console redirecting focus to input. r=nchevobbe
The top-level App component forcefully resets focus to the console input when something in the output gains focus, e.g disclosure toggles, and the clear output button.While this is useful for mouse users when typing, it breaks reading flow for screen reader users when reviewing output, being sent back to input when interacting with disclosures.

This commit prevents the unwanted focus behaviour when clicking by suppressing it in an onMouseDown, and prevents the click event from bubbling to the App component so focus doesn't get reset.

Differential Revision: https://phabricator.services.mozilla.com/D28178
2019-06-18 19:17:58 +00:00
Nicolas Chevobbe 155017dd19 Bug 1557632 - Don't check if input is compilable unit on Ctrl+Enter. r=Honza.
In the regular webconsole input, on Enter, we check that the
input is a compilable unit, so the user don't accidentally
execute an incomplete snippet.
In the editor mode, the user will have to use Ctrl/Cmd + Enter to
execute, so we don't have to worry about Enter (it will simply
append a new line).
And since the user might deal with a large number of characters,
we don't want to prevent them to execute. If it's malformed, they
will get an error in the output and can fix their input easily, since
it wasn't cleared.

The patch adds a test to ensure this work as expected.

Differential Revision: https://phabricator.services.mozilla.com/D34522
2019-06-13 12:35:04 +00:00
Nicolas Chevobbe 7094ec01cc Bug 1557324 - Fix JSTerm keyboard navigation in old input. r=Honza.
Hitting Ctrl+ArrowRight didn't have any effect on windows/linux.
The patch fixes this and add a test to make sure a user can
navigate from word to word using Ctrl (or Alt on OSX) and
Arrow Left/Right keys.

Differential Revision: https://phabricator.services.mozilla.com/D34312
2019-06-11 08:26:22 +00:00
Nicolas Chevobbe dd108251bd Bug 1551612 - Add componentDidCatch in Message component. r=bgrins.
This patch adds a componentDidCatch handler to the Message component
so we don't crash the whole console when a message can't be rendered.
When a message causes a crash, we display an error message instead,
asking the user to file a bug. A button allow to copy the message data
so it can be attached in the bug report.

Differential Revision: https://phabricator.services.mozilla.com/D31195
2019-06-10 06:22:05 +00:00
phoenixabhishek 2521a0787a Bug 1525039 - Redesign toggleable buttons. r=ladybenko
The toggle buttons have been redesigned as per the shared mockup

Differential Revision: https://phabricator.services.mozilla.com/D22553
2019-06-10 06:10:25 +00:00
Mihai Alexandru Michis f50f46d058 Backed out changeset e2af0f70828c (bug 1551612) for causing bc failures in webconsole.properties CLOSED TREE 2019-06-07 19:03:05 +03:00
Nicolas Chevobbe b9a7800b67 Bug 1523864 - Move filter bar layout change to the App level. r=Honza.
This makes the console code more consistent, and adds the
nice benefit of being able to check if the layout should
be modified when performing non-window-resize events that
might still impact the layout (sidebar toggle, sidebar
resizing, ...).

Differential Revision: https://phabricator.services.mozilla.com/D27668
2019-06-07 14:23:35 +00:00
Kelly fef125755b Bug 1523864 Display filter buttons next to filter input if there is enough space. r=Honza
Set a minimum width on the filter bar of the Devtools Console window. When there is enough empty space
to the right of the filterbar, allow the filter buttons to be desplaying inline, rather than on their own
separate row.

Differential Revision: https://phabricator.services.mozilla.com/D20188
2019-06-07 14:23:16 +00:00
Nicolas Chevobbe 3dea1a4a97 Bug 1551612 - Add componentDidCatch in Message component. r=bgrins.
This patch adds a componentDidCatch handler to the Message component
so we don't crash the whole console when a message can't be rendered.
When a message causes a crash, we display an error message instead,
asking the user to file a bug. A button allow to copy the message data
so it can be attached in the bug report.

Differential Revision: https://phabricator.services.mozilla.com/D31195
2019-06-07 13:03:48 +00:00
Razvan Caliman 56ecf30a5f Bug 1548833 - Replace message table data with generalized message payload. r=nchevobbe
Follow-up to [Bug 1093953](https://bugzilla.mozilla.org/show_bug.cgi?id=1093953) which introduced a generalized `payload` object for messages to be populated asynchronously with additional  data associated with the message after it is initially received.

The reasoning is: messages can have arbitrary data payload associated with them. The rendering component for the message type will consume and validate that payload data.

Here, we replace the specialized messageTableDataByID with the generalized messagePayloadByID, update corresponding Redux actions, reducers, selectors and tests.

The only place where `tableData` is used is in the `ConsoleApiCall` message type, in the `ConsoleTable` component. We replace it with `payload` which is sent down to all message types anyway.

Differential Revision: https://phabricator.services.mozilla.com/D33975
2019-06-06 15:25:20 +00:00