From 06ae487da636b1fea88f8e797a9b1df5a5643e46 Mon Sep 17 00:00:00 2001 From: GunwoongP <134934834+GunwoongP@users.noreply.github.com> Date: Fri, 6 Mar 2026 17:03:16 +0900 Subject: [PATCH 1/2] docs: add detailed Windows setup guide for PowerShell The existing Windows instructions were a single line (`vcpkg install ...`) which omitted Visual Studio Build Tools, vcpkg bootstrapping, environment variable configuration, and the TECTONIC_DEP_BACKEND setting. This adds step-by-step PowerShell instructions to both README.md and CONTRIBUTING.md. Co-Authored-By: Claude Opus 4.6 --- CONTRIBUTING.md | 24 ++++++++++++++++++++++-- README.md | 34 +++++++++++++++++++++++++++++++++- 2 files changed, 55 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5595fd1..4d1ffb8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,10 +9,30 @@ Contributions are welcome! This guide covers the development environment, workfl - [Node.js](https://nodejs.org/) 22+ - [pnpm](https://pnpm.io/) 10+ - [Rust](https://rustup.rs/) (stable) -- Platform-specific native dependencies: +- Platform-specific native dependencies (required by [Tectonic](https://tectonic-typesetting.github.io/)): - **macOS:** `brew install icu4c harfbuzz pkg-config` - **Linux:** `apt install libicu-dev libgraphite2-dev libharfbuzz-dev libfreetype-dev libfontconfig-dev libwebkit2gtk-4.1-dev libappindicator3-dev` - - **Windows:** `vcpkg install harfbuzz[graphite2] freetype icu fontconfig` (with `TECTONIC_DEP_BACKEND=vcpkg`) + - **Windows:** Visual Studio Build Tools (C++ workload) + vcpkg — see detailed steps below + +#### Windows Setup (PowerShell) + +```powershell +# 1. Install Visual Studio Build Tools (if not already installed) +winget install Microsoft.VisualStudio.2022.BuildTools --override "--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended" + +# 2. Install vcpkg +git clone https://github.com/microsoft/vcpkg.git C:\vcpkg +C:\vcpkg\bootstrap-vcpkg.bat + +# 3. Set environment variables (persistent) +[Environment]::SetEnvironmentVariable("VCPKG_ROOT", "C:\vcpkg", "User") +$path = [Environment]::GetEnvironmentVariable("PATH", "User") +[Environment]::SetEnvironmentVariable("PATH", "$path;C:\vcpkg", "User") +[Environment]::SetEnvironmentVariable("TECTONIC_DEP_BACKEND", "vcpkg", "User") + +# 4. Restart PowerShell, then install native libraries (~10-20 min) +vcpkg install harfbuzz[graphite2]:x64-windows freetype:x64-windows icu:x64-windows fontconfig:x64-windows +``` ### Setup diff --git a/README.md b/README.md index a7c872e..5c56e8f 100644 --- a/README.md +++ b/README.md @@ -135,7 +135,10 @@ Download the latest build from [GitHub Releases](https://github.com/delibae/clau - [Node.js](https://nodejs.org/) 22+ - [pnpm](https://pnpm.io/) 10+ - [Rust](https://rustup.rs/) (stable) -- macOS: `brew install icu4c harfbuzz pkg-config` +- Platform-specific native dependencies (required by [Tectonic](https://tectonic-typesetting.github.io/)): + - **macOS:** `brew install icu4c harfbuzz pkg-config` + - **Linux:** `apt install libicu-dev libgraphite2-dev libharfbuzz-dev libfreetype-dev libfontconfig-dev libwebkit2gtk-4.1-dev libappindicator3-dev` + - **Windows:** See [Windows Setup](#windows-setup) below ### Setup @@ -145,6 +148,35 @@ cd claude-prism pnpm install ``` +### Windows Setup + +Windows requires [Visual Studio Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/) (C++ workload) and [vcpkg](https://github.com/microsoft/vcpkg) for native dependencies. Run the following in **PowerShell**: + +```powershell +# 1. Install Visual Studio Build Tools (if not already installed) +winget install Microsoft.VisualStudio.2022.BuildTools --override "--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended" + +# 2. Install vcpkg +git clone https://github.com/microsoft/vcpkg.git C:\vcpkg +C:\vcpkg\bootstrap-vcpkg.bat + +# 3. Set environment variables (persistent) +[Environment]::SetEnvironmentVariable("VCPKG_ROOT", "C:\vcpkg", "User") +$path = [Environment]::GetEnvironmentVariable("PATH", "User") +[Environment]::SetEnvironmentVariable("PATH", "$path;C:\vcpkg", "User") +[Environment]::SetEnvironmentVariable("TECTONIC_DEP_BACKEND", "vcpkg", "User") + +# 4. Restart PowerShell, then install native libraries +vcpkg install harfbuzz[graphite2]:x64-windows freetype:x64-windows icu:x64-windows fontconfig:x64-windows + +# 5. Build and run +cd claude-prism +pnpm install +pnpm dev:desktop +``` + +> **Note:** Step 4 may take 10–20 minutes on first run (building ICU, HarfBuzz, etc.). + ### Run ```bash From 47d8723ce75a50110a060fdd72a6c553f665f7fd Mon Sep 17 00:00:00 2001 From: GunwoongP <134934834+GunwoongP@users.noreply.github.com> Date: Fri, 6 Mar 2026 19:06:21 +0900 Subject: [PATCH 2/2] fix: Windows build fixes and session resume crash - README: add CXXFLAGS=/std:c++17 env var for MSVC (ICU 78+ requires C++17, but MSVC uses /std:c++17 instead of -std=c++17) - README: fix vcpkg triplet to x64-windows-static-md (tectonic expects static-md linkage, not dynamic x64-windows) - .cargo/config.toml: clarify that macOS defaults are overridden by user env vars on Windows/Linux (force=false) - tool-widgets: fix TodoWrite widget crash when input.todos is not an array (e.g. malformed session history), use Array.isArray guard - chat-messages: add nullish coalescing fallback for messages store selector to prevent crashes during session transitions Co-Authored-By: Claude Opus 4.6 --- README.md | 5 +++-- apps/desktop/src-tauri/.cargo/config.toml | 10 ++++++---- .../src/components/claude-chat/chat-messages.tsx | 2 +- .../src/components/claude-chat/tool-widgets.tsx | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 5c56e8f..7cde228 100644 --- a/README.md +++ b/README.md @@ -165,9 +165,10 @@ C:\vcpkg\bootstrap-vcpkg.bat $path = [Environment]::GetEnvironmentVariable("PATH", "User") [Environment]::SetEnvironmentVariable("PATH", "$path;C:\vcpkg", "User") [Environment]::SetEnvironmentVariable("TECTONIC_DEP_BACKEND", "vcpkg", "User") +[Environment]::SetEnvironmentVariable("CXXFLAGS", "/std:c++17", "User") -# 4. Restart PowerShell, then install native libraries -vcpkg install harfbuzz[graphite2]:x64-windows freetype:x64-windows icu:x64-windows fontconfig:x64-windows +# 4. Restart PowerShell, then install native libraries (use x64-windows-static-md triplet) +vcpkg install harfbuzz[graphite2]:x64-windows-static-md freetype:x64-windows-static-md icu:x64-windows-static-md fontconfig:x64-windows-static-md # 5. Build and run cd claude-prism diff --git a/apps/desktop/src-tauri/.cargo/config.toml b/apps/desktop/src-tauri/.cargo/config.toml index 0d0f106..c5f65e6 100644 --- a/apps/desktop/src-tauri/.cargo/config.toml +++ b/apps/desktop/src-tauri/.cargo/config.toml @@ -1,8 +1,10 @@ -# Tectonic build configuration for macOS (Homebrew) -# ICU is keg-only in Homebrew, so pkg-config can't find it without this path. -# HarfBuzz headers need the parent include directory for #include . +# Tectonic build configuration # ICU 78+ requires C++17. -# On Linux, system packages are in standard paths — these extra paths are harmless. +# These defaults are for macOS (Homebrew). force=false means they are +# ignored when the env var is already set (e.g. on Windows/Linux). +# +# Windows: set CXXFLAGS=/std:c++17 as a user environment variable. +# Linux: system packages are in standard paths — no extra flags needed. [env] PKG_CONFIG_PATH = { value = "/opt/homebrew/opt/icu4c/lib/pkgconfig", force = false } CXXFLAGS = { value = "-I/opt/homebrew/include -std=c++17", force = false } diff --git a/apps/desktop/src/components/claude-chat/chat-messages.tsx b/apps/desktop/src/components/claude-chat/chat-messages.tsx index a7a8600..077f508 100644 --- a/apps/desktop/src/components/claude-chat/chat-messages.tsx +++ b/apps/desktop/src/components/claude-chat/chat-messages.tsx @@ -39,7 +39,7 @@ const StreamingIndicator: FC = memo(() => { // ─── Chat Messages (main component) ─── export const ChatMessages: FC = () => { - const messages = useClaudeChatStore((s) => s.messages); + const messages = useClaudeChatStore((s) => s.messages) ?? []; const isStreaming = useClaudeChatStore((s) => s.isStreaming); const viewportRef = useRef(null); const shouldAutoScrollRef = useRef(true); diff --git a/apps/desktop/src/components/claude-chat/tool-widgets.tsx b/apps/desktop/src/components/claude-chat/tool-widgets.tsx index 2656a06..960cde5 100644 --- a/apps/desktop/src/components/claude-chat/tool-widgets.tsx +++ b/apps/desktop/src/components/claude-chat/tool-widgets.tsx @@ -296,7 +296,7 @@ const AskUserQuestionWidget: FC<{ input: any; result?: ContentBlock }> = ({ inpu const TodoWriteWidget: FC<{ input: any; result?: ContentBlock }> = ({ input, result }) => { const [expanded, setExpanded] = useState(true); - const todos: any[] = input?.todos || []; + const todos: any[] = Array.isArray(input?.todos) ? input.todos : []; const statusIcon = (status: string) => { switch (status) {