-
Notifications
You must be signed in to change notification settings - Fork 166
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
improvement: click hourglass to move view to current cell #1040
improvement: click hourglass to move view to current cell #1040
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
5ae04fa
to
f2df778
Compare
f2df778
to
50d787f
Compare
const { cellIds } = store.get(notebookAtom); | ||
const cellIdx = Object.values(state.cellRuntime).findIndex( | ||
(cell) => cell.status === "running", | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think you can avoid wiring the state through, and might be able to change this to:
const { cellRuntime } = store.get(notebookAtom);
const cell = Objects.entries(cellRuntime).find(
([cellId, runtime]) => runtime.status === "running",
)
if (!cell) {
return;
}
const view = getCellEditorView(cell[0]);
view?.dispatch({
selection: { anchor: 0 },
effects: [EditorView.scrollIntoView(0, { y: "center" })],
});
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for the suggestion :) I'll give it a try.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the PR to your suggestion. Thanks for the improvement :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice stuff!
🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.3.9-dev7 |
…m#1040) * click hourglass to move view to current cell * removed dependence on NotebookState as per review comment
Addresses #1030