Skip to content

md-preview draws in a pane-grid cell - #180

Merged
hamzafer merged 4 commits into
hamzafer:mainfrom
hwanyong:pane-grid-cell
Nov 14, 2026
Merged

hamzafer merged 4 commits into
hamzafer:mainfrom
hwanyong:pane-grid-cell

Conversation

@hwanyong

Copy link
Copy Markdown
Contributor

pane-grid (https://github.com/hwanyong/pane-grid) lays several mods out in one pane, tmux style. With this change md-preview offers itself in an empty pane-grid cell and draws there after /grid place md-preview; its own pane closes while it is placed and comes back on /grid place -.

mods/md-preview/hooks/pane-grid.ts is a copy of pane-grid's member module. The layout read stays in register.tsx because validate follows $ only into functions declared in the same file (engine 2.1.288).

Without pane-grid installed every read is undefined and md-preview behaves as before. The CI commands of ci.yml pass on 2.1.288 and 2.1.322 with no new failures (the one prayer-times failure is also on main).

🤖 Generated with Claude Code

https://claude.ai/code/session_01BQMofooE8cXDucdXKMU7ai

hwanyong and others added 4 commits November 10, 2026 15:57
md-preview 0.1.10 joins pane-grid (https://github.com/hwanyong/pane-grid), which splits a Claude Code pane into cells and places grid-ready mods in them. hooks/pane-grid.ts is pane-grid's reading module, without the parts md-preview does not use. A ui.render hook on grid panes lists md-preview in empty cells and draws the pane's content in its cell, at the cell's width. A state.set hook on pane-grid's layout closes the Markdown pane while md-preview is placed and opens it again when the cell is emptied. /md names the cell instead of opening the pane, and drawing ahead and redrawing follow the grid pane of the cell. In a cell, the hotkeys are drawn only while the cell is the active one and leave out pane-grid's toolbar letters (b, o, q); Close is not drawn. The button row wraps when the pane or cell is narrower than it. Without pane-grid installed every read is undefined and md-preview behaves as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQMofrkjA7Lnry7bMQuxh3
Claude Code before 2.1.299 follows $ only into functions of the module's own file, so on 2.1.288, the version CI runs, the hooks module did not load: readPlacement($) was imported from hooks/pane-grid.ts. register.tsx now reads pane-grid's layout itself and imports only placementIn, the shape pane-grid's guide gives mods that support older engines; readPlacement is gone from hooks/pane-grid.ts. Validate and the 36 tests pass on 2.1.288 and 2.1.322.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQMofrkjA7Lnry7bMQuxh3
From Claude Code 2.1.325 a hook matcher without plugin matches only what the registering mod opened, and pane-grid opens every grid pane, so md-preview grid ui.render hook was never called and its cell drew "is not loaded". The matcher now names plugin: pane-grid. Checked on 2.1.325 in a fresh session. Version 0.1.10 to 0.1.11 in mods/md-preview/.claude-plugin/plugin.json and .claude-plugin/marketplace.json so claude plugin update fetches it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQMofqcL6vSmmar4Kr9BDa
@hamzafer
hamzafer merged commit bddca92 into hamzafer:main Nov 14, 2026
2 checks passed
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