Skip to content

Deck - #1767

Open
Veter1904 wants to merge 70 commits into
unknownskl:main-v2from
Veter1904:deck
Open

Deck#1767
Veter1904 wants to merge 70 commits into
unknownskl:main-v2from
Veter1904:deck

Conversation

@Veter1904

@Veter1904 Veter1904 commented Nov 21, 2026 •

Copy link
Copy Markdown

Greenlight – Steam Deck edition

Changes made while using Greenlight v2 for Xbox remote play on a Steam Deck. A ready-to-install Flatpak is published on every push to deck in the Releases of the fork. Full description (English + Українською): DECK.md.

What it adds

  • Gamepad navigation of the whole app and a gamepad driver that merges several pads into one; LB + RB + View + Menu (1 s) opens the Greenlight menu during a stream.
  • Console-style UI with realistic Xbox Series X / S pictures and power-state glow.
  • Screen text translator (Settings → Translator): free, no API keys. Tesseract OCR is bundled and runs offline in the renderer; the recognized text (not pictures) goes to Google's public endpoint with MyMemory as a fallback, via the main process (app.translateText).
    • The translation window is placed with the mouse / touch or with the gamepad (LB + RB + X; LB + RB + Y toggles the translator).
    • Line-by-line translation drawn over the original with matching size, position and background colour.
    • No repeated work: a jitter-tolerant "text pixels" comparison, fuzzy matching of reading errors, number-only changes (counters) reuse the old translation, caching, and hiding while the camera moves for text that lives in the game world.
  • Keyboard and mouse as a gamepad (Settings → Input, off by default).
  • Per-console remote port (Settings → Streaming) for several consoles behind one router.
  • Fix: changing a setting during a stream no longer closes the stream (the stream page effect depended on the settings).
  • Flatpak build + update script (.github/workflows/deck-build.yml, packages/desktop/flatpak/update-greenlight.sh): same app id as the Flathub build, settings are kept, SHA-256 verified download, HTTPS only. Workflow actions are pinned to commit hashes.

Install on a Steam Deck

curl -fsSL --proto '=https' --tlsv1.2 https://github.com/Veter1904/greenlight/releases/latest/download/update-greenlight.sh | bash

Notes

  • This is a large change set (it grew out of daily use), so it is probably easiest to take in pieces. Happy to split it into smaller pull requests if that helps.
  • Developed and used on a Steam Deck with Xbox consoles; the Flatpak build is the supported target, other platforms (e.g. macOS) are untested.

Veter1904 and others added 6 commits November 20, 2026 14:44
…eck build

- Remote play: configurable public port (global default + per console) instead of the hardcoded 9002,
  so two consoles can be forwarded on different router ports.
- Gamepad driver: merge all real controllers into one stable gamepad 0 (fixes input being ignored when
  the Deck controls and an external controller are both present), ignore non-controller devices,
  route rumble to the active controller, hold LB+RB+View+Menu to open the Greenlight menu.
- Gamepad navigation for the whole UI (d-pad/stick, A, B, LB/RB, LT/RT) and in-app dialogs that
  replace native alert/confirm.
- Flatpak build workflow and an update script that replaces the installed Flatpak in place.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The file is also bundled by the main process webpack config without a TypeScript loader.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…tions) before installing [skip ci]

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… and power state, full-width layout, toggle switches, bottom button hints

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ith a free service, dedupe unchanged text

- tesseract.js (bundled wasm + English data, works offline) reads a user-placed window of the video
- cheap text-pixel mask gates the reader so moving/transparent backgrounds do not retrigger it;
  same text (fuzzy match) is never re-translated, translations are cached
- translation via main process (free Google endpoint, MyMemory fallback), no API keys
- settings page (language, text colour, font size, opacity, window preview), in-stream toggle and
  'Area' editor (mouse/touch drag or gamepad sticks), i18n for 6 languages

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… S with round speaker grille, Xbox One slab, each with its controller

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Comment thread .github/workflows/deck-build.yml Fixed
Comment thread .github/workflows/deck-build.yml Fixed
Comment thread .github/workflows/deck-build.yml Fixed
Comment thread .github/workflows/deck-build.yml Fixed
Comment thread .github/workflows/deck-build.yml Fixed
Comment thread .github/workflows/deck-build.yml Fixed
Comment thread .github/workflows/deck-build.yml Fixed
Veter1904 and others added 6 commits November 21, 2026 17:22
…ize from every corner, independent width/height

