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

5350 bug cant save a dataframe as a dataset for reuse add cell button not working yellow header always there part 3 #5432

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const props = defineProps<{
index: Number;
}>();

const emit = defineEmits(['deleteRequested']);
const emit = defineEmits(['deleteRequested', 'code-dirty']);

const confirm = useConfirm();

Expand All @@ -58,6 +58,7 @@ const code = computed(() => props.jupyterMessage.content.code);
const editor = ref<VAceEditorInstance['_editor'] | null>(null);
const initialize = (editorInstance) => {
editor.value = editorInstance;
editorInstance.getSession().on('change', () => emit('code-dirty'));
};

const enter = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
tabindex="0"
class="message-container"
>
<div v-if="showRerunMessage" class="rerun-message" @click="hideRerunMessage">
<div v-if="showRerunMessage" class="rerun-message" @click="closeRerunMessage">
Re-run all the cells to restore the context if you need to make any changes or use them downstream.
<Button class="close-mask" icon="pi pi-times" text rounded aria-label="Close" />
</div>
Expand All @@ -30,6 +30,7 @@
@delete-prompt="handleDeletePrompt"
@re-run-prompt="handleRerunPrompt"
@edit-prompt="reRunPrompt"
@code-dirty="() => (isRerunMessageRelevant = true)"
@click="selectedCellId = msg.query_id"
@on-selected="handleUpdateSelectedOutput(msg.query_id)"
/>
Expand Down Expand Up @@ -65,7 +66,8 @@ const selectedCellId = ref();
const filteredNotebookItems = computed<INotebookItem[]>(() =>
notebookItems.value.filter((item) => !isEmpty(item.messages))
);
const showRerunMessage = ref(true);
const hideRerunMessage = ref(false);
const isRerunMessageRelevant = ref(false);

const emit = defineEmits([
'new-message',
Expand All @@ -75,7 +77,8 @@ const emit = defineEmits([
'new-model-saved',
'update-kernel-state',
'update-language',
'update-selected-outputs'
'update-selected-outputs',
'code-dirty'
]);

const props = defineProps<{
Expand All @@ -93,6 +96,8 @@ const props = defineProps<{
defaultPreview?: string;
}>();

const showRerunMessage = computed<boolean>(() => !hideRerunMessage.value && isRerunMessageRelevant.value);

const iopubMessageHandler = (_session, message) => {
if (message.header.msg_type === 'status') {
const newState: KernelState = KernelState[KernelState[message.content.execution_state]];
Expand Down Expand Up @@ -409,8 +414,8 @@ const clearOutputs = () => {
}
};

const hideRerunMessage = () => {
showRerunMessage.value = false;
const closeRerunMessage = () => {
hideRerunMessage.value = true;
};

onUnmounted(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
:lang="language"
:index="index"
@deleteRequested="onDeleteRequested(m.header.msg_id)"
@code-dirty="() => emit('code-dirty')"
/>
</div>
<div
Expand Down Expand Up @@ -119,7 +120,8 @@ const emit = defineEmits([
're-run-prompt',
'delete-prompt',
'delete-message',
'on-selected'
'on-selected',
'code-dirty'
]);

const props = defineProps<{
Expand Down