Skip to content

Commit d1c981b

Browse files
Update developer-tools-template.ts: add independent scrollbars for left & right panels for large screens (#17765)
* Update developer-tools-template.ts * Update developer-tools-template.ts * fix overflow * Update src/panels/developer-tools/template/developer-tools-template.ts Co-authored-by: Wendelin <[email protected]> * Update src/panels/developer-tools/template/developer-tools-template.ts Co-authored-by: Wendelin <[email protected]> * Update developer-tools-template.ts * Update src/panels/developer-tools/template/developer-tools-template.ts Co-authored-by: Wendelin <[email protected]> * Update developer-tools-template.ts * prettier * Update developer-tools-template.ts * Update developer-tools-template.ts * prettier * Update developer-tools-template.ts * prettier * prettier * Update developer-tools-template.ts * prettier * prettier * prettier * Update developer-tools-template.ts --------- Co-authored-by: Wendelin <[email protected]>
1 parent 1b0e53d commit d1c981b

File tree

1 file changed

+39
-16
lines changed

1 file changed

+39
-16
lines changed

Diff for: src/panels/developer-tools/template/developer-tools-template.ts

+39-16
Original file line numberDiff line numberDiff line change
@@ -181,17 +181,21 @@ class HaPanelDevTemplate extends LitElement {
181181
>`
182182
: nothing}
183183
${this._templateResult
184-
? html`${this.hass.localize(
185-
"ui.panel.developer-tools.tabs.templates.result_type"
186-
)}:
187-
${resultType}
188-
<!-- prettier-ignore -->
189-
<pre class="rendered ${classMap({
190-
[resultType]: resultType,
191-
})}"
192-
>${type === "object"
193-
? JSON.stringify(this._templateResult.result, null, 2)
194-
: this._templateResult.result}</pre>
184+
? html`<pre
185+
class="rendered ${classMap({
186+
[resultType]: resultType,
187+
})}"
188+
>
189+
${type === "object"
190+
? JSON.stringify(this._templateResult.result, null, 2)
191+
: this._templateResult.result}</pre
192+
>
193+
<p>
194+
${this.hass.localize(
195+
"ui.panel.developer-tools.tabs.templates.result_type"
196+
)}:
197+
${resultType}
198+
</p>
195199
${this._templateResult.listeners.time
196200
? html`
197201
<p>
@@ -249,11 +253,11 @@ class HaPanelDevTemplate extends LitElement {
249253
</ul>
250254
`
251255
: !this._templateResult.listeners.time
252-
? html`<span class="all_listeners">
256+
? html`<p class="all_listeners">
253257
${this.hass.localize(
254258
"ui.panel.developer-tools.tabs.templates.no_listeners"
255259
)}
256-
</span>`
260+
</p>`
257261
: nothing}`
258262
: nothing}
259263
</div>
@@ -281,6 +285,10 @@ class HaPanelDevTemplate extends LitElement {
281285
max(16px, env(safe-area-inset-left));
282286
}
283287
288+
.content.horizontal {
289+
--code-mirror-max-height: calc(100vh - 389px);
290+
}
291+
284292
ha-card {
285293
margin-bottom: 16px;
286294
}
@@ -293,8 +301,9 @@ class HaPanelDevTemplate extends LitElement {
293301
color: var(--primary-color);
294302
}
295303
296-
.horizontal .edit-pane {
297-
max-width: 50%;
304+
.content.horizontal > * {
305+
width: 50%;
306+
margin-bottom: 0px;
298307
}
299308
300309
.render-spinner {
@@ -316,15 +325,29 @@ class HaPanelDevTemplate extends LitElement {
316325
white-space: pre-wrap;
317326
background-color: var(--secondary-background-color);
318327
padding: 8px;
328+
margin-top: 0;
329+
margin-bottom: 0;
319330
direction: ltr;
331+
overflow: auto;
332+
}
333+
334+
p,
335+
ul {
336+
margin-block-end: 0;
337+
}
338+
339+
.content.horizontal .render-pane .card-content {
340+
display: flex;
341+
flex-direction: column;
342+
max-height: calc(var(--code-mirror-max-height) + 47px);
320343
}
321344
322345
.all_listeners {
323346
color: var(--warning-color);
324347
}
325348
326349
@media all and (max-width: 870px) {
327-
.render-pane {
350+
.content ha-card {
328351
max-width: 100%;
329352
}
330353
}

0 commit comments

Comments
 (0)