UX: add HTML class for composer preview to manage sidebar height (#30956)

This adds the class `composer-has-preview` to the HTML element when the
composer is opened and the preview is visible.

This allows us to adjust the sidebar height, so that the previewless
composer can overlap the sidebar and better utilize the available space.


Before:

![image](https://github.com/user-attachments/assets/8780f159-5d24-4ac0-8a4f-43a9b1665532)



After: 

![image](https://github.com/user-attachments/assets/baf69856-0ece-453f-aa0f-e7be9939af97)
This commit is contained in:
Kris
2025-01-23 12:41:36 -05:00
committed by GitHub
parent f1bdd86a8c
commit 097d987332
2 changed files with 5 additions and 0 deletions

View File

@@ -8,6 +8,7 @@
>
<div class="grippie"></div>
{{#if this.composer.visible}}
{{html-class (if this.composer.showPreview "composer-has-preview")}}
<ComposerMessages
@composer={{this.composer.model}}
@messageCount={{this.composer.messageCount}}

View File

@@ -88,6 +88,10 @@
// allows sidebar to scroll to the bottom when the composer is open
height: calc(100% - var(--composer-height, 0px));
html:not(.composer-has-preview) & {
height: 100%;
}
}
.sidebar-sections {