b5642ec5cd9d8fb79dab2860aa7e563bc765bfd1
The previous commit put the toolbar at the top of every assistant
message. The intent was actually to put the buttons inside the
fenced code blocks (the parts wrapped in ```python etc.), not above
the whole result section.
Changes:
- opencode_inline_prompt.ts: removed the message-level toolbar on
.opencode-msg-assistant. Instead, after marked.parse the assistant
markdown, for every rendered <pre> we wrap it in
.opencode-code-block and prepend a small toolbar with the same
three buttons. Each button acts on the code text of THAT specific
block (snapshot of <code>.textContent taken before DOM mutation,
so the toolbar label text never leaks into the copied/inserted/
replaced value). Messages with no code fences get no toolbar.
- style/base.css: replaced .opencode-msg-toolbar / .opencode-msg-btn
with .opencode-code-block / .opencode-code-toolbar /
.opencode-code-btn. The wrapped <pre> connects visually to the
toolbar (no top border/radius, no top margin) so each fenced
block reads as one unit (GitHub-style).
- Tests: updated the marked mock to produce real <pre><code> for
fenced code (so the per-block post-processing can find them)
and <h1>/<p> for headings. The 4 button tests now look for the
toolbar inside .opencode-code-block and assert the button acts
on the code block text ('print(1)'), not the whole markdown.
Added a test that an assistant message with no code fences has
no toolbar.
Verification: pytest 37/37, jest 34/34, build OK.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
opencode_bridge
A JupyterLab extension.
This extension is composed of a Python package named opencode_bridge
for the server extension and a NPM package named opencode_bridge
for the frontend extension.
Requirements
- JupyterLab >= 4.0.0
Install
To install the extension, execute:
pip install opencode_bridge
Uninstall
To remove the extension, execute:
pip uninstall opencode_bridge
Troubleshoot
If you are seeing the frontend extension, but it is not working, check that the server extension is enabled:
jupyter server extension list
If the server extension is installed and enabled, but you are not seeing the frontend extension, check the frontend extension is installed:
jupyter labextension list
Contributing
If you would like to contribute to this extension, please refer to the Contributing Guide.
Releases
2
Release v0.1.1
Latest
Languages
TypeScript
55.6%
Python
38.8%
CSS
3.9%
JavaScript
0.9%
Shell
0.8%