mirror of
https://github.com/anomalyco/opencode.git
synced 2026-08-19 15:43:30 +00:00
fix(tui): consolidate developer tools controls (#42088)
This commit is contained in:
parent
17cae23dce
commit
723f5e0028
3 changed files with 16 additions and 11 deletions
|
|
@ -429,6 +429,7 @@ export function DevToolsBar() {
|
|||
function BarItem(props: ParentProps<{ active: boolean; onClick: () => void }>) {
|
||||
const theme = useTheme()
|
||||
const renderer = useRenderer()
|
||||
const [hovered, setHovered] = createSignal(false)
|
||||
return (
|
||||
<box
|
||||
position="relative"
|
||||
|
|
@ -437,7 +438,15 @@ function BarItem(props: ParentProps<{ active: boolean; onClick: () => void }>) {
|
|||
flexDirection="row"
|
||||
paddingLeft={1}
|
||||
paddingRight={1}
|
||||
backgroundColor={props.active ? theme.background.action.primary.focused : undefined}
|
||||
backgroundColor={
|
||||
props.active
|
||||
? theme.background.action.primary.focused
|
||||
: hovered()
|
||||
? theme.background.action.primary.hovered
|
||||
: undefined
|
||||
}
|
||||
onMouseOver={() => setHovered(true)}
|
||||
onMouseOut={() => setHovered(false)}
|
||||
onMouseUp={() => {
|
||||
if (renderer.getSelection()?.getSelectedText()) return
|
||||
props.onClick()
|
||||
|
|
|
|||
|
|
@ -283,7 +283,7 @@ export const settings: Setting[] = [
|
|||
keywords: ["selection", "clipboard"],
|
||||
},
|
||||
{
|
||||
title: "DevTools",
|
||||
title: "Developer tools",
|
||||
category: "Debug",
|
||||
path: ["debug", "devtools"],
|
||||
default: false,
|
||||
|
|
@ -291,15 +291,6 @@ export const settings: Setting[] = [
|
|||
labels: ["off", "on"],
|
||||
keywords: ["debug bar", "developer tools"],
|
||||
},
|
||||
{
|
||||
title: "Turn token usage",
|
||||
category: "Debug",
|
||||
path: ["debug", "turn_tokens"],
|
||||
default: false,
|
||||
values: [false, true, "verbose"],
|
||||
labels: ["off", "on", "verbose"],
|
||||
keywords: ["tokens", "usage", "debug"],
|
||||
},
|
||||
]
|
||||
|
||||
export function settingID(setting: Setting) {
|
||||
|
|
|
|||
|
|
@ -180,6 +180,11 @@ test("uses ctrl+z for input undo when terminal suspend is unavailable", () => {
|
|||
expect(overridden.keybinds.get("input.undo")).toMatchObject([{ key: "ctrl+u" }])
|
||||
})
|
||||
|
||||
test("keeps turn token usage inside developer tools", () => {
|
||||
expect(settings.find((setting) => setting.path.join(".") === "debug.devtools")?.title).toBe("Developer tools")
|
||||
expect(settings.some((setting) => setting.path.join(".") === "debug.turn_tokens")).toBe(false)
|
||||
})
|
||||
|
||||
test("provides config and its host interface", async () => {
|
||||
const config = resolve({}, { terminalSuspend: true })
|
||||
let current = {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue