Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ Auto-managed runtime state. Do not edit manually unless troubleshooting.

```toml
font_size = 14
onboarding_shown = true

[window]
width = 1440
Expand All @@ -212,6 +213,7 @@ terminals = [
| Field | Description |
|-------|-------------|
| `font_size` | Current font size (adjusted with `Cmd++`/`Cmd+-`) |
| `onboarding_shown` | Whether the first-launch onboarding message has been displayed |
| `[window]` | Last window position and dimensions |
| `terminals` | Working directories for each terminal (ordered by session index) |

Expand Down
24 changes: 24 additions & 0 deletions src/app/runtime.zig
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,30 @@ pub fn run() !void {
// Always spawn at least the first terminal
try sessions[0].ensureSpawnedWithLoop(&loop);

// Show onboarding message on first launch
if (!persistence.onboarding_shown) {
if (sessions[0].stream) |*stream| {
// Grey text using ANSI bright black (90m), reset with 0m
const onboarding_msg =
"\x1b[90m" ++
"Welcome to Architect!\n" ++
"\n" ++
" Cmd+N New terminal Cmd+W Close terminal\n" ++
" Cmd+Enter Toggle focus Hold Escape Interrupt agent\n" ++
"\n" ++
"Hook AI agents: architect hook claude | codex | gemini\n" ++
"\x1b[0m\n";
stream.nextSlice(onboarding_msg) catch |err| {
log.warn("Failed to display onboarding message: {}", .{err});
};
sessions[0].markDirty();
}
persistence.onboarding_shown = true;
persistence.save(allocator) catch |err| {
log.warn("Failed to save persistence after onboarding: {}", .{err});
};
Comment on lines +542 to +550
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error handling uses a catch block with a warning log, but then continues to set onboarding_shown = true even if the message failed to display. This means users who encounter this error will never see the onboarding message. Consider only setting the flag to true if the message is successfully displayed, or handle the error differently.

Suggested change
stream.nextSlice(onboarding_msg) catch |err| {
log.warn("Failed to display onboarding message: {}", .{err});
};
sessions[0].markDirty();
}
persistence.onboarding_shown = true;
persistence.save(allocator) catch |err| {
log.warn("Failed to save persistence after onboarding: {}", .{err});
};
if (stream.nextSlice(onboarding_msg)) |_| {
sessions[0].markDirty();
persistence.onboarding_shown = true;
persistence.save(allocator) catch |err| {
log.warn("Failed to save persistence after onboarding: {}", .{err});
};
} else |err| {
log.warn("Failed to display onboarding message: {}", .{err});
}
}

Copilot uses AI. Check for mistakes.
}

init_count = sessions.len;

const session_ui_info = try allocator.alloc(ui_mod.SessionUiInfo, grid_layout.max_terminals);
Expand Down
4 changes: 4 additions & 0 deletions src/config.zig
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,13 @@ pub const Persistence = struct {
window: WindowConfig = .{},
font_size: c_int = 14,
terminal_paths: std.ArrayListUnmanaged([]const u8) = .{},
onboarding_shown: bool = false,

const TomlPersistenceV2 = struct {
window: WindowConfig = .{},
font_size: c_int = 14,
terminals: ?[]const []const u8 = null,
onboarding_shown: bool = false,
};

const TomlPersistenceV1 = struct {
Expand Down Expand Up @@ -283,6 +285,7 @@ pub const Persistence = struct {
defer result.deinit();
persistence.window = result.value.window;
persistence.font_size = result.value.font_size;
persistence.onboarding_shown = result.value.onboarding_shown;

if (result.value.terminals) |paths| {
for (paths) |path| {
Expand Down Expand Up @@ -339,6 +342,7 @@ pub const Persistence = struct {
pub fn serializeToWriter(self: Persistence, writer: anytype) !void {
// Write font_size first (top-level scalar)
try writer.print("font_size = {d}\n", .{self.font_size});
try writer.print("onboarding_shown = {}\n", .{self.onboarding_shown});

// Write terminals array before any sections
if (self.terminal_paths.items.len > 0) {
Expand Down