label: 'Render user content as Markdown',
type: SettingsFieldType.CHECKBOX
},
+ {
+ key: SETTINGS_KEYS.FULL_HEIGHT_CODE_BLOCKS,
+ label: 'Use full height code blocks',
+ type: SettingsFieldType.CHECKBOX
+ },
{
key: SETTINGS_KEYS.DISABLE_AUTO_SCROLL,
label: 'Disable automatic scroll',
import { ActionIconsCodeBlock, DialogCodePreview } from '$lib/components/app';
import { createAutoScrollController } from '$lib/hooks/use-auto-scroll.svelte';
import type { DatabaseMessageExtra } from '$lib/types/database';
+ import { config } from '$lib/stores/settings.svelte';
+ import { SETTINGS_KEYS } from '$lib/constants/settings-keys';
interface Props {
attachments?: DatabaseMessageExtra[];
});
</script>
-<div bind:this={containerRef} class={className}>
+<div
+ bind:this={containerRef}
+ class="{className}{config()[SETTINGS_KEYS.FULL_HEIGHT_CODE_BLOCKS]
+ ? ' full-height-code-blocks'
+ : ''}"
+>
{#each renderedBlocks as block (block.id)}
<div class="markdown-block" data-block-id={block.id}>
<!-- eslint-disable-next-line no-at-html-tags -->
line-height: 1.3;
}
+ .full-height-code-blocks :global(.code-block-wrapper) {
+ max-height: none;
+ }
+
+ .full-height-code-blocks :global(.code-block-scroll-container),
+ .full-height-code-blocks .streaming-code-scroll-container {
+ max-height: none;
+ overflow-y: visible;
+ }
+
div :global(.code-block-header) {
display: flex;
justify-content: space-between;
alwaysShowSidebarOnDesktop: false,
autoShowSidebarOnNewChat: true,
autoMicOnEmpty: false,
+ fullHeightCodeBlocks: false,
// make sure these default values are in sync with `common.h`
samplers: 'top_k;typ_p;top_p;min_p;temperature',
backend_sampling: false,
'Automatically show sidebar when starting a new chat. Disable to keep the sidebar hidden until you click on it.',
autoMicOnEmpty:
'Automatically show microphone button instead of send button when textarea is empty for models with audio modality support.',
+ fullHeightCodeBlocks:
+ 'Always display code blocks at their full natural height, overriding any height limits.',
pyInterpreterEnabled:
'Enable Python interpreter using Pyodide. Allows running Python code in markdown code blocks.',
enableContinueGeneration:
DISABLE_AUTO_SCROLL: 'disableAutoScroll',
ALWAYS_SHOW_SIDEBAR_ON_DESKTOP: 'alwaysShowSidebarOnDesktop',
AUTO_SHOW_SIDEBAR_ON_NEW_CHAT: 'autoShowSidebarOnNewChat',
+ FULL_HEIGHT_CODE_BLOCKS: 'fullHeightCodeBlocks',
// Sampling
TEMPERATURE: 'temperature',
DYNATEMP_RANGE: 'dynatemp_range',