Skip to content

Commit d4efbde

Browse files
committed
fix #4238 - juypter2: clicking on collab's avatar should let you jump to their active cell
1 parent 3898a8f commit d4efbde

File tree

1 file changed

+18
-0
lines changed
  • src/packages/frontend/frame-editors/jupyter-editor

1 file changed

+18
-0
lines changed

src/packages/frontend/frame-editors/jupyter-editor/actions.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,24 @@ export class JupyterEditorActions extends BaseActions<JupyterEditorState> {
537537
compute_server() {
538538
// this is here just so the dropdown gets enabled
539539
}
540+
541+
gotoUser(account_id: string, frameId?: string) {
542+
const cursors = this.jupyter_actions.syncdb
543+
.get_cursors({ maxAge: 0 })
544+
?.toJS();
545+
if (cursors == null) return; // no info
546+
const locs = cursors[account_id]?.locs;
547+
for (const loc of locs) {
548+
if (loc.id != null) {
549+
const frameActions = this.get_frame_actions(frameId);
550+
if (frameActions != null) {
551+
frameActions.set_cur_id(loc.id);
552+
frameActions.scroll("cell visible");
553+
return;
554+
}
555+
}
556+
}
557+
}
540558
}
541559

542560
export { JupyterEditorActions as Actions };

0 commit comments

Comments
 (0)