Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

Commit c473181

Browse files
committed
fix(plugins/plugin-client-common): minor spacing improvements for Commentary and Notebooks
Fixes #5503
1 parent 4b64133 commit c473181

File tree

8 files changed

+63
-25
lines changed

8 files changed

+63
-25
lines changed

plugins/plugin-client-common/src/components/Content/Scalar/index.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,7 @@ export default class Scalar extends React.PureComponent<Props, State> {
8787
return <pre>{response}</pre>
8888
} else if (typeof response === 'string') {
8989
// Markdown interpretes escapes, so we need to double-escape
90-
return (
91-
<pre>
92-
<Markdown tab={tab} repl={tab.REPL} source={response.replace(/\\/g, '\\\\')} />
93-
</pre>
94-
)
90+
return <Markdown tab={tab} repl={tab.REPL} source={response.replace(/\\/g, '\\\\')} />
9591
} else if (isCommentaryResponse(response)) {
9692
return <Commentary {...response.props} />
9793
} else if (isRadioTable(response)) {

plugins/plugin-client-common/src/components/Views/Terminal/Block/Output.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,8 @@ export default class Output extends React.PureComponent<Props, State> {
240240
}
241241
}
242242

243-
private ctx(insideBrackets: React.ReactNode = this.props.displayedIdx || this.props.idx + 1) {
244-
return <span className="repl-context">Out[{insideBrackets}]</span>
243+
private ctx(/* insideBrackets: React.ReactNode = this.props.displayedIdx || this.props.idx + 1 */) {
244+
// return <span className="repl-context">Out[{insideBrackets}]</span>
245245
}
246246

247247
public render() {

plugins/plugin-client-common/web/css/static/repl.scss

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,6 @@
166166
margin: 2px 0; /* firefox needs some vertical padding, otherwise descenders like "y" crop; weird */
167167
white-space: pre-wrap;
168168
}
169-
.repl-result code {
170-
/* more invocation results */
171-
/* here, we override the highlight.js theme, when rendering in the repl */
172-
background: transparent;
173-
color: var(--color-text-01);
174-
}
175169

176170
/* e.g. reverse-i-search; see Input.tsx */
177171
.repl-input-element.repl-input-hidden {

plugins/plugin-client-common/web/css/static/ui.css

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -793,13 +793,16 @@ body.oops-total-catastrophe #restart-needed-warning {
793793
}
794794
.page-content p > code,
795795
.page-content li > code {
796-
color: var(--color-base0F);
797796
opacity: 0.875;
798797
word-break: break-all;
799798
}
799+
.kui--sidecar .page-content p > code,
800+
.clickable:not(:hover) .page-content p > code {
801+
color: var(--color-base0F);
802+
}
800803
$kui--page-content-h4-padding: 0.5rem;
801804
$kui--page-content-paragraph-padding: 0.375rem;
802-
.page-content p {
805+
.page-content p:not(:only-child) {
803806
padding: $kui--page-content-paragraph-padding 0;
804807
}
805808
.page-content h1 {

plugins/plugin-client-common/web/scss/components/Table/tables.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ body .bx--data-table-container {
4747
line-height: inherit;
4848
font-weight: inherit;
4949
}
50+
.clickable:not(:hover) p code {
51+
color: var(--color-text-02);
52+
}
5053

5154
/* td [data-key='NAME'],
5255
td .kui--table-cell-is-name {

plugins/plugin-client-common/web/scss/components/Terminal/Block.scss

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
@import '_mixins';
1818
@import '../Sidecar/_mixins';
1919

20+
/** Inset of the <input> element w.r.t. the bordered/backgrounded region */
21+
$inset: 0.375rem;
22+
2023
.repl-input,
2124
.repl-output {
2225
padding-right: calc(1rem - 6px);
@@ -69,7 +72,7 @@
6972
}
7073

7174
.repl-output {
72-
margin-top: 0.25rem;
75+
margin-top: $inset;
7376
}
7477
.repl-input,
7578
.repl-output {
@@ -84,7 +87,6 @@
8487
display: flex;
8588
justify-content: flex-end;
8689
flex-basis: 3rem;
87-
max-width: 3rem; /* Out[1] overflows, but it is currently hidden */
8890
text-align: end;
8991
margin-right: 0.5rem;
9092
position: relative;
@@ -99,11 +101,11 @@
99101
.repl-input {
100102
.repl-context,
101103
.repl-prompt-right-elements {
102-
padding-top: 0.25rem;
104+
padding-top: $inset;
103105
}
104106
}
105107
.repl-input-element-wrapper {
106-
padding: 0.25rem 0 0.25rem 0.5rem;
108+
padding: $inset 0 $inset 0.5rem;
107109
border: 1px solid transparent;
108110
align-items: stretch;
109111
}

plugins/plugin-client-common/web/scss/components/Terminal/Commentary.scss

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,32 @@
1818
@import '../Sidecar/_mixins';
1919
@import '../common/_narrow-window';
2020

21-
@mixin MajorHeaders {
22-
h1,
23-
h2 {
21+
@mixin Card {
22+
.kui--commentary-card {
2423
@content;
2524
}
2625
}
2726

27+
@mixin MajorHeaders {
28+
@include Card {
29+
h1,
30+
h2 {
31+
@content;
32+
}
33+
}
34+
}
35+
2836
@mixin Paragraphs {
29-
p {
30-
@content;
37+
@include Card {
38+
p {
39+
@content;
40+
}
3141
}
3242
}
3343

3444
@mixin FullWidth {
3545
@include Scrollback {
36-
.kui--commentary-card {
46+
@include Card {
3747
flex: 1;
3848
}
3949
}
@@ -48,6 +58,14 @@
4858
border-bottom: 1px solid var(--color-table-border2);
4959
}
5060

61+
@include Block {
62+
&:not(:first-child) {
63+
@include MajorHeaders {
64+
margin-top: 0.5rem;
65+
}
66+
}
67+
}
68+
5169
@include Paragraphs {
5270
font-size: 1rem;
5371
}

plugins/plugin-client-common/web/scss/components/Terminal/_mixins.scss

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,25 @@
3535
}
3636
}
3737
}
38+
39+
@mixin Block {
40+
.repl-block {
41+
@content;
42+
}
43+
}
44+
45+
@mixin ActiveBlock {
46+
@include Block {
47+
&.repl-active {
48+
@content;
49+
}
50+
}
51+
}
52+
53+
@mixin FinishedBlock {
54+
@include Block {
55+
&:not(.repl-active) {
56+
@content;
57+
}
58+
}
59+
}

0 commit comments

Comments
 (0)