Skip to content

Commit

Permalink
Merge pull request #338 from rebeccaalpert/zooming
Browse files Browse the repository at this point in the history
fix(Chatbot): Handle zoom appropriately
  • Loading branch information
nicolethoen authored Dec 3, 2024
2 parents 53e550d + 15bf029 commit b0887a6
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 1 deletion.
31 changes: 30 additions & 1 deletion packages/module/src/Chatbot/Chatbot.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@
&--hidden {
pointer-events: none;
}

// 32 rem is the width of the overlay chatbot plus the insets
// if the screen is smaller, we want to be 100%
@media screen and (max-width: 32rem) {
width: 100vw;
inset-inline-end: 0;
}

// allows for zoom conditions; try zooming to 200% to see
@media screen and (max-height: 518px) {
overflow: auto;
}
}

// ============================================================================
Expand All @@ -34,10 +46,22 @@
border-radius: 0;
box-shadow: var(--pf-t--global--box-shadow--lg--left);
overflow: inherit;

// 30rem is the width of the docked chatbot
// if the screen is smaller, we want to be 100%
@media screen and (max-width: 30rem) {
width: 100%;
}
}

html.pf-chatbot-allow--docked {
padding-right: 480px;
padding-inline-start: 480px;

// 30rem is the width of the docked chatbot
// if the screen is smaller, we want to be 100%
@media screen and (max-width: 30rem) {
padding-inline-start: 0px;
}
}

// ============================================================================
Expand Down Expand Up @@ -76,6 +100,11 @@ html.pf-chatbot-allow--docked {
&--hidden {
pointer-events: none;
}

// allows for zoom conditions; try zooming to 200% to see
@media screen and (max-height: 518px) {
overflow: auto;
}
}

.pf-chatbot-container--embedded {
Expand Down
5 changes: 5 additions & 0 deletions packages/module/src/ChatbotContent/ChatbotContent.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
overflow-y: auto;
overflow: hidden; // needed in Red Hat Developer Hub workspace
flex: 1; // needed in Composer AI

// allows for zoom conditions; try zooming to 200% to see
@media screen and (max-height: 518px) {
overflow: unset;
}
}

// ============================================================================
Expand Down
20 changes: 20 additions & 0 deletions packages/module/src/FileDropZone/FileDropZone.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
overflow: hidden;
display: grid;
grid-template-rows: 1fr auto;

// allows for zoom conditions; try zooming to 200% to see
@media screen and (max-height: 518px) {
overflow-y: auto;
}
}

.pf-chatbot__dropzone--visible.pf-chatbot__dropzone {
Expand Down Expand Up @@ -34,3 +39,18 @@
width: 100%;
padding: var(--pf-t--global--spacer--md);
}

.pf-chatbot--default {
// allows for zoom conditions; try zooming to 200% to see
.pf-chatbot__dropzone--visible.pf-chatbot__dropzone {
@media screen and (max-height: 518px) {
display: flex;
height: 100%;
overflow: hidden;

.pf-v6-c-multiple-file-upload__main {
width: 100%;
}
}
}
}
5 changes: 5 additions & 0 deletions packages/module/src/MessageBox/JumpButton.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,9 @@
&--bottom {
inset-block-end: var(--pf-t--global--spacer--md) !important;
}

// allows for zoom conditions; try zooming to 200% to see
@media screen and (max-height: 518px) {
display: none;
}
}
10 changes: 10 additions & 0 deletions packages/module/src/MessageBox/MessageBox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@
flex-direction: column;
row-gap: var(--pf-t--global--spacer--sm);
padding: var(--pf-t--global--spacer--lg);

// 32 rem is the width of the overlay chatbot plus the insets
// if the screen is smaller, we want to be 100%
@media screen and (max-width: 32rem) {
width: 100%;
}
// allows for zoom conditions; try zooming to 200% to see
@media screen and (max-height: 518px) {
overflow-y: visible;
}
}

.pf-chatbot__messagebox--bottom > :first-child {
Expand Down

0 comments on commit b0887a6

Please sign in to comment.