opencode-vim-navigation 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -5
- package/package.json +3 -3
- package/src/{tui.tsx → tui.mjs} +14 -9
- package/tui.ts +1 -1
package/README.md
CHANGED
|
@@ -14,7 +14,9 @@ not a server plugin or a plugin for the desktop/web UI. Older releases and
|
|
|
14
14
|
future API changes may require adaptation.
|
|
15
15
|
|
|
16
16
|
No build step is needed: OpenCode supplies `@opencode/plugin/tui`, OpenTUI,
|
|
17
|
-
and `solid-js
|
|
17
|
+
and `solid-js`. The adapter is plain JavaScript and constructs OpenTUI elements
|
|
18
|
+
without JSX, avoiding different JSX transforms for local and npm installs.
|
|
19
|
+
OpenTUI and Solid are declared
|
|
18
20
|
as peer dependencies so the package documents its host compatibility.
|
|
19
21
|
Do not run this entrypoint directly with Node.js.
|
|
20
22
|
|
|
@@ -116,14 +118,14 @@ npm pack --dry-run
|
|
|
116
118
|
```
|
|
117
119
|
|
|
118
120
|
There are no development dependencies to install. `npm run check` checks the
|
|
119
|
-
JavaScript controller and tests
|
|
120
|
-
|
|
121
|
+
JavaScript controller, TUI adapter, and tests. OpenCode loads the small
|
|
122
|
+
TypeScript entrypoint; the adapter itself is native JavaScript, without JSX.
|
|
121
123
|
|
|
122
124
|
```text
|
|
123
125
|
tui.ts Conventional local/package entrypoint
|
|
124
126
|
src/
|
|
125
127
|
navigation.mjs Mode state and input routing
|
|
126
|
-
tui.
|
|
128
|
+
tui.mjs OpenCode adapter and mode indicator (no JSX)
|
|
127
129
|
tests/
|
|
128
130
|
navigation.test.mjs Controller tests using node:test
|
|
129
131
|
```
|
|
@@ -135,11 +137,15 @@ They do not replace interactive rendering tests.
|
|
|
135
137
|
The initial implementation also passed a live pseudo-terminal smoke test
|
|
136
138
|
against OpenCode 2.1.4: INPUT/NAV switched, navigation changed the viewport,
|
|
137
139
|
and returning to INPUT preserved the draft, without submitting any prompt.
|
|
140
|
+
The 0.1.2 packaging fix was additionally tested through OpenCode's **npm
|
|
141
|
+
package loader**, using a temporary local registry serving the packed archive:
|
|
142
|
+
installation, INPUT/NAV switching, scrolling, and draft preservation passed.
|
|
143
|
+
This exercises the package-loading path rather than a source-directory install.
|
|
138
144
|
Recheck the same behavior after changing the adapter or upgrading OpenCode.
|
|
139
145
|
|
|
140
146
|
### Implementation details
|
|
141
147
|
|
|
142
|
-
The root `tui.ts` re-exports `src/tui.
|
|
148
|
+
The root `tui.ts` re-exports `src/tui.mjs`. OpenCode 2.1.4's local-directory
|
|
143
149
|
loader looks for a conventional root `tui` entrypoint; npm packages also
|
|
144
150
|
expose it via the `./tui` package export. Keep both when reorganizing source.
|
|
145
151
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-vim-navigation",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Modal Vim-style transcript navigation for the OpenCode terminal UI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Raaghav Arya",
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"@opentui/core": ">=0.6.8 <0.7.0",
|
|
27
27
|
"@opentui/solid": ">=0.6.8 <0.7.0",
|
|
28
|
-
"solid-js": "^1.9.
|
|
28
|
+
"solid-js": "^1.9.12"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
31
|
"test": "node --test tests/*.test.mjs",
|
|
32
|
-
"check": "node --check src/navigation.mjs && node --check tests/navigation.test.mjs",
|
|
32
|
+
"check": "node --check src/navigation.mjs && node --check src/tui.mjs && node --check tests/navigation.test.mjs",
|
|
33
33
|
"prepublishOnly": "npm test && npm run check"
|
|
34
34
|
}
|
|
35
35
|
}
|
package/src/{tui.tsx → tui.mjs}
RENAMED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Plugin } from "@opencode/plugin/tui"
|
|
2
2
|
import { InputRenderable, TextareaRenderable } from "@opentui/core"
|
|
3
|
+
import { createElement, spread } from "@opentui/solid"
|
|
3
4
|
import { createEffect, createRoot, createSignal } from "solid-js"
|
|
4
5
|
import { navigation } from "./navigation.mjs"
|
|
5
6
|
|
|
@@ -47,15 +48,19 @@ export default Plugin.define({
|
|
|
47
48
|
})
|
|
48
49
|
const removeStatus = ui.slot({
|
|
49
50
|
append: "session.composer.top",
|
|
50
|
-
render: () =>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
51
|
+
render: () => {
|
|
52
|
+
const element = createElement("box")
|
|
53
|
+
spread(element, {
|
|
54
|
+
height: 1,
|
|
55
|
+
width: "100%",
|
|
56
|
+
border: ["top"],
|
|
57
|
+
get borderColor() { return context.theme.border.base },
|
|
58
|
+
get title() { return nav() ? " NAV · i: input " : " INPUT · Ctrl+Q: navigate " },
|
|
59
|
+
get titleColor() { return nav() ? context.theme.text.base : context.theme.text.muted },
|
|
60
|
+
titleAlignment: "right",
|
|
61
|
+
})
|
|
62
|
+
return element
|
|
63
|
+
},
|
|
59
64
|
})
|
|
60
65
|
return () => {
|
|
61
66
|
renderer.keyInput.removeListener("keypress", controller.key)
|
package/tui.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Conventional entrypoint for OpenCode's local-directory plugin discovery.
|
|
2
|
-
export { default } from "./src/tui.
|
|
2
|
+
export { default } from "./src/tui.mjs"
|