diff options
| author | Luke Parker <[email protected]> | 2026-03-12 13:55:16 +1000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-03-12 13:55:16 +1000 |
| commit | db7bafe9177b40b22060867838d17d53cf29d81b (patch) | |
| tree | 520fbf949a912403e0f0a7eabb4995c801566d0c | |
| parent | b1ef501207aa9d2c7f7ee70cbd1d9fde360be219 (diff) | |
| download | opencode-db7bafe9177b40b22060867838d17d53cf29d81b.tar.gz opencode-db7bafe9177b40b22060867838d17d53cf29d81b.zip | |
fix(app): guard comment accessor in message timeline (#17126)
| -rw-r--r-- | packages/app/src/pages/session/message-timeline.tsx | 54 |
1 files changed, 29 insertions, 25 deletions
diff --git a/packages/app/src/pages/session/message-timeline.tsx b/packages/app/src/pages/session/message-timeline.tsx index cb9c61918..ab919b70e 100644 --- a/packages/app/src/pages/session/message-timeline.tsx +++ b/packages/app/src/pages/session/message-timeline.tsx @@ -778,31 +778,35 @@ export function MessageTimeline(props: { <div class="flex w-max min-w-full justify-end gap-2"> <Index each={comments()}> {(commentAccessor: () => MessageComment) => { - const comment = createMemo(() => commentAccessor()) - return ( - <div class="shrink-0 max-w-[260px] rounded-[6px] border border-border-weak-base bg-background-stronger px-2.5 py-2"> - <div class="flex items-center gap-1.5 min-w-0 text-11-medium text-text-strong"> - <FileIcon - node={{ path: comment().path, type: "file" }} - class="size-3.5 shrink-0" - /> - <span class="truncate">{getFilename(comment().path)}</span> - <Show when={comment().selection}> - {(selection) => ( - <span class="shrink-0 text-text-weak"> - {selection().startLine === selection().endLine - ? `:${selection().startLine}` - : `:${selection().startLine}-${selection().endLine}`} - </span> - )} - </Show> - </div> - <div class="pt-1 text-12-regular text-text-strong whitespace-pre-wrap break-words"> - {comment().comment} - </div> - </div> - ) - }} + const comment = createMemo(() => commentAccessor()) + return ( + <Show when={comment()}> + {(c) => ( + <div class="shrink-0 max-w-[260px] rounded-[6px] border border-border-weak-base bg-background-stronger px-2.5 py-2"> + <div class="flex items-center gap-1.5 min-w-0 text-11-medium text-text-strong"> + <FileIcon + node={{ path: c().path, type: "file" }} + class="size-3.5 shrink-0" + /> + <span class="truncate">{getFilename(c().path)}</span> + <Show when={c().selection}> + {(selection) => ( + <span class="shrink-0 text-text-weak"> + {selection().startLine === selection().endLine + ? `:${selection().startLine}` + : `:${selection().startLine}-${selection().endLine}`} + </span> + )} + </Show> + </div> + <div class="pt-1 text-12-regular text-text-strong whitespace-pre-wrap break-words"> + {c().comment} + </div> + </div> + )} + </Show> + ) + }} </Index> </div> </div> |
