r/opencode • • 3d ago

Created a plugin that allows you to comment and see UI alternatives in your browser

I use Design in Browser with Claude Code and OpenCode. I can chat with my agent, draw right on the page, and leave comments where I want something changed. I can also try out a few different designs and tweak the one I like: https://www.npmjs.com/package/design-in-browser

No Chrome extension, just Vite+React plugin.

Please try it and do whatever you want with it. If you have some cool ideas and fixes: https://github.com/formstep/design-in-browser

Comment
Alternatives and tweak
2 Upvotes

2 comments sorted by

1

u/johansson_e-68 2d ago

How does the agent receive each comment or drawn change: as DOM/element context, a screenshot, or both? That seems key to how precisely it can implement them.

1

u/mellosty 2d ago

Both. Every comment sends the agent the element's DOM context: selector, text, HTML, computed styles, position and ancestors. It also sends the exact source location of its JSX (path:line:column) and of the components that render it. That source location is what makes the edits precise. The agent opens the right line instead of guessing from the DOM.

A drawn change sends the marks as page coordinates plus the element under them. If you tick "Attach a screenshot", the agent also gets a cropped image of the area with your marks on it.