fix: x overflow scroll + add clear history btn (#2641)

This commit is contained in:
HugoCasa
2023-11-17 12:38:52 +01:00
committed by GitHub
parent 1d1258ff58
commit 1aef2aae90
3 changed files with 28 additions and 2 deletions
+14
View File
@@ -81,3 +81,17 @@
display: flex !important;
}
}
@layer utilities {
@variants responsive {
/* Hide scrollbar for Chrome, Safari and Opera */
.no-scrollbar::-webkit-scrollbar {
display: none;
}
/* Hide scrollbar for IE, Edge and Firefox */
.no-scrollbar {
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
}
}
}
@@ -171,6 +171,11 @@
}
localStorage.setItem('prompts-' + lang, JSON.stringify(promptHistory))
}
function clearPromptHistory() {
promptHistory = []
localStorage.setItem('prompts-' + lang, JSON.stringify(promptHistory))
}
$: lang && getPromptHistory()
$: $generatedCode && updateScroll()
@@ -342,13 +347,17 @@
<Button
size="xs2"
color="light"
btnClasses="justify-start"
startIcon={{ icon: HistoryIcon }}
btnClasses="justify-start overflow-x-scroll no-scrollbar"
startIcon={{ icon: HistoryIcon, classes: 'shrink-0' }}
on:click={() => {
funcDesc = p
}}>{p}</Button
>
{/each}
<button
class="underline text-xs text-start px-2 text-secondary font-normal"
on:click={clearPromptHistory}>clear history</button
>
</div>
{/if}
+3
View File
@@ -304,6 +304,9 @@ const ALL_INITIAL_CODE = [
PYTHON_INIT_CODE_CLEAR,
DENO_INIT_CODE_APPROVAL,
DENO_FAILURE_MODULE_CODE,
BUN_INIT_CODE,
BUN_INIT_CODE_CLEAR,
BUN_INIT_CODE_APPROVAL,
BASH_INIT_CODE,
POWERSHELL_INIT_CODE
]