- usePadRegion hook: left stick/d-pad moves, right stick changes width and height, LT slow / RT fast, A/B/Menu done
- gamepadState.captured keeps the menu navigation from seeing the press that ends the mode
- RegionEditor has four corner handles

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…sk, jitter-tolerant compare, sticky overlay)

- text pixels = pixels that stand out from their local surroundings, so bright/shaded backgrounds no longer count as 'too much text' or 'no text'
- mask comparison tolerates 1-cell shake from video compression
- translation is hidden only after ~4s without text and never because a single read failed
- text is re-read periodically while shown (different line, same layout), word confidence filter, bigger crop for small interface text

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ayout, auto font and number-aware dedupe; gamepad shortcuts; keyboard+mouse as gamepad

- stream page: effect no longer re-runs (and closes the player) on every settings change; this was the crash when toggling the translator
- translator: OCR lines/segments, each translated on its own and drawn over the original with sampled background and font size from the original; wrapped sentences are kept together
- numbers that only change (counters, timers) are substituted into the old translation without a request
- driver: LB+RB+Y toggles the translator, LB+RB+X moves its window
- keyboard/mouse emulation of a gamepad (WASD, mouse look, mouse buttons as triggers, keys by physical position), setting in Input

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…readings of the same line, confirm new text, sentence-case caps, single-line boxes

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
….md description

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Comment thread .github/workflows/deck-build.yml Fixed
Veter1904 and others added 16 commits November 22, 2026 11:24
- workflow: default permissions are read-only, write only for the publishing job
- css: remove duplicate font-size
- stream: handle a rejected end-stream confirmation
- header: keyboard handler for the menu links

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
New setting translator_source_lang (default English). The text reader loads the matching Tesseract
language data (English stays bundled, other languages are downloaded once and cached) and the source
language is passed to the translation service. The reader restarts when the language is changed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A resting stick that reads a little off centre made the window creep. Inputs inside a 22% circle are
ignored and the rest of the travel is stretched with a soft start.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- A wrapped paragraph is one piece of text (same size and left edge, the line above reaches the right margin),
  not cut at every capital letter, so it is no longer translated in overlapping fragments.
- Different text where a line is already shown, while the text pixels hardly changed (a living background),
  must be read twice before it replaces the shown text.
- Shorter tick and read gaps.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The statistics panel printed [object Object] for every object-valued statistic. Values are now formatted
(objects as JSON), a short summary (resolution, fps, bit rate, jitter, losses) is shown first and the panel
fits small screens.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…n it cannot be locked

- A hint tells to click the picture (and when the mouse is captured, that Esc releases it).
- Pointer lock is requested on the stream area and its failure is detected; the mouse is then used
  without a lock while it is over the picture.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The player multiplies every mouse movement by a fixed number, which is too fast for many mice. The movement
is now scaled by a setting (Settings > Input > Mouse speed, 10-200%) before the player sees it; fractions are
carried over so slow movements are not lost.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- Every translated line stays on screen for a reading time (about 1.6 s plus 45 ms per character), even when the
  original is already gone; a line that replaces it waits in a queue of up to 3 and the reading time gets shorter
  the more lines wait.
- A single changed picture (a new subtitle) no longer counts as camera movement, so new text is not held back for
  a second reading.
- Changed text is read again after 350 ms instead of waiting for the back-off of text that stays the same.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…xt rows

The reader sometimes joins two rows of text (and the decoration between them) into one line; the translation
then got twice the size of the original. The row height is now measured from the text pixels.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…enu bar by default

- The quit, logout, clear data and end stream questions use the in-app dialog, which the gamepad controls,
  instead of the native confirm window.
- The Alt key shows the File / Edit / View / Window menu bar only when 'Alt key opens the menu bar' is on
  (Settings > Input); the shortcuts of the menu keep working.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- confirmDialog promises get a catch handler.
- The statistics of the debug panel are sorted with a compare function.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…tches in the game menu

- Settings > Translator: add / remove windows (max 3), turn each on or off, choose its kind (subtitles or tasks).
  Windows slide along each other and cannot overlap, with the mouse, sliders or the gamepad.
- Game menu: one button per window to turn it on or off; in the placement mode X = next window,
  Y = new window, View = remove the window.
