Skip to content
Open
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
Comment thread
jattasNI marked this conversation as resolved.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message scrollbars in Windows Chrome clip the border of messages a bit (went in devtools and removed the outline that the story itself adds for the screenshot):

Image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what to do here and I'm open to inputs from regular Windows users about what would feel natural. On mac the overlay scrollbars tend to be translucent and not permanently visible so I'm not sure what typical conventions are for cases like this.

Some options:

  1. do nothing because, at the moment, outbound messages are the only ones with a border/background and all clients currently only populate them with text content which wraps rather than overflows
  2. inset the scrollbar something like in the screenshot below. I achieved this by moving the border/background rendering to the outer container, keeping the scrollbar on the inner content, and adding padding between them.
  3. other ideas?
image

"type": "patch",
"comment": "Chat message sizing is more client configurable",
"packageName": "@ni/spright-components",
"email": "jattasNI@users.noreply.github.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ export const styles = css`
:host {
min-width: ${standardPadding};
min-height: ${standardPadding};
max-width: 90%;

flex-direction: row;
justify-content: flex-start;
align-self: flex-start;
flex-shrink: 0;
font: ${bodyFont};
color: ${bodyFontColor};
Expand All @@ -31,7 +33,6 @@ export const styles = css`
.container {
display: flex;
flex-direction: column;
max-width: calc(90%);
}

[part='start'] {
Expand All @@ -41,6 +42,7 @@ export const styles = css`
.message-content {
width: fit-content;
height: fit-content;
max-width: 100%;
overflow-x: auto;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ export const styles = css`
:host {
min-width: ${standardPadding};
min-height: ${standardPadding};
max-width: 90%;

flex-direction: row;
justify-content: flex-end;
align-self: flex-end;
flex-shrink: 0;
font: ${bodyFont};
color: ${bodyFontColor};
Expand All @@ -28,12 +30,12 @@ export const styles = css`
.container {
display: flex;
flex-direction: column;
max-width: calc(90%);
}

.message-content {
width: fit-content;
height: fit-content;
max-width: 100%;
overflow-x: auto;
}

Expand Down
5 changes: 4 additions & 1 deletion packages/spright-components/src/chat/message/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const styles = css`
:host {
Comment thread
jattasNI marked this conversation as resolved.
min-width: ${standardPadding};
min-height: ${standardPadding};
max-width: 90%;

flex-direction: row;
justify-content: center;
Expand All @@ -34,16 +35,17 @@ export const styles = css`

:host([message-type='${ChatMessageType.outbound}']) {
justify-content: flex-end;
align-self: flex-end;
}

:host([message-type='${ChatMessageType.inbound}']) {
justify-content: flex-start;
align-self: flex-start;
}

.container {
display: flex;
flex-direction: column;
max-width: calc(90%);
}

[part='start'] {
Expand All @@ -53,6 +55,7 @@ export const styles = css`
.message-content {
width: fit-content;
height: fit-content;
max-width: 100%;
overflow-x: auto;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ export const styles = css`
:host {
min-width: ${standardPadding};
min-height: ${standardPadding};
max-width: 90%;

flex-direction: row;
justify-content: center;
align-self: center;
flex-shrink: 0;
font: ${bodyFont};
color: ${bodyFontColor};
Expand All @@ -24,12 +26,12 @@ export const styles = css`
.container {
display: flex;
flex-direction: column;
max-width: calc(90%);
}

.message-content {
width: fit-content;
height: fit-content;
max-width: 100%;
overflow-x: auto;
}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ export const styles = css`
:host {
min-width: ${standardPadding};
min-height: ${standardPadding};
max-width: 90%;

flex: 1;
flex-direction: row;
justify-content: center;
align-self: center;
align-items: center;
font: ${bodyFont};
color: ${bodyFontColor};
Expand All @@ -31,7 +33,6 @@ export const styles = css`
display: flex;
flex-direction: column;
align-items: center;
max-width: calc(90%);
gap: ${mediumPadding};
}

Expand Down Expand Up @@ -65,6 +66,7 @@ export const styles = css`
align-items: center;
width: fit-content;
height: fit-content;
max-width: 100%;
overflow-x: auto;
gap: ${mediumPadding};
}
Expand Down