Skip to content

Conversation

@ndarilek
Copy link

This gets most of Paperback running under Linux, either directly on Nix via nix run, or via Flatpak standalone bundles attached to each PR/release.

What doesn't work?

  • The ToC tree view is entirely inaccessible, I suspect due to WX's TreeView not being accessible under GTK3. It is still keyboard-navigable, but the widget isn't presented nor are any events related to it.
  • Individual keyboard commands like "h" in the document area output a terminal bell and do nothing. My suspicion is that GTK read-only TextViews block anything that looks like text input, that or either WX adds something.

Even with these limitations, having something I can throw just about any document I might want to read at under Linux and get back an accessible version is something I was going to write myself 6 months ago, so thanks for saving me the trouble! I think this is very useful even in its current form.

Followup

Additional tasks to pursue once this gets merged--I'm happy to look into them but I'll put them here in case others might be interested:

  • Other packaging options--AppImage at minimum. I'm prioritizing non-distro-specific formats for easier maintenance, though I needed Nix for the development setup so am willing to own that going forward.
  • Publishing on Flathub
  • Investigating whether WX's TreeView can be made accessible under Linux.
  • Adding ctrl to all hotkeys on Linux in the document view to see if that makes them work.

Disclosure

This PR was made largely with the help of Claude Code. As per my usual agentic workflow, I've reviewed every line of this PR. While nothing appears to rm -rf / or exfiltrate the nuclear launch codes, I can't speak to:

  • The quality of the CMake additions
  • The quality of the Flatpak build manifest. It looks good, albeit verbose, but Flatpak manifests kind of ar. I've done Flatpak manifests, but long enough ago that I don't know what current best practices are. But I've confirmed that the Flatpak installs and runs.
  • The C++ changes. -Werror flagged a bunch of issues with my version of GCC, and not having done C++ in a couple decades, I let Claude fix them. At first glance it looks like pedantic style/correctness fixes, and a variable rename to prevent a shadowing-related error, but that's the smallest part of the diff so hopefully should be easy to review.
  • The extracted icons. I needed icons for the .desktop files and Flatpak. Claude claims it extracted and resized the icons from the Windows installer. The description it gives me for the icons it added seems to make sense, but we should probably have someone visually confirm them (or confirm them via your own/someone else's VLLM analysis.)

@trypsynth
Copy link
Owner

Thanks a ton for this! This is a fairly sizable diff and I do have software engineering employment, so my apologies if this takes me a little bit to merge, but thanks a ton for all your work! It does look like CMakeLists has some conflicts, but those should be easy to fix.
FWIW, I have the very same agentic coding workflow. Write a massive prompt, let Claude or Codex cook, review every single line multiple times.

@ndarilek
Copy link
Author

No problem, I'm in no rush here.

FWIW, I'm partway through a fix for the inaccessible TOC tree--creating a tree widget type that either loosely wraps the native WX widget on most platforms, or just uses a GTK TreeView under WXGTK. I can either add that to this branch or to a followup PR--just wanted to let you know I wasn't done. That one will include a pile of C++ though, so it'll probably need closer review.

@ndarilek
Copy link
Author

  • Added missing Nix package dependencies--the package worked because they were in my runtime environment, but this now makes them explicit.
  • Cleaned up issue where Flatpak binary cleanup cleaned up the application binary too--previously worked until a cleanup section consolidation in the manifest.
  • Added required prefix to desktop icons in Flatpak so they're included in the final package.
  • Added documentation to final Nix package and Flatpak.
  • Added small helper function to find documentation. Under Linux this checks FHS paths first--/usr/share/doc/paperback, /usr/local/share/doc/paperback, Flatpak's prefix, etc. The current behavior is the default Linux fallback, and the default on all other platforms. This gets the help documentation loading both internally and in external browsers.
  • Removed pulse Flatpak permission--no need for sound yet.
  • Skip fetching submodules in flatpak build. This omits downloading vcpkg since all dependencies are either fetched by flatpak-builder or are already in the runtime.

@ndarilek
Copy link
Author

I just fixed the conflicts between this branch and master.

I also have, on separate branches rebased on this one, fixes for both the inaccessible ToC tree under Linux, as well as a fix for the menu accelerators not working in the text area, including a GTK-based live region implementation. Again, no rush on reviewing any of this--I can run my own branch indefinitely under Nix pretty easily. Just wanted to keep the PR updated as to the state of things.

@trypsynth
Copy link
Owner

Seems I just broke some of your hard work when I merged in my Rust branch. Sorry about that :(

@trypsynth
Copy link
Owner

Also, FWIW, a custom implementation of the tree for linux would be great, we're already going to have to do this for the mac :( wxWidgets really sucks at treeviews on not Windows, I guess.

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