- A 'tasks' window is not hidden while the camera sways the interface, reads about once a second and a different
  reading has to be seen twice before it replaces the shown translation.
- Icons read as letters (OO / QO) in front of a line are dropped.
- 24 hour clock; the quit button of the header can be reached with the gamepad.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- Setting Video > Fullscreen (auto / always / window). Auto = fullscreen in the game mode of the Steam Deck, so the
  window fills the built-in 1280x800 screen or a docked 1920x1080 one; the window follows a changed screen.
  The current screen size is shown next to the setting.
- Setting Input > Vibration strength: scales what the game asks the controller to do.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- Translator: the picture is looked at less often while no text is on screen or the text stays the same,
  windows that are off sleep, a big window (the whole screen) is read at a smaller size, and text that stays the
  same is read again less often.
- Gamepad navigation polls 25 times a second instead of 60 while the pad rests.
- The debug statistics (copied and redrew about 1200 values 30 times a second) are only collected while the panel is open.
- Queued subtitle lines are shown in the order they were read.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ier text size

The window is watched often and cheaply (150 ms while something happens, slower when idle). When a new line has settled
(coarse text mask plus a column profile of the ink), a snapshot of the window is taken and put into a short,
memory-bounded line for the reader, which reads, translates and shows them in order. Reading and watching no longer
block each other. Near copies of a waiting snapshot replace it, the oldest goes when the line is full, and snapshots
are freed after use. The check against misreads in place also looks at the profile, so a new subtitle that looks
similar is not thrown away. Motion detection keeps its memory between looks. The display queue is longer and shortens
the reading time under a backlog. The height of the text is capped by the height of the words, so two joined rows do
not double the size of the translation.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A line that was not found for a couple of reads, or a subtitle when the camera cuts, is no longer taken off the screen
before its reading time is over; the reading time is longer (2.2 s plus 60 ms per character).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Veter1904 and others added 28 commits November 23, 2026 23:40
…anel-sized windows

- Auto reads the whole screen as one window by itself in menus; a settings switch forces it. Windows 1-3 keep working then.
- Profile: places where translating worked at least twice are kept per console/game and trusted at once next run (coordinates only).
- Scout finds the panel a text sits on; Auto gives a window the size of the panel and the translation wraps inside it (switch in settings).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ervices stay

- Main: translator keeps Google (gtx) + MyMemory with pauses for a failing service; no key, usage, status or test code.
- Renderer: key card, key watcher and key settings removed; Settings: an old key is wiped from the settings file on load.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ound), minimum score for blocks, page layout for whole-screen reading

Found from a photo of the screen: at 720 px the description of an item (9 px rows) is not found, at 1280 px it is.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… a window at once, no error after the stream is closed

- Whole-screen reading: tiles from the scout blocks (each enlarged like a window), small changes in the pixels start a new reading, new text gets its second look soon.
- A subtitle takes the window of a text that was not read, else the longest-standing edge text.
- Text reader: after it is shut down nothing reads and no new reader is made (the 'postMessage of null' error at exit).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… by default; subtitle windows rest in menus

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…itches folded behind Advanced, intro rewritten

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…m, windows come back and the menu is not tried again for a while; debug badge shows the mode

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…he unfolded row; DECK.md notes

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… finds text; until then the windows work as usual

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…task line or a subtitle is not a menu)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… are joined, so tabs and short labels are read too

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ds ...), stray icon letters before a label are ignored

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…opped to a full read), lines of a menu survive more missed reads

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…anced): each piece of text is an element with a memory, read once and again only when its pixels change; menus need no mode

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…nu, new scene); original text is painted over under the translation (switch in settings)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…or short readings), wider paint-over plate

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…thin and faint menus), rows of a list are never mistaken for one element

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…he banner of a tutorial was skipped)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… s with every update, so after a pause the last effect buzzed for seconds)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… stop at once (the console sends 80-100 states a second and the controller queue made the buzz inert)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e phrase

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… to 1280 when slow), a reading that covers little of its place is not accepted at once

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ge stopped for ~35 ms every second, the camera dragged); ink masks in their own module

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…slices with pauses for the page; the scan copies the frame and reads it in two tasks

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…the app crashed on start in Desktop Mode, a Wayland session)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ps an uncatchable error and never settles the reading): no error when leaving a stream, the reader is not blocked

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
B Security Rating on New Code (required ≥ A)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants