Skip to content

Commit

Permalink
Snaps and nits
Browse files Browse the repository at this point in the history
  • Loading branch information
OEvgeny committed Dec 5, 2024
1 parent ca2f16d commit c9e6f63
Show file tree
Hide file tree
Showing 45 changed files with 28 additions and 162 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
130 changes: 0 additions & 130 deletions __tests__/html/activityGrouping.disableAbsoluteTimestamp.html

This file was deleted.

11 changes: 5 additions & 6 deletions __tests__/html/transcript.activityGrouping.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,13 @@
}
} = window;

run = fn => fn();
run(async function () {
const params = new URLSearchParams(location.hash.replace(/^#/u, ''));

const height = params.get('ch');
const width = params.get('cw');

// await host.windowSize(width, height, document.getElementById('webchat'));
await host.windowSize(width, height, document.getElementById('webchat'));

const TestHarness = () => {
const { activityMiddleware, directLine, rtl, styleOptions, wide } = useContext(ActivityGroupingContext);
Expand Down Expand Up @@ -76,11 +75,11 @@
document.getElementById('webchat')
);

// await pageConditions.uiConnected();
// await pageConditions.allImagesLoaded();
// await pageConditions.scrollToBottomCompleted();
await pageConditions.uiConnected();
await pageConditions.allImagesLoaded();
await pageConditions.scrollToBottomCompleted();

// await host.snapshot();
await host.snapshot();
});
</script>
</body>
Expand Down
Binary file modified __tests__/html2/activity/viewCodeButton.html.snap-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion __tests__/html2/markdown/codeBlock/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
const params = new URLSearchParams(location.search);

renderWebChat({
directLine,
directLine,
store,
styleOptions: {
codeBlockTheme: params.get('code-block-theme') ?? 'github-light-default'
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified __tests__/html2/markdown/codeBlockCopyButton/layout.html.snap-1.png
11 changes: 5 additions & 6 deletions packages/component/src/Styles/CustomPropertyNames.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
const CustomPropertyNames = Object.freeze({
// Make sure key names does not have JavaScript forbidden names.
BackgroundCodeBlock: '--webchat__background--code-block',
BorderAnimationColor1: '--webchat__border-animation--color-1',
BorderAnimationColor2: '--webchat__border-animation--color-2',
BorderAnimationColor3: '--webchat__border-animation--color-3',
ColorAccent: '--webchat__color--accent',
ColorCodeBlock: '--webchat__color--code-block',
ColorSubtle: '--webchat__color--subtle',
ColorTimestamp: '--webchat__color--timestamp',
FontPrimary: '--webchat__font--primary',
FontSizeSmall: '--webchat__font-size--small',
IconURLExternalLink: '--webchat__icon-url--external-link',
MaxHeightImageBubble: '--webchat__max-height--image-bubble',
MaxWidthAttachmentBubble: '--webchat__max-width--attachment-bubble',
MinWidthAttachmentBubble: '--webchat__min-width--attachment-bubble',
MaxWidthMessageBubble: '--webchat__max-width--message-bubble',
MinWidthMessageBubble: '--webchat__min-width--message-bubble',
MinHeightBubble: '--webchat__min-height--bubble',
MinHeightImageBubble: '--webchat__min-height--image-bubble',
MinWidthAttachmentBubble: '--webchat__min-width--attachment-bubble',
MinWidthMessageBubble: '--webchat__min-width--message-bubble',
PaddingRegular: '--webchat__padding--regular',
SizeAvatar: '--webchat__size--avatar'
});

// This is for type-checking only to make sure the CSS custom property names is `--webchat__${string}`.
const _TypeChecking: Readonly<Record<string, `--webchat__${string}`>> = CustomPropertyNames;
}) satisfies Readonly<Record<string, `--webchat__${string}`>>;

export default CustomPropertyNames;
18 changes: 11 additions & 7 deletions packages/component/src/Styles/StyleSet/CodeBlock.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
import CustomPropertyNames from '../CustomPropertyNames';

export default function createCodeBlockStyle() {
return {
'&.webchat__code-block': {
margin: '16px 0',
background: `var(${CustomPropertyNames.BackgroundCodeBlock}, inherit)`,
border: '1px solid #d1d1d1',
borderRadius: '4px',
color: `var(${CustomPropertyNames.ColorCodeBlock}, currentColor)`,
display: 'block',
margin: '16px 0',
overflow: 'hidden',
padding: '4px',
borderRadius: '4px',
border: '1px solid #d1d1d1',

':has(> .github-dark-default)': {
backgroundColor: 'var(--webchat__code-block--background, #0d1117)',
color: 'var(--webchat__code-block--color, #e6edf3)'
background: `var(${CustomPropertyNames.BackgroundCodeBlock}, #0d1117)`,
color: `var(${CustomPropertyNames.ColorCodeBlock}, #e6edf3)`
},

':has(> .github-light-default)': {
backgroundColor: 'var(--webchat__code-block--background, inherit)',
color: 'var(--webchat__code-block--color, currentColor)'
background: `var(${CustomPropertyNames.BackgroundCodeBlock}, #ffffff)`,
color: `var(${CustomPropertyNames.ColorCodeBlock}, #1f2328)`
},

':has(.webchat__code-block__body:focus-visible):focus-within': {
Expand Down
4 changes: 0 additions & 4 deletions packages/component/src/Styles/StyleSet/RenderMarkdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ export default function createMarkdownStyle() {

'& :is([data-math-type=block], [data-math-type=inline]) > span': {
display: 'contents'
},

'& .webchat__render-markdown__code-block': {
whiteSpace: 'pre-wrap'
}
}
};
Expand Down
1 change: 0 additions & 1 deletion packages/component/src/Styles/StyleSet/ViewCodeDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export default function createViewCodeDialogStyle() {
'& .webchat__view-code-dialog__body': {
border: 'none',
borderRadius: 0,
display: 'flex',
overflow: 'auto',
height: '100%',

Expand Down
13 changes: 6 additions & 7 deletions packages/fluent-theme/src/components/theme/Theme.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -443,20 +443,20 @@
}

&:global(:has(> .github-dark-default)) {
--webchat__background--code-block: var(--codeBlockBackground, var(--webchat-colorGrey8));
--webchat__code-block__copy-button--background: var(
--codeBlockCopyButtonBackgroundPressed,
var(--webchat-colorGrey14)
);
--webchat__code-block__copy-button--color: var(--codeBlockCopyButtonColor, var(--webchat__code-block--color));
--webchat__code-block--background: var(--codeBlockBackground, var(--webchat-colorGrey8));
--webchat__code-block--color: var(--codeBlockColor, var(--webchat-colorGrey98));
--webchat__code-block__copy-button--color: var(--codeBlockCopyButtonForeground, var(--webchat__color--code-block));
--webchat__color--code-block: var(--codeBlockForeground, var(--webchat-colorGrey98));
}

&:global(:has(> .github-light-default)) {
--webchat__background--code-block: var(--codeBlockBackground, var(--webchat-colorGrey98));
--webchat__code-block__copy-button--background: var(--codeBlockBackgroundPressed, var(--webchat-colorGrey92));
--webchat__code-block__copy-button--color: var(--codeBlockCopyButtonColor, var(--webchat__code-block--color));
--webchat__code-block--background: var(--codeBlockBackground, var(--webchat-colorGrey98));
--webchat__code-block--color: var(--codeBlockColor, var(--webchat-colorGrey8));
--webchat__code-block__copy-button--color: var(--codeBlockCopyButtonForeground, var(--webchat__color--code-block));
--webchat__color--code-block: var(--codeBlockForeground, var(--webchat-colorGrey8));
}
}

Expand All @@ -482,7 +482,6 @@
--webchat__code-block__copy-button--background: var(--webchat-colorNeutralBackground3);

margin-block-start: var(--webchat-spacingVerticalS);
opacity: 1;
position: absolute;
right: 32px;
top: 0;
Expand Down

0 comments on commit c9e6f63

Please sign in to comment.