feat(browser): replace the preview proxy with a real browser panel and an agent web tool (#2883)
The preview panel worked by proxying a dev server through OpenChamber's own origin and rewriting the HTML that came back. Anything the rewriter did not anticipate broke, and pages that refuse to be embedded never loaded at all. This deletes the proxy (-1604 lines and its tests) and merges the preview and browser panels into one surface backed by a real Chromium view. What the panel is now - A `<webview>` in its own session partition: logins and cookies persist, hot reload works because nothing is rewritten, DevTools are one click away. - Annotation: pick one element, drag a region, or draw freehand, write a note, and it reaches chat with a screenshot of the visible page with the marks on it. - Toolbar: hard reload, page zoom, device sizes, a light/dark switch that applies to the page rather than the app, and cookie/cache clearing scoped to the panel alone. - Several pages at once, each tab showing the page's own favicon, and an address bar that suggests pages already visited in this project. - Dev servers are listed from what is actually listening on the machine, checked against what a project announced, so a server is offered no matter how it was started. One that is still starting is waited for instead of failing. Remote dev servers The desktop app binds a local port and pipes raw bytes to the OpenChamber host over the existing authenticated connection, so the page keeps its own origin at the root of its own host. The reachable set is exactly what discovery reports and is re-checked per connection, so an authenticated client cannot dial arbitrary local services on the host. Links and redirects to another loopback port stay on the machine that served the page. A tunnel that cannot be opened is reported; it is never replaced by the plain loopback URL, which would answer from the user's own machine under a remote address. Agent control Browser actions are a separate `openchamber_web` tool: open, snapshot, click, type, scroll, inspect computed styles, resize between mobile/tablet/desktop, and capture a screenshot into `.openchamber/screenshots/` in the project. The existing `openchamber` tool keeps sessions, worktrees and scheduled tasks. Each has its own setting in the new Settings -> General -> OpenChamber Tools section, and the plugin is not injected at all when both are off. Capability belongs to the connected client, not to configuration: a client declares on its event stream that it can drive a page, which only a Chromium host does. Exactly one client performs each request — it claims the request before acting, and the first claim wins — because deciding by whose result arrives first would be too late for a click that already happened. No client listening is answered immediately with an explanation rather than a timeout. Runtime boundaries Web tabs get a plain iframe that can display a page but not inspect one. The VS Code extension no longer offers the surface at all, since nothing that makes the panel worth having works there. Mobile is unaffected. Native boundary Camera, microphone, location and device-picker requests from panel pages are denied — Electron grants them by default when no handler is set, and the panel loads whatever address the user types. Page capture, appearance emulation and storage clearing verify that their target belongs to the panel's own session instead of trusting a web-contents id from the renderer. Persisted state Stored `preview` tabs migrate to `browser` (v13 -> v14). Context panel tab limits are now per surface, so filling one surface no longer evicts another's tabs. Address history is stored per project and per runtime. Documentation `preview.mdx` and `desktop-browser.mdx` rewritten across all locales, the agent tool settings path corrected, new `DOCUMENTATION.md` for the browser-control broker and the dev tunnel, and the `ui-api-decoupling` skill updated where it still described the deleted proxy.
This commit is contained in:
committed by
GitHub
parent
50613bb170
commit
a5aa32446d
@@ -1015,6 +1015,9 @@ export const dict = {
|
||||
'contextRail.editorTree.toggle': 'Afficher/masquer l’arborescence de fichiers',
|
||||
'contextPanel.browser.open': 'Ouvrir le panneau du navigateur',
|
||||
'contextPanel.browser.addressAria': 'Adresse du navigateur',
|
||||
'contextPanel.browser.history.label': 'Adresses récentes',
|
||||
'contextPanel.browser.history.forget': 'Retirer de l’historique',
|
||||
'contextPanel.browser.newTab': 'Nouvel onglet du navigateur',
|
||||
'contextPanel.browser.empty': 'Navigateur Internet',
|
||||
'contextPanel.browser.emptyHint': 'Entrez une adresse ci-dessus pour commencer à naviguer sur le Web',
|
||||
'contextPanel.tab.closeTabAria': 'Fermer l\'onglet {label}',
|
||||
@@ -2869,6 +2872,56 @@ export const dict = {
|
||||
'worktree.bootstrap.toast.failedDescription': 'Le worktree a été créé, mais la configuration en arrière-plan ne s’est pas terminée.',
|
||||
'worktree.bootstrap.toast.timeoutDescription': 'Le worktree a été créé, mais la configuration en arrière-plan a expiré.',
|
||||
'contextPanel.browser.inspectUnavailable': 'Cette page ne peut pas être inspectée depuis le panneau de navigateur.',
|
||||
'contextPanel.browser.back': 'Retour',
|
||||
'contextPanel.browser.forward': 'Suivant',
|
||||
'contextPanel.browser.reload': 'Recharger',
|
||||
'contextPanel.browser.hardReload': 'Recharger en ignorant le cache',
|
||||
'contextPanel.browser.zoomIn': 'Zoom avant',
|
||||
'contextPanel.browser.zoomOut': 'Zoom arrière',
|
||||
'contextPanel.browser.zoomReset': 'Réinitialiser le zoom',
|
||||
'contextPanel.browser.clearCookies': 'Effacer les cookies',
|
||||
'contextPanel.browser.clearCache': 'Vider le cache',
|
||||
'contextPanel.browser.clearedCookies': 'Cookies effacés',
|
||||
'contextPanel.browser.clearedCache': 'Cache vidé',
|
||||
'contextPanel.browser.clearFailed': 'Impossible d’effacer les données de navigation',
|
||||
'contextPanel.browser.stop': 'Arrêter',
|
||||
'contextPanel.browser.openExternal': 'Ouvrir dans le navigateur système',
|
||||
'contextPanel.browser.devTools': 'Ouvrir les DevTools',
|
||||
'contextPanel.browser.deviceToolbar': 'Barre d’appareils',
|
||||
'contextPanel.browser.device.preset': 'Préréglage d’appareil',
|
||||
'contextPanel.browser.device.responsive': 'Adaptatif',
|
||||
'contextPanel.browser.device.width': 'Largeur du viewport',
|
||||
'contextPanel.browser.device.height': 'Hauteur du viewport',
|
||||
'contextPanel.browser.device.rotate': 'Pivoter',
|
||||
'contextPanel.browser.device.schemeSystem': 'Auto',
|
||||
'contextPanel.browser.device.schemeLight': 'Clair',
|
||||
'contextPanel.browser.device.schemeDark': 'Sombre',
|
||||
'contextPanel.browser.device.schemeFailed': 'Impossible de changer l’apparence de la page',
|
||||
'contextPanel.browser.frameTitle': 'Navigateur',
|
||||
'contextPanel.browser.loadFailed': 'Impossible de charger cette page',
|
||||
'contextPanel.browser.waitingForServer': 'En attente du serveur de développement',
|
||||
'contextPanel.browser.waitingForServerHint': 'Il n’accepte pas encore de connexions. La page se chargera dès que ce sera le cas.',
|
||||
'contextPanel.browser.tunnelFailed': 'Ce serveur de dev n’a pas pu être atteint',
|
||||
'contextPanel.browser.tunnelFailedHint': '{url} tourne sur la machine où se trouve OpenChamber, et la connexion vers elle n’a pas pu être ouverte. Rien de votre propre machine n’est affiché ici.',
|
||||
'contextPanel.browser.loadFailedUnknown': 'La page n’a pas pu être atteinte.',
|
||||
'contextPanel.browser.crashed': 'Cette page ne répond plus',
|
||||
'contextPanel.browser.crashedHint': 'La page a planté plusieurs fois de suite. Rechargez pour réessayer.',
|
||||
'contextPanel.browser.devServers.title': 'Serveurs de développement actifs',
|
||||
'projectActions.toast.multipleServers': 'Plusieurs serveurs ont démarré — choisissez-en un dans le panneau navigateur',
|
||||
'contextPanel.browser.devServers.justStarted': 'Démarrés à l’instant',
|
||||
'contextPanel.browser.devServers.unavailable': 'Impossible de vérifier les serveurs de développement actifs.',
|
||||
'contextPanel.browser.devServers.remoteOnly': 'Ils tournent sur la machine qui héberge OpenChamber. Les ouvrir nécessite l’application de bureau.',
|
||||
'contextPanel.browser.annotate.toggle': 'Annoter la page',
|
||||
'contextPanel.browser.annotate.intro': 'Ceci est une sélection annotée du navigateur intégré.',
|
||||
'contextPanel.browser.annotate.attached': 'Annotation jointe à la discussion',
|
||||
'contextPanel.browser.annotate.noSession': 'Ouvrez une session de discussion avant de joindre une annotation',
|
||||
'contextPanel.browser.annotate.noPage': 'Chargez une page avant d’annoter',
|
||||
'contextPanel.browser.annotate.failed': 'Impossible d’annoter cette page',
|
||||
'contextPanel.browser.annotate.tool.element': 'Élément',
|
||||
'contextPanel.browser.annotate.tool.region': 'Zone',
|
||||
'contextPanel.browser.annotate.tool.draw': 'Dessin',
|
||||
'contextPanel.browser.annotate.commentPlaceholder': 'Décrivez le changement...',
|
||||
'contextPanel.browser.annotate.submit': 'Joindre',
|
||||
'contextPanel.browser.trustNotice': 'Les pages ouvertes ici s’exécutent avec un accès complet à OpenChamber — nécessaire pour l’inspection et les captures d’écran. N’ouvrez que des sites de confiance : une page malveillante pourrait lire vos données ou agir en votre nom.',
|
||||
'filesView.diagram.closeDiagramView': 'Fermer la vue diagramme',
|
||||
'filesView.diagram.saveDiagram': 'Enregistrer le diagramme',
|
||||
|
||||
Reference in New Issue
Block a user