Repository navigation
md-preview draws in a pane-grid cell - #180
Merged
Merged
Conversation
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
…e when the grid is closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.tsis a copy of pane-grid's member module. The layout read stays inregister.tsxbecause 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.ymlpass 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