Navigation Menu

Skip to content

Commit

Permalink
Bug 1609941 - Display eager evaluation result in editor mode. r=jlast.
Browse files Browse the repository at this point in the history
Differential Revision: https://phabricator.services.mozilla.com/D61568

--HG--
extra : moz-landing-system : lando
  • Loading branch information
nchevobbe committed Feb 7, 2020
1 parent 0a55602 commit 5b5d99f
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 4 deletions.
6 changes: 3 additions & 3 deletions devtools/client/themes/webconsole.css
Expand Up @@ -516,11 +516,11 @@ html #webconsole-notificationbox {
min-height: 25px;
}

.eager-evaluation-result .objectBox {
height: 18px;
/* Style the reps result */
.eager-evaluation-result :last-child {
overflow: hidden;
text-overflow: ellipsis;
white-space: pre;
white-space: pre !important;
}

.webconsole-app .cm-auto-complete-shadow-text::after {
Expand Down
26 changes: 26 additions & 0 deletions devtools/client/webconsole/components/App.css
Expand Up @@ -235,6 +235,8 @@ body {
* | ↔ ↔ |
* | ↔ ↔ |
* +--------------------------↔ ↔ |
* | [Eager evaluation] ↔ ↔ |
* +--------------------------↔ ↔ |
* | [Reverse search input] ↔ ↔ |
* +-----------------------------------------------------+-----------------+
*
Expand All @@ -247,12 +249,14 @@ body {
"editor-toolbar filter-toolbar sidebar"
"editor filter-toolbar-secondary sidebar"
"editor output sidebar"
"eager-evaluation output sidebar"
"reverse-search output sidebar";
grid-template-rows:
auto
var(--primary-toolbar-height)
auto
1fr
auto
auto;
grid-template-columns: minmax(150px, auto) minmax(200px, 1fr) minmax(0, auto);
}
Expand Down Expand Up @@ -372,6 +376,28 @@ body {
background-image: none;
}

.jsterm-editor .eager-evaluation-result {
grid-area: eager-evaluation;
/* The next 2 lines make it so the element isn't impacting the grid column size, but
will still take the whole available space. */
min-width: 100%;
width: 0;
border-inline-end: 1px solid var(--theme-splitter-color);
border-block-start: 1px solid var(--theme-splitter-color);
padding-inline-start: 2px;
align-items: center;
padding-bottom: 0;
}

.jsterm-editor .eager-evaluation-result:empty {
display: none;
}

.jsterm-editor .eager-evaluation-result > .icon {
margin-block: 0;
align-self: unset;
}

.jsterm-editor .editor-resizer {
grid-column: editor;
/* We want the splitter to cover the whole column (minus self-xss message) */
Expand Down
2 changes: 1 addition & 1 deletion devtools/client/webconsole/components/App.js
Expand Up @@ -337,7 +337,7 @@ class App extends Component {
}

renderEagerEvaluation() {
if (!this.props.eagerEvaluationEnabled || this.props.editorMode) {
if (!this.props.eagerEvaluationEnabled) {
return null;
}

Expand Down
Expand Up @@ -99,6 +99,17 @@ add_task(async function() {

setInputValue(hud, "'> ' + $_");
await waitForEagerEvaluationResult(hud, `"> result: 7"`);

info("Switch to editor mode");
await toggleLayout(hud);
await waitForEagerEvaluationResult(hud, `"> result: 7"`);
ok(true, "eager evaluation is still displayed in editor mode");

setInputValue(hud, "4 + 7");
await waitForEagerEvaluationResult(hud, "11");

// go back to inline layout.
await toggleLayout(hud);
});

// Test that the currently selected autocomplete result is eagerly evaluated.
Expand Down

0 comments on commit 5b5d99f

Please sign in to comment.