mirror of
https://github.com/readest/readest.git
synced 2026-11-30 03:13:39 +00:00
1 commit
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
32c42100d0
|
feat(linux): debug the CEF build over CDP, and three fixes it found (#6087)
* feat(linux): debug the CEF build over the DevTools protocol The Linux CEF runtime is Chromium, so the app window is a normal CDP target — the only way to inspect the running desktop app on Linux, since WebKitWebDriver (pnpm tauri:dev:test) drives the wry runtime instead. `READEST_CDP_PORT=9222` passes the port to CEF as `--remote-debugging-port` through the runtime's command-line args. CEF honours that switch straight off argv too, but tauri-plugin-cli parses the same argv for open-with paths and warns about the unknown argument on every launch, so the env var is the supported way in. It works on any CEF build — a packaged .deb or the Flatpak, not just `pnpm tauri:dev:cdp`. scripts/cdp.mjs is the client, dependency-free (node's global fetch and WebSocket): `pnpm cdp <targets|eval|click|screenshot|logs>`. The endpoint listens on loopback only. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * fix(desktop): open the first window at 1280x800 macOS has always opened at 1280x800; Windows and Linux opened at 800x600, which is cramped for the library grid and a two-page spread. Give every desktop platform the same default, and clamp it to 90% of the monitor's work area so it cannot open partly off-screen on a 1366x768 laptop — a window whose title bar lands past the bottom edge can be impossible to resize back. An unreported or empty work area keeps the default: a window that is too large stays reachable, one sized from a bogus zero-height screen does not. Only the first launch is affected; later ones restore the saved geometry through tauri_plugin_window_state. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * fix(opds): size the add catalog dialog like the catalog manager The Add/Edit Catalog form took daisyUI's bare `modal-box` default: 512x889 against the 640x756 manager it opens on top of, so it sat narrower than the window behind it and ran 89px off the bottom of a 1280x800 window, putting its Cancel / Add Catalog row out of reach. Both now size from one exported class string, so they cannot drift apart again. `sm:max-h-full sm:max-w-full` is what defeats daisyUI's own max-w-lg and max-height caps; everything is sm:-prefixed, leaving each dialog's mobile treatment alone. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * fix(library): stop the native scrollbar flashing before OverlayScrollbars Reloading the library showed the platform scrollbar for ~1.8s and then lost it, shifting the grid 15px sideways as it went. Virtuoso owns the scroller inside the OverlayScrollbars root and gives it `overflow-y: auto` inline, so the native scrollbar paints for as long as OverlayScrollbars' deferred init takes, then vanishes when OS marks that same element `data-overlayscrollbars-viewport="scrollbarHidden ..."`. OverlayScrollbars ships hiding rules for `[data-overlayscrollbars-initialize]`, but that attribute sits on the root we hand it, never on the child that actually scrolls. Extend the same pre-init convention to the scroller child. Keyed on attributes Virtuoso and OS already set, so it also covers the reader sidebar's TOC and book-note lists, and `:not([data-overlayscrollbars])` scopes it to the pre-init window — once OS owns the root, its own viewport styling takes over. It lives in globals.css so it is there at first paint, unlike the overlayscrollbars.css import inside the component chunk. Measured on reload: scroller gutter went 0 -> 15 -> 0 before, and stays 0 throughout after. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * fix(cdp): clear the request timeout so the client exits when it is done Every send() armed a 30s timer and nothing cleared it when the reply arrived. A pending timer keeps node's event loop alive, so `pnpm cdp eval` printed its answer and then sat there until the timer fired — 30.1s for a command whose work took 0.1s. Clear it on reply, and drop the pending entry when it does fire. Measured against a stub CDP endpoint: `eval` went from 30.143s to 0.124s, and a server that never answers still rejects with "timed out" at 30.1s. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> |