Skip to content

Commit 14dcb5d

Browse files
authored
Merge pull request #74 from tyulyukov/marcode/pr-chat-minimap
feat(web): vertical minimap for user messages
2 parents a58106b + 91f5d71 commit 14dcb5d

11 files changed

Lines changed: 1537 additions & 69 deletions

File tree

apps/desktop/src/clientPersistence.test.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import * as os from "node:os";
33
import * as path from "node:path";
44

55
import {
6+
ClientSettingsSchema,
67
EnvironmentId,
78
type ClientSettings,
89
type PersistedSavedEnvironmentRecord,
@@ -19,6 +20,7 @@ import {
1920
writeSavedEnvironmentSecret,
2021
type DesktopSecretStorage,
2122
} from "./clientPersistence.ts";
23+
import { Schema } from "effect";
2224

2325
const tempDirectories: string[] = [];
2426

@@ -48,28 +50,18 @@ function makeSecretStorage(available: boolean): DesktopSecretStorage {
4850
};
4951
}
5052

51-
const clientSettings: ClientSettings = {
53+
const clientSettings: ClientSettings = Schema.decodeSync(ClientSettingsSchema)({
5254
confirmThreadArchive: true,
5355
confirmThreadDelete: false,
5456
diffWordWrap: true,
55-
favorites: [],
5657
sidebarProjectGroupingMode: "repository_path",
5758
sidebarProjectGroupingOverrides: {
5859
"environment-1:/tmp/project-a": "separate",
5960
},
6061
sidebarProjectSortOrder: "manual",
6162
sidebarThreadSortOrder: "created_at",
6263
timestampFormat: "24-hour",
63-
turnNotificationMode: "off",
64-
turnNotificationSoundId: "default",
65-
turnNotificationCustomSounds: [],
66-
turnNotificationAdvancedSounds: false,
67-
turnNotificationSoundMap: {
68-
"turn-events": "default",
69-
"approval-needed": "default",
70-
"user-input-needed": "default",
71-
},
72-
};
64+
});
7365

7466
const savedRegistryRecord: PersistedSavedEnvironmentRecord = {
7567
environmentId: EnvironmentId.make("environment-1"),

apps/web/src/components/ChatView.browser.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,32 +117,38 @@ interface ViewportSpec {
117117
attachmentTolerancePx: number;
118118
}
119119

120+
// The chat minimap (`pr-2`) shaves 8px off the timeline row's right side,
121+
// which trims ~6.4px from the user-bubble (after the 80% width ratio). With
122+
// long messages near a wrap boundary that's enough to flip 1-2 lines between
123+
// the renderer and the character-width-based estimator, so each viewport's
124+
// text tolerance budgets a couple extra wrapped-line heights to absorb that
125+
// drift without flapping the test on minor layout adjustments.
120126
const DEFAULT_VIEWPORT: ViewportSpec = {
121127
name: "desktop",
122128
width: 960,
123129
height: 1_100,
124-
textTolerancePx: 48,
130+
textTolerancePx: 80,
125131
attachmentTolerancePx: 56,
126132
};
127133
const WIDE_FOOTER_VIEWPORT: ViewportSpec = {
128134
name: "wide-footer",
129135
width: 1_400,
130136
height: 1_100,
131-
textTolerancePx: 48,
137+
textTolerancePx: 80,
132138
attachmentTolerancePx: 56,
133139
};
134140
const COMPACT_FOOTER_VIEWPORT: ViewportSpec = {
135141
name: "compact-footer",
136142
width: 430,
137143
height: 932,
138-
textTolerancePx: 68,
144+
textTolerancePx: 96,
139145
attachmentTolerancePx: 56,
140146
};
141147
const TEXT_VIEWPORT_MATRIX = [
142148
DEFAULT_VIEWPORT,
143-
{ name: "tablet", width: 720, height: 1_024, textTolerancePx: 48, attachmentTolerancePx: 56 },
144-
{ name: "mobile", width: 430, height: 932, textTolerancePx: 68, attachmentTolerancePx: 56 },
145-
{ name: "narrow", width: 320, height: 700, textTolerancePx: 114, attachmentTolerancePx: 56 },
149+
{ name: "tablet", width: 720, height: 1_024, textTolerancePx: 80, attachmentTolerancePx: 56 },
150+
{ name: "mobile", width: 430, height: 932, textTolerancePx: 96, attachmentTolerancePx: 56 },
151+
{ name: "narrow", width: 320, height: 700, textTolerancePx: 140, attachmentTolerancePx: 56 },
146152
] as const satisfies readonly ViewportSpec[];
147153
const ATTACHMENT_VIEWPORT_MATRIX = [
148154
{ ...DEFAULT_VIEWPORT, attachmentTolerancePx: 120 },

0 commit comments

Comments
 (0)