feat(browser): device-mode viewports and keyboard shortcuts - #11
Merged
Conversation
Viewports / device modes (REQ-025): - Add DevicePreset catalog (iPhone SE/14 Pro, Pixel 7, iPad Mini/Pro, Laptop, Desktop HD) plus fit-to-window and custom W×H in shared events. - Resize the active page WebContentsView to the selected device box, centered under the chrome, and drive CDP Emulation on the active tab: setDeviceMetricsOverride (DPR, mobile), setTouchEmulationEnabled, and setUserAgentOverride for mobile presets. Emulation follows the active tab and is re-applied after a full navigation resets the overrides. - Portrait/landscape swap and a clamp warning when the box exceeds the window (Chromium cannot scale the surface, so oversized presets cap at the window size). - New ViewportChip selector in the toolbar replaces the static resolution chip; reuses chromeExpand so its menu floats over the page. Keyboard shortcuts (REQ-026), via before-input-event on chrome, overlay and every page webContents so they fire regardless of focus: - Ctrl+R / F5 reload, Ctrl+Shift+R hard reload - Ctrl+T new tab, Ctrl+W close tab, Ctrl+Tab / Ctrl+Shift+Tab cycle, Ctrl+1-8 select tab, Ctrl+9 last tab - Ctrl+L / Alt+D focus address bar (main → chrome focusAddress channel) - Ctrl+D bookmark toggle, Ctrl+B bookmarks bar, Ctrl+Shift+O overlay, Ctrl+P print active page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Qué
Dos features de v1.
Viewports / device modes (REQ-025)
WebContentsViewde la página activa al box del device (centrado bajo el chrome) y aplica CDP Emulation en la pestaña activa:setDeviceMetricsOverride(DPR, mobile),setTouchEmulationEnabled,setUserAgentOverride(UA móvil en presets touch).chromeExpandpara que el menú flote sobre la página.Atajos de teclado (REQ-026)
Vía
before-input-eventen chrome, overlay y cada página → responden con el foco donde sea.Ctrl+R/F5Ctrl+Shift+RCtrl+TCtrl+WCtrl+Tab/Ctrl+Shift+TabCtrl+1–8/Ctrl+9Ctrl+L/Alt+DCtrl+DCtrl+BCtrl+Shift+OCtrl+PVerificación
npm run typecheck✅npm run build✅Pendiente (follow-up)
Ctrl+Ffind-in-page (necesita find bar propia +webContents.findInPage).