Context
We are building hunk-guide using a right-side pane registered through the public extension API. The guide pane and the built-in hunk:files pane need independent state, but their visibility is currently coupled through Hunk's shared sidebar area.
docs/extensions.md notes that opening a left or right pane reveals the sidebar area. In practice:
- Calling
ctx.panes.open("guide") reveals the entire sidebar area. If hunk:files on the left was logically open but responsively hidden, opening the right guide pane reveals both the left files pane and the right guide pane.
ctx.panes.isOpen("guide") reports logical open preference rather than whether the pane is currently rendered. Consequently, a toggle command can appear to do nothing on the first press, then reveal both panes.
- Programmatically closing or opening
hunk:files as a workaround mutates unrelated pane state and violates pane independence.
This blocks implementing a guide/plain-diff toggle that leaves the files pane exactly as the user set it.
Minimal snippet
import type { HunkExtensionAPI } from "hunkdiff/extension";
export default function (hunk: HunkExtensionAPI) {
hunk.registerPane({
id: "guide",
title: "Guide",
placement: "right",
component: GuidePane,
});
hunk.registerCommand(
{ id: "toggle", title: "Toggle Guide" },
(ctx) => {
if (ctx.panes.isOpen("guide")) {
ctx.panes.close("guide");
} else {
ctx.panes.open("guide");
}
}
);
}
Request
- A public way to reveal or toggle one vertical pane edge without revealing panes on the opposite edge.
- A public way to distinguish logical open state from current rendered visibility.
Context
We are building
hunk-guideusing a right-side pane registered through the public extension API. The guide pane and the built-inhunk:filespane need independent state, but their visibility is currently coupled through Hunk's shared sidebar area.docs/extensions.mdnotes that opening a left or right pane reveals the sidebar area. In practice:ctx.panes.open("guide")reveals the entire sidebar area. Ifhunk:fileson the left was logically open but responsively hidden, opening the right guide pane reveals both the left files pane and the right guide pane.ctx.panes.isOpen("guide")reports logical open preference rather than whether the pane is currently rendered. Consequently, a toggle command can appear to do nothing on the first press, then reveal both panes.hunk:filesas a workaround mutates unrelated pane state and violates pane independence.This blocks implementing a guide/plain-diff toggle that leaves the files pane exactly as the user set it.
Minimal snippet
Request