Skip to content

Load tmuxp's example catalog through the workspace loader - #102

Merged
tony merged 2 commits into
masterfrom
feat/tmuxp-example-catalog
Nov 8, 2026
Merged

tony merged 2 commits into
masterfrom
feat/tmuxp-example-catalog

Conversation

@tony

@tony tony commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Summary

libtmux.org shows a preset picker on a port's Workspace Manager pages only when the port's repository loads more than one workspace file in a test. This port loaded one. This PR adds tmuxp's example catalog as fixtures under test/fixtures/tmuxp/, with tmuxp's MIT license, copied from libtmux-rs at ab33c91, and loads every file through LibTmux::Workspace.load in test/unit/workspace_test.rb, as Rust's every_tmuxp_example_parses does. Nothing in the loader changes.

Nine of the 23 files load. The other 14 are kept and recorded with the exact error the loader raises, so a loader change fails the case until the entry is updated or removed. A catalog file in neither list also fails, so a new tmuxp example gets classified.

Closes #101
Part of libtmux/docs#282

Findings: files the loader refuses

File Error (LibTmux::Workspace::ConfigError)
2-pane-synchronized.yaml invalid workspace configuration at $.windows[0]; expected supported data-only fields; move callbacks or hooks into explicit application code
blank-panes.yaml invalid workspace configuration at $.windows[0].panes[0]; expected configuration object
env-variables.yaml invalid workspace configuration at $.before_script; expected supported data-only fields; move callbacks or hooks into explicit application code
main-pane-height-percentage.yaml invalid workspace configuration at $.windows[0].options.main-pane-height; expected integer index from zero through 2147483647
minimal.yaml invalid workspace configuration at $.windows[0].window_name; expected window name
options.yaml invalid workspace configuration at $; expected supported data-only fields; move callbacks or hooks into explicit application code
pane-shell.yaml invalid workspace configuration at $.windows[0]; expected supported data-only fields; move callbacks or hooks into explicit application code
plugin-system.yaml invalid workspace configuration at $.plugins; expected supported data-only fields; move callbacks or hooks into explicit application code
skip-send-pane-level.yaml invalid workspace configuration at $.windows[0].window_name; expected window name
skip-send.yaml invalid workspace configuration at $.windows[0].window_name; expected window name
sleep-pane-level.yaml invalid workspace configuration at $.windows[0].window_name; expected window name
sleep-virtualenv.yaml invalid workspace configuration at $.shell_command_before; expected UTF-8 text
sleep.yaml invalid workspace configuration at $.windows[0].window_name; expected window name
suppress-history.yaml invalid workspace configuration at $; expected supported data-only fields; move callbacks or hooks into explicit application code

main-pane-height.yaml, start-directory.yaml and focus-window-and-panes.yaml load, but the docs support table marks them unsupported because the loader reads their ~ paths and bare pane entries differently from tmuxp. The docs generator refuses to show them until that table agrees.

Test plan

  • bundle exec ruby test/unit/workspace_test.rb
  • bundle exec scripts/check mid
  • Changing a recorded message and removing a loaded file from its list each fail the test
  • The docs generator (scripts/gen-workspace-showcase.mjs) run at libtmux/docs main with the port pinned to this branch lists seven examples for ruby, six of them tmuxp's files, each tested by test_tmuxp_examples_load_through_workspace_load
  • CI

tony added 2 commits November 8, 2026 06:44
why: libtmux.org shows a preset picker on a port's Workspace Manager
pages only when the port's repository loads more than one workspace
file in a test. This port loaded one, so its pages showed a single
example. Rust loads tmuxp's example catalog, and the docs read the files
a test loads.

what:
- Add tmuxp's 23 example files and its MIT license under
  `test/fixtures/tmuxp/`, copied from libtmux-rs at ab33c91add4c
- Load each of the 9 files `Workspace.load` reads and check its profile
  (`test/unit/workspace_test.rb`)
- Record the exact `ConfigError` message of each of the 14 files the
  loader refuses, so a change in the loader fails the case until the
  entry is updated or removed
- Fail when a catalog file is in neither list, so a new tmuxp example is
  classified instead of skipped
why: The catalog fixtures change what the docs site shows for the
workspace loader, and no gem changelog owns a test-only change.

what:
- Add an unreleased entry to the root changelog (`CHANGELOG.md`)
@tony
tony deployed to docs-preview November 8, 2026 12:52 — with GitHub Actions Active
@tony
tony merged commit 9e1fbe1 into master Nov 8, 2026
14 checks passed
@tony
tony deployed to docs-preview-cleanup November 8, 2026 13:25 — with GitHub Actions Active

This branch was successfully deployed

2 active deployments
docs-preview-cleanup — 447096b5 Deployed Nov 8, 2026 by tony via cleanup #72
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.

Load tmuxp's example catalog so the docs show the preset picker

1 participant