Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jamie fix transform dataset toolbar #5579

Merged
merged 11 commits into from
Nov 20, 2024
11 changes: 11 additions & 0 deletions packages/client/hmi-client/src/assets/css/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,17 @@
color: var(--surface-0);
}

/* Ensure long autocomplete items line wrap */
.p-autocomplete-panel {
max-width: 600px;
max-height: 300px !important;
box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.1);
.p-autocomplete-items {
.p-autocomplete-item {
white-space: normal;
}
}
}
/* SplitButton menu height and width fix */
.p-tieredmenu {
width: auto;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!-- Toolbar -->
<div class="toolbar flex">
<!-- Kernel Status -->
<div class="toolbar-section">
<div class="kernel-status-container">
<span><i class="pi pi-circle-fill kernel-status" :style="statusStyle" /></span>
<header id="GPT">
{{ kernelStatus === 'idle' ? 'Ready' : kernelStatus === 'busy' ? 'Busy' : 'Offline' }}
Expand Down Expand Up @@ -63,24 +63,26 @@
</div>

<!-- Reset kernel -->
<Dropdown
:model-value="selectedLanguage"
placeholder="Select a language"
:options="languages"
option-label="name"
option-value="value"
class="language-dropdown"
:disabled="kernelStatus !== 'idle'"
@change="onChangeLanguage"
/>
<Button
label="Reset kernel"
severity="secondary"
outlined
icon="pi pi-replay"
class="p-button p-button-sm pr-4"
@click="confirmReset"
/>
<div class="toolbar-right">
<Dropdown
:model-value="selectedLanguage"
placeholder="Select a language"
:options="languages"
option-label="name"
option-value="value"
class="language-dropdown"
:disabled="kernelStatus !== 'idle'"
@change="onChangeLanguage"
/>
<Button
label="Reset kernel"
severity="secondary"
outlined
icon="pi pi-replay"
class="p-button p-button-sm pr-4"
@click="confirmReset"
/>
</div>
</div>

<!-- Jupyter Chat -->
Expand Down Expand Up @@ -396,7 +398,6 @@ const confirmReset = () => {
This will reset the kernel back to its starting state, but keep all of your prompts and code cells.
The code cells will need to be rerun.`,
header: 'Reset kernel',
icon: 'pi pi-exclamation-triangle',
accept: () => {
resetKernel();
}
Expand Down Expand Up @@ -547,6 +548,16 @@ const onDownloadResponse = (payload) => {
flex: 1;
}

.kernel-status-container {
display: flex;
flex-direction: row;
align-items: top;
flex-wrap: nowrap;
white-space: nowrap;
min-width: 5.25rem;
padding-top: var(--gap-2-5);
}

.kernel-status {
margin-right: 10px;
}
Expand All @@ -558,30 +569,35 @@ const onDownloadResponse = (payload) => {
.toolbar {
display: flex;
flex-direction: row;
align-items: center;
align-items: top;
background-color: var(--surface-100);
border-bottom: 1px solid var(--surface-border);
position: sticky;
top: 0;
left: 0;
z-index: 100;
width: 100%;
height: 3.5rem;
padding: var(--gap-2) var(--gap-4) var(--gap-2) 1.5rem;
gap: var(--gap-2);
box-shadow: 0 4px 6px -5px rgba(0, 0, 0, 0.2);
}
.toolbar:deep(.p-button .p-button-label) {
font-weight: 500;
}
.toolbar-section {
.toolbar-right {
display: flex;
flex-direction: row;
align-items: center;
flex-wrap: nowrap;
white-space: nowrap;
align-items: top;
gap: var(--gap-2);
height: 32px; /* aligns with the height of the input buttons */
}

:deep(.language-dropdown span) {
font-size: 12px;
margin-left: var(--gap-1-5);
}
.tera-beaker-input {
padding-top: 0;
}

.variables-table {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@ const confirmReset = () => {
This will reset the kernel back to its starting state, but keep all of your prompts and code cells.
The code cells will need to be rerun.`,
header: 'Confirmation',
icon: 'pi pi-exclamation-triangle',
accept: () => {
resetKernel();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ const runAllCells = () => {
const searchOptions = () => {
const query = queryString.value.toLowerCase();
filteredOptions.value = props.defaultOptions.filter((option) => option.toLowerCase().includes(query));

// Hide the panel if there are no suggestions
if (filteredOptions.value.length === 0) {
autoComplete.value?.hide();
}
};

const onInputChange = async () => {
Expand All @@ -159,6 +164,7 @@ const onInputChange = async () => {
hideAutoComplete.value = true;
await nextTick();
inputElement.value?.focus();
autoGrow();
}
};

Expand Down Expand Up @@ -256,16 +262,17 @@ const autoGrow = () => {
}
.auto-complete {
width: 100%;
position: relative;
}

.auto-complete:deep(input),
.text-area {
width: 100%;
background-image: url('@assets/svg/icons/message.svg');
background-size: 1rem;
background-position: var(--gap-2) 9px;
background-position: var(--gap-2-5) 9px;
background-repeat: no-repeat;
padding-right: 2rem;
padding-left: 2rem;
padding-left: 2.25rem;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ const onClickClose = () => {
display: flex;
justify-content: space-between;
white-space: pre-line;
background-color: #fff;
border: 1px solid var(--surface-border);
background-color: var(--surface-50);
border: 1px solid var(--surface-border-light);
box-shadow: inset 0 0 4px 0 rgba(0, 0, 0, 0.05);
border-radius: var(--border-radius);
padding: var(--gap-4);
color: var(--text-color);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ section {
}

.selected {
background-color: var(--surface-50);
background-color: var(--surface-0);
border: 1px solid var(--primary-color);
}

Expand All @@ -503,6 +503,7 @@ section {
.message-container {
height: calc(100% - 3.5rem);
overflow-y: auto;
background: var(--surface-100);
}
.rerun-message {
display: flex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,10 @@ function onDeleteRequested(msgId: string) {
}

.error {
background: var(--red-50);
color: darkred;
white-space: pre-wrap;
padding-top: 10px;
padding: var(--gap-4);
}

.jupyter-response {
Expand All @@ -277,8 +278,7 @@ function onDeleteRequested(msgId: string) {
}

.jupyter-response:hover:not(.selected) {
background-color: var(--surface-50);
border: 1px solid var(--surface-border-light);
border: 1px solid color-mix(in srgb, var(--primary-color) 20%, var(--surface-border-light) 80%);
}

.jupyter-response .menu-container {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
@change="onInputChange"
placeholder="What do you want to do?"
emptySearchMessage="No suggestions"
:showEmptyMessage="false"
:disabled="kernelStatus === KernelState.busy"
/>

Expand Down Expand Up @@ -129,6 +130,11 @@ const submitQuestion = () => {
const searchOptions = () => {
const query = questionString.value.toLowerCase();
filteredOptions.value = props.defaultOptions.filter((option) => option.toLowerCase().includes(query));

// Hide the panel if there are no suggestions
if (filteredOptions.value.length === 0) {
autoComplete.value?.hide();
}
};

const onInputChange = async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ const confirmReset = () => {
This will reset the kernel back to its starting state, but keep all of your prompts and code cells.
The code cells will need to be rerun.`,
header: 'Confirmation',
icon: 'pi pi-exclamation-triangle',
accept: () => {
resetKernel();
}
Expand Down