Skip to content

Refactor 1/6: groundwork for the restructure - #96

Merged
seaweeduk merged 1 commit into
masterfrom
refactor/wave-0
Nov 22, 2026
Merged

seaweeduk merged 1 commit into
masterfrom
refactor/wave-0

Conversation

@seaweeduk

Copy link
Copy Markdown
Owner

First layer of the structural refactor: groundwork that the later layers build on. Nothing changes for users.

Steps in this layer: P0-2, P0-3, P0-4.

  • P0-2: the menu can be laid out and drawn without a GPU. CairoCanvas gets a surface-only init(width, height, scale), and Menu gets init() without an Uploader, layOut(), draw(PanelId, cairo_t*) and working(). The app's path is unchanged: with an uploader, each canvas makes the same call as before.

  • P0-3: dead code removed (225 lines): the old focus hold reasons and the FocusController::State fields only they read, five strings with no reader in all seven languages, MenuView::panelBase, three unused row helpers and the linear accent, GestureMap::hasGesture, FolderListing::matchCount, StashImages::diskUsage, serverKindOf.

  • P0-4: smaller headers. Pure moves, so a change rebuilds fewer files:

    New header Holds Was in
    app_dirs.h configDir(), dataDir(), cacheDir() settings.h
    foveation_level.h FoveationLevel and its helpers foveation.h
    playback_state.h PlaybackState, Track, Chapter video_player.h
    eye_state.h EyeMatrices, GazeState xr_context.h
    control_map.h ControlMap, GestureMap controls.h
    menu_view.h MenuView, ScreenView, ControlsView menu.h

    value_ranges.h now owns the numeric limits that it used to read from video_memory.h, flat_screen.h and script_player.h, and those three include it instead.

Before After
Project-header lines per source file (average) 4,010 3,573
Source files reaching video_player.h 48 3
… foveation.h 78 13
… controls.h / menu_command.h 73 53
… video_memory.h 79 57

Known and left as is

  • The surface-only Menu::layOut() returns setup rows but does not run the app's button finalisation. A headless setup draw is not a pixel-for-pixel preview of the live panel.
  • Menu::working() is not a barrier for all async UI work. Folder metadata and setup replies can land later, and hint artwork is collected by drawHint(). The app still uses the uploader-backed path.

Important

AI disclosure

Model Variant Role
anthropic/claude-opus-5-5 high Implementation, orchestration
openai/gpt-6.2-astra high Independent review

Agent harness OpenCode 2.3.2

@seaweeduk seaweeduk added the skip-changelog Left out of release notes label Nov 22, 2026
@opencode-agent

Copy link
Copy Markdown
  1. Low — A surface-only canvas can report a GPU texture (src/cairo_canvas.cpp:136–140). After Menu::init() without an uploader, startSetup() draws the Welcome page through SetupPages::drawBand(), which calls finishUpdate(). That sets uploaded_ = true, so texture(kSetup) returns a non-null Texture even though its Vulkan image and view are null. The next full setup redraw also treats that pointer as a previously published image and switches to drawing one band at a time. Set uploaded_ = (uploader_ != nullptr) in finishUpdate() so surface-only canvases keep the documented nullptr result.

github run

@seaweeduk

Copy link
Copy Markdown
Owner Author

Already fixed higher in the stack. #99 (Refactor 4/6) changes CairoCanvas::finishUpdate() to if (uploader_) uploaded_ = true;, which is exactly this fix. Its description lists it under the wave 0 review fixes. In this layer the surface-only path has no caller in the app.

@seaweeduk
seaweeduk force-pushed the fix/free-decoder-from-steam branch from 22680ca to 0c86ba5 Compare November 22, 2026 20:58
@seaweeduk
seaweeduk changed the base branch from fix/free-decoder-from-steam to master November 22, 2026 20:58
@seaweeduk
seaweeduk merged commit 82427e0 into master Nov 22, 2026
@seaweeduk
seaweeduk deleted the refactor/wave-0 branch November 22, 2026 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Left out of release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant