Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| } catch { | ||
| toolbar.addItem(MITO_APP_MODE_BUTTON_ID, appModeButton); | ||
| } | ||
| }; |
There was a problem hiding this comment.
Duplicated button creation logic across two handlers
Low Severity
The addAppModeButtonIfNeeded function and the widgetAdded callback contain ~30 lines of nearly identical logic: guard checks, ToolbarButton construction with the same configuration, and the same insertAfter/addItem fallback. This duplication means any future change (e.g., button label, class, or click behavior) needs to be updated in two places, risking inconsistency. A single helper like addButtonToWidget(widget) would eliminate this.


Description
Here is the workflow of a user I talked to last week:
Now, if the .py file is a mito app (determined by the file name), then we inject an App Mode button into the .py file toolbar so you can open the preview. When you click the button, it searches for the notebook that has the associated name.
Testing
Steps:
Documentation
Note if any new documentation needs to addressed or reviewed.
Note
Medium Risk
Adds a new JupyterLab plugin that hooks into the file editor and opens notebooks via the contents API/doc manager, which could affect preview behavior and editor toolbar wiring. Dependency additions (
@jupyterlab/fileeditor/@jupyterlab/docmanager) and metadata-based notebook lookup introduce some integration and edge-case risk.Overview
Enables App Mode preview from the file editor by injecting an
App Modetoolbar button when a user opens amito-app-*.pyfile, and wiring the click to launch the existing Streamlit preview flow.Adds helper logic to map an app file path to a
notebook_id, locate an already-open notebook by metadata or scan/open a matching.ipynbin the same directory via the contents API, then callstreamlitPreviewManager.openAppPreview.Updates typings and dependencies to support
IEditorTracker/IDocumentManager, exportsMITO_NOTEBOOK_ID_KEYfor metadata reads, and adjusts the UI test to run in Galata’stmpPath.Written by Cursor Bugbot for commit aa094e2. This will update automatically on new commits. Configure here.