Skip to content

Commit 57882c5

Browse files
committed
interface tweaks
1 parent aaaf7f3 commit 57882c5

File tree

3 files changed

+36
-25
lines changed

3 files changed

+36
-25
lines changed

src/components/Toolbar.tsx

+27-24
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ const Toolbar: FunctionComponent<ToolbarProps> = ({
9494
onResetToRemote?.();
9595
};
9696

97-
const { jupyterServerIsAvailable, jupyterServerUrl } = useJupyterConnectivity();
97+
const { jupyterServerIsAvailable, jupyterServerUrl } =
98+
useJupyterConnectivity();
9899

99100
const getConnectionStatus = () => {
100101
if (sessionClient) {
@@ -139,32 +140,34 @@ const Toolbar: FunctionComponent<ToolbarProps> = ({
139140
userSelect: "none",
140141
}}
141142
>
142-
<Tooltip title={sessionClient ? `Connected to ${jupyterServerUrl}` : ""}>
143+
<Tooltip
144+
title={sessionClient ? `Connected to ${jupyterServerUrl}` : ""}
145+
>
146+
<Box
147+
sx={{
148+
display: "flex",
149+
alignItems: "center",
150+
gap: 1,
151+
cursor: "pointer",
152+
"&:hover": {
153+
opacity: 0.8,
154+
},
155+
}}
156+
onClick={() => onJupyterConfigClick?.()}
157+
>
143158
<Box
144159
sx={{
145-
display: "flex",
146-
alignItems: "center",
147-
gap: 1,
148-
cursor: "pointer",
149-
"&:hover": {
150-
opacity: 0.8,
151-
},
160+
width: 8,
161+
height: 8,
162+
borderRadius: "50%",
163+
backgroundColor: status.color,
152164
}}
153-
onClick={() => onJupyterConfigClick?.()}
154-
>
155-
<Box
156-
sx={{
157-
width: 8,
158-
height: 8,
159-
borderRadius: "50%",
160-
backgroundColor: status.color,
161-
}}
162-
/>
163-
<Typography variant="body2" color="text.secondary">
164-
{status.text}
165-
</Typography>
166-
</Box>
167-
</Tooltip>
165+
/>
166+
<Typography variant="body2" color="text.secondary">
167+
{status.text}
168+
</Typography>
169+
</Box>
170+
</Tooltip>
168171
{executingCellId ? (
169172
<Tooltip title={`Executing cell`}>
170173
<CircularProgress size={20} color="primary" />

src/pages/HomePage/NotebookViewComponent.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,10 @@ const NotebookViewComponent: FunctionComponent<NotebookViewComponentProps> = ({
225225
handleLogCell(activeCellId);
226226
} else if (event.key === "Escape") {
227227
paperRef.current?.focus();
228+
} else if (event.key === "Home") {
229+
setActiveCellId(notebook.cellOrder.first());
230+
} else if (event.key === "End") {
231+
setActiveCellId(notebook.cellOrder.last());
228232
}
229233
}}
230234
>

src/pages/HomePage/NotebookViewHooks.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,11 @@ export const useExecute = (
217217
newCodeCell.get("source"),
218218
sessionClient,
219219
(outputs) => {
220-
const newCodeCell = codeCell.set("outputs", outputs);
220+
let newCodeCell = codeCell.set("outputs", outputs);
221+
newCodeCell = newCodeCell.set(
222+
"metadata",
223+
newCodeCell.metadata.set("collapsed", false),
224+
);
221225
newNotebook = newNotebook.setIn(
222226
["cellMap", activeCellId],
223227
newCodeCell,

0 commit comments

Comments
 (0)