From 45d6e351e854c1df435064c5890c80f99619ed82 Mon Sep 17 00:00:00 2001 From: Sangyoon21 Date: Mon, 24 Aug 2026 16:23:42 +0000 Subject: [PATCH 1/2] Set up development container --- .devcontainer/Dockerfile | 11 +++++++++++ .devcontainer/devcontainer.json | 6 ++++++ 2 files changed, 17 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..83e24aa7 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,11 @@ +FROM oven/bun:1.3.14 + +USER root + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + python3 \ + make \ + g++ \ + git \ + && rm -rf /var/lib/apt/lists/* \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..1e12d023 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,6 @@ +{ + "name": "17-313 OpenCode", + "build": { + "dockerfile": "Dockerfile" + } +} \ No newline at end of file From 8c58f79648941748b42027eb2b6701b7a10db965 Mon Sep 17 00:00:00 2001 From: Sangyoon21 Date: Mon, 31 Aug 2026 17:21:55 +0000 Subject: [PATCH 2/2] refactor(tui): reduce return count in formatDuration --- packages/tui/src/util/format.ts | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/packages/tui/src/util/format.ts b/packages/tui/src/util/format.ts index 4ae62eac..f0ff8e74 100644 --- a/packages/tui/src/util/format.ts +++ b/packages/tui/src/util/format.ts @@ -1,20 +1,23 @@ export function formatDuration(secs: number) { - if (secs <= 0) return "" - if (secs < 60) return `${secs}s` - if (secs < 3600) { + let result: string + if (secs <= 0) { + result = "" + } else if (secs < 60) { + result = `${secs}s` + } else if (secs < 3600) { const mins = Math.floor(secs / 60) const remaining = secs % 60 - return remaining > 0 ? `${mins}m ${remaining}s` : `${mins}m` - } - if (secs < 86400) { + result = remaining > 0 ? `${mins}m ${remaining}s` : `${mins}m` + } else if (secs < 86400) { const hours = Math.floor(secs / 3600) const remaining = Math.floor((secs % 3600) / 60) - return remaining > 0 ? `${hours}h ${remaining}m` : `${hours}h` - } - if (secs < 604800) { + result = remaining > 0 ? `${hours}h ${remaining}m` : `${hours}h` + } else if (secs < 604800) { const days = Math.floor(secs / 86400) - return days === 1 ? "~1 day" : `~${days} days` + result = days === 1 ? "~1 day" : `~${days} days` + } else { + const weeks = Math.floor(secs / 604800) + result = weeks === 1 ? "~1 week" : `~${weeks} weeks` } - const weeks = Math.floor(secs / 604800) - return weeks === 1 ? "~1 week" : `~${weeks} weeks` + return result }