Skip to content

Commit 4fae244

Browse files
committed
chore: format code
1 parent dddf017 commit 4fae244

File tree

1 file changed

+48
-39
lines changed
  • packages/opencode/src/cli/cmd/tui/routes/session

1 file changed

+48
-39
lines changed

packages/opencode/src/cli/cmd/tui/routes/session/index.tsx

Lines changed: 48 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ import stripAnsi from "strip-ansi"
7070
addDefaultParsers(parsers.parsers)
7171

7272
class CustomSpeedScroll implements ScrollAcceleration {
73-
constructor(private speed: number) { }
73+
constructor(private speed: number) {}
7474

7575
tick(_now?: number): number {
7676
return this.speed
7777
}
7878

79-
reset(): void { }
79+
reset(): void {}
8080
}
8181

8282
const context = createContext<{
@@ -256,30 +256,30 @@ export function Session() {
256256
},
257257
...(sync.data.config.share !== "disabled"
258258
? [
259-
{
260-
title: "Share session",
261-
value: "session.share",
262-
keybind: "session_share" as const,
263-
disabled: !!session()?.share?.url,
264-
category: "Session",
265-
onSelect: async (dialog: any) => {
266-
await sdk.client.session
267-
.share({
268-
path: {
269-
id: route.sessionID,
270-
},
271-
})
272-
.then((res) =>
273-
Clipboard.copy(res.data!.share!.url).catch(() =>
274-
toast.show({ message: "Failed to copy URL to clipboard", variant: "error" }),
275-
),
276-
)
277-
.then(() => toast.show({ message: "Share URL copied to clipboard!", variant: "success" }))
278-
.catch(() => toast.show({ message: "Failed to share session", variant: "error" }))
279-
dialog.clear()
259+
{
260+
title: "Share session",
261+
value: "session.share",
262+
keybind: "session_share" as const,
263+
disabled: !!session()?.share?.url,
264+
category: "Session",
265+
onSelect: async (dialog: any) => {
266+
await sdk.client.session
267+
.share({
268+
path: {
269+
id: route.sessionID,
270+
},
271+
})
272+
.then((res) =>
273+
Clipboard.copy(res.data!.share!.url).catch(() =>
274+
toast.show({ message: "Failed to copy URL to clipboard", variant: "error" }),
275+
),
276+
)
277+
.then(() => toast.show({ message: "Share URL copied to clipboard!", variant: "success" }))
278+
.catch(() => toast.show({ message: "Failed to share session", variant: "error" }))
279+
dialog.clear()
280+
},
280281
},
281-
},
282-
]
282+
]
283283
: []),
284284
{
285285
title: "Unshare session",
@@ -938,7 +938,14 @@ function UserMessage(props: {
938938
{sync.data.config.username ?? "You"}{" "}
939939
<Show
940940
when={queued()}
941-
fallback={<span style={{ fg: theme.textMuted }}>{ctx.showTimestamps() ? ${Locale.todayTimeOrDateTime(props.message.time.created)}` : ${Locale.time(props.message.time.created)}`}</span>}>
941+
fallback={
942+
<span style={{ fg: theme.textMuted }}>
943+
{ctx.showTimestamps()
944+
? ${Locale.todayTimeOrDateTime(props.message.time.created)}`
945+
: ${Locale.time(props.message.time.created)}`}
946+
</span>
947+
}
948+
>
942949
<span style={{ bg: theme.accent, fg: theme.backgroundPanel, bold: true }}> QUEUED </span>
943950
</Show>
944951
</text>
@@ -1050,7 +1057,9 @@ function AssistantMessage(props: { message: AssistantMessage; parts: Part[]; las
10501057
<span style={{ fg: local.agent.color(props.message.mode) }}>{Locale.titlecase(props.message.mode)}</span>{" "}
10511058
<span style={{ fg: theme.textMuted }}>
10521059
{props.message.modelID}
1053-
{ctx.showTimestamps() && props.message.time.completed && ` · ${Locale.todayTimeOrDateTime(props.message.time.completed)}`}
1060+
{ctx.showTimestamps() &&
1061+
props.message.time.completed &&
1062+
` · ${Locale.todayTimeOrDateTime(props.message.time.completed)}`}
10541063
</span>
10551064
</text>
10561065
</box>
@@ -1132,19 +1141,19 @@ function ToolPart(props: { last: boolean; part: ToolPart; message: AssistantMess
11321141
const style: BoxProps =
11331142
container === "block" || permission
11341143
? {
1135-
border: permissionIndex === 0 ? (["left", "right"] as const) : (["left"] as const),
1136-
paddingTop: 1,
1137-
paddingBottom: 1,
1138-
paddingLeft: 2,
1139-
marginTop: 1,
1140-
gap: 1,
1141-
backgroundColor: theme.backgroundPanel,
1142-
customBorderChars: SplitBorder.customBorderChars,
1143-
borderColor: permissionIndex === 0 ? theme.warning : theme.background,
1144-
}
1144+
border: permissionIndex === 0 ? (["left", "right"] as const) : (["left"] as const),
1145+
paddingTop: 1,
1146+
paddingBottom: 1,
1147+
paddingLeft: 2,
1148+
marginTop: 1,
1149+
gap: 1,
1150+
backgroundColor: theme.backgroundPanel,
1151+
customBorderChars: SplitBorder.customBorderChars,
1152+
borderColor: permissionIndex === 0 ? theme.warning : theme.background,
1153+
}
11451154
: {
1146-
paddingLeft: 3,
1147-
}
1155+
paddingLeft: 3,
1156+
}
11481157

11491158
return (
11501159
<box

0 commit comments

Comments
 (0)