townmouse 0.2.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +72 -2
- package/DESIGN.md +26 -42
- package/README.md +286 -54
- package/SECURITY.md +3 -0
- package/TOWNMOUSE.md +1 -1
- package/bin/townmouse +2 -2
- package/docs/PACKAGING.md +104 -8
- package/docs/browser-workspace.md +62 -9
- package/docs/panes.md +199 -9
- package/native/TownmouseApp.swift +5 -5
- package/npm-shrinkwrap.json +1282 -0
- package/package.json +11 -7
- package/public/browser-picture.mjs +159 -0
- package/public/features/app-version.mjs +35 -0
- package/public/features/autosave.mjs +5 -1
- package/public/features/multi-window-sync.mjs +3 -1
- package/public/features/osc-bridge.mjs +8 -3
- package/public/features/session-manager.mjs +202 -100
- package/public/features/status-metrics.mjs +23 -0
- package/public/features/tab-reorder.mjs +8 -0
- package/public/features/window-title.mjs +10 -3
- package/public/index.html +617 -78
- package/public/input-guard.mjs +10 -2
- package/public/panes.css +189 -13
- package/public/panes.html +4 -1
- package/public/panes.mjs +667 -109
- package/public/workspace.css +198 -24
- package/public/workspace.mjs +346 -106
- package/scripts/install-service.sh +97 -63
- package/scripts/panes +134 -5
- package/scripts/retire-legacy-service.sh +76 -0
- package/scripts/{t1.sh → townmouse.sh} +60 -21
- package/scripts/uninstall-service.sh +31 -15
- package/src/agent-guide.js +72 -3
- package/src/attachments.js +2 -2
- package/src/browser-dom.js +5 -2
- package/src/browser-workspace.js +549 -62
- package/src/owner-page.js +43 -0
- package/src/request-boundary.js +1 -1
- package/src/server.js +588 -128
- package/src/workspace-panes.js +423 -91
package/public/workspace.css
CHANGED
|
@@ -67,11 +67,29 @@ body.workspace {
|
|
|
67
67
|
height: 24px;
|
|
68
68
|
background: url('/icon.svg') center / contain no-repeat;
|
|
69
69
|
}
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
/* The shell this window is in, named by the page script so the title and the
|
|
71
|
+
lit chip are always the same session. A long name is cut, never wrapped. */
|
|
72
|
+
.workspace .terminal-title { min-width: 0; }
|
|
73
|
+
.workspace .terminal-title > span {
|
|
74
|
+
min-width: 0;
|
|
75
|
+
overflow: hidden;
|
|
76
|
+
text-overflow: ellipsis;
|
|
77
|
+
}
|
|
78
|
+
/* The title gives way last, and by a fraction of a pixel at first (flex
|
|
79
|
+
rounding). That is clipped, not turned into an ellipsis; workspace.mjs
|
|
80
|
+
decides which, once the row has settled. */
|
|
81
|
+
.workspace .terminal-title > span.title-clip { text-overflow: clip; }
|
|
82
|
+
.workspace .terminal-title-session {
|
|
72
83
|
font-weight: 400;
|
|
73
84
|
color: var(--ws-muted);
|
|
74
85
|
}
|
|
86
|
+
/* When the header is tight (a dock is open, or a browser pane sits beside
|
|
87
|
+
it) space is given up in this order: the row of chips scrolls, the pill
|
|
88
|
+
loses its folder, and only then is the title cut. The title names the
|
|
89
|
+
current shell, so it gives way last, and almost never entirely. */
|
|
90
|
+
.workspace .terminal-title { flex-shrink: 0.01; min-width: 9em; }
|
|
91
|
+
.workspace .t1session-tabs { flex-shrink: 4; min-width: 100px; }
|
|
92
|
+
.workspace-session-pill { flex-shrink: 3; min-width: 11ch; }
|
|
75
93
|
.workspace .terminal-status { border: 0; background: transparent; color: var(--ws-muted); font-size: 12px; }
|
|
76
94
|
.workspace .terminal-status.connected { color: var(--ws-blue); }
|
|
77
95
|
.workspace .status-dot.connected { background: var(--ws-blue); }
|
|
@@ -85,7 +103,8 @@ body.workspace {
|
|
|
85
103
|
display: inline-flex;
|
|
86
104
|
align-items: center;
|
|
87
105
|
gap: 6px;
|
|
88
|
-
|
|
106
|
+
/* The current shell and its folder; a long one is cut, chevron stays. */
|
|
107
|
+
max-width: min(30ch, 30vw);
|
|
89
108
|
padding: 4px 10px;
|
|
90
109
|
border: 1px solid var(--ws-control);
|
|
91
110
|
border-radius: 9px;
|
|
@@ -105,6 +124,20 @@ body.workspace {
|
|
|
105
124
|
border-radius: 50%;
|
|
106
125
|
background: var(--ws-blue);
|
|
107
126
|
}
|
|
127
|
+
.workspace-session-pill-label {
|
|
128
|
+
display: flex;
|
|
129
|
+
flex: 0 1 auto;
|
|
130
|
+
min-width: 0;
|
|
131
|
+
white-space: nowrap;
|
|
132
|
+
}
|
|
133
|
+
.workspace-session-pill-name { flex: 0 0 auto; }
|
|
134
|
+
/* The folder is the first thing the header gives up; the name stays. */
|
|
135
|
+
.workspace-session-pill-folder {
|
|
136
|
+
flex: 0 1 auto;
|
|
137
|
+
min-width: 0;
|
|
138
|
+
overflow: hidden;
|
|
139
|
+
text-overflow: ellipsis;
|
|
140
|
+
}
|
|
108
141
|
.workspace-session-pill::after {
|
|
109
142
|
content: '▾';
|
|
110
143
|
font-size: 10px;
|
|
@@ -122,33 +155,53 @@ body.workspace {
|
|
|
122
155
|
}
|
|
123
156
|
.workspace-reconnect[hidden], .workspace-session-pill[hidden] { display: none !important; }
|
|
124
157
|
|
|
125
|
-
/*
|
|
126
|
-
.
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
158
|
+
/* Shell sessions: one chip per live shell, the server's list in the server's
|
|
159
|
+
order. The strip scrolls sideways when it is full and never wraps, so the
|
|
160
|
+
header stays one line. The current chip carries the control boundary
|
|
161
|
+
(motion 4, active tab feedback); the others stay quiet but are whole
|
|
162
|
+
buttons, each with its close control. Base sizes live in
|
|
163
|
+
features/session-manager.mjs. */
|
|
164
|
+
.workspace .t1session-tabs { display: flex; align-items: center; gap: 6px; margin-left: 4px; }
|
|
165
|
+
.workspace .t1session-strip { gap: 2px; }
|
|
166
|
+
.workspace .t1session-chip {
|
|
167
|
+
padding-right: 2px;
|
|
133
168
|
border-radius: 9px;
|
|
134
|
-
|
|
135
|
-
}
|
|
136
|
-
|
|
169
|
+
transition: background-color 200ms var(--ws-ease), border-color 200ms var(--ws-ease), color 200ms var(--ws-ease);
|
|
170
|
+
}
|
|
171
|
+
/* Hover is the paper tone, as on list rows: the glass tone vanishes on the
|
|
172
|
+
near-white header, which left the pointer shape as the only sign that a
|
|
173
|
+
chip could be clicked. */
|
|
174
|
+
.workspace .t1session-chip:hover { background: var(--ws-paper); color: var(--ws-ink); }
|
|
175
|
+
.workspace .t1session-chip.active:hover { background: var(--ws-glass); color: var(--ws-blue); }
|
|
176
|
+
.workspace .t1session-chip.active {
|
|
137
177
|
color: var(--ws-blue);
|
|
138
178
|
background: var(--ws-glass);
|
|
139
179
|
border-color: var(--ws-control);
|
|
140
180
|
}
|
|
141
|
-
.workspace .t1session-tab
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
181
|
+
.workspace .t1session-tab {
|
|
182
|
+
padding: 4px 8px;
|
|
183
|
+
border-radius: 9px;
|
|
184
|
+
}
|
|
185
|
+
.workspace .t1session-close {
|
|
186
|
+
/* Compact for a mouse; the rule below makes it 44 on a touch screen. */
|
|
187
|
+
min-width: 28px;
|
|
188
|
+
border-radius: 8px;
|
|
189
|
+
}
|
|
190
|
+
@media (pointer: coarse) {
|
|
191
|
+
.workspace .t1session-close { min-width: 44px; }
|
|
192
|
+
}
|
|
193
|
+
.workspace .t1session-close:hover { color: var(--ws-danger); }
|
|
194
|
+
.workspace .t1session-new {
|
|
147
195
|
color: var(--ws-blue);
|
|
148
196
|
background: var(--ws-glass);
|
|
149
197
|
border: 1px solid var(--ws-control);
|
|
150
198
|
border-radius: 10px;
|
|
151
199
|
}
|
|
200
|
+
/* The grabbing cursor once used here announced a reorder that did not
|
|
201
|
+
persist. A chip is a button, and says so only as a button does; its tooltip
|
|
202
|
+
says what a click does. Nothing in the row is draggable. */
|
|
203
|
+
.workspace .t1session-tab,
|
|
204
|
+
.workspace .t1session-close { cursor: pointer; }
|
|
152
205
|
|
|
153
206
|
/* Workspace navigation */
|
|
154
207
|
.workspace-nav {
|
|
@@ -935,7 +988,6 @@ body.split-dragging { user-select: none; }
|
|
|
935
988
|
.workspace .terminal-header { min-height: 48px; padding: 4px 8px; gap: 5px; }
|
|
936
989
|
.workspace .terminal-title { font-size: 12px; gap: 6px; }
|
|
937
990
|
.workspace .terminal-title::before { width: 20px; height: 20px; }
|
|
938
|
-
.workspace .terminal-title::after { content: ''; }
|
|
939
991
|
.workspace .terminal-status { font-size: 11px; }
|
|
940
992
|
.workspace .statuswrap { gap: 4px; }
|
|
941
993
|
.workspace .t1session-tabs { display: none !important; }
|
|
@@ -1094,6 +1146,21 @@ body.split-dragging { user-select: none; }
|
|
|
1094
1146
|
justify-content: flex-end;
|
|
1095
1147
|
gap: 8px;
|
|
1096
1148
|
}
|
|
1149
|
+
/* Which version is running: a quiet line under the Settings title, in the bar
|
|
1150
|
+
that stays put while the dock scrolls. */
|
|
1151
|
+
.workspace #settingsModal .settings-heading {
|
|
1152
|
+
display: flex;
|
|
1153
|
+
flex-direction: column;
|
|
1154
|
+
gap: 2px;
|
|
1155
|
+
min-width: 0;
|
|
1156
|
+
}
|
|
1157
|
+
.workspace #settingsModal .settings-version {
|
|
1158
|
+
margin: 0;
|
|
1159
|
+
color: var(--ws-muted);
|
|
1160
|
+
font-size: 12px;
|
|
1161
|
+
line-height: 1.35;
|
|
1162
|
+
font-variant-numeric: tabular-nums;
|
|
1163
|
+
}
|
|
1097
1164
|
/* The dock scrolls; keep the way out visible at the top on touch screens. */
|
|
1098
1165
|
.workspace #settingsModal .settings-panel { padding-top: 0; }
|
|
1099
1166
|
.workspace #settingsModal .settings-dock-bar {
|
|
@@ -1178,6 +1245,98 @@ body.split-dragging { user-select: none; }
|
|
|
1178
1245
|
.session-menu .drawer-list { margin-bottom: 12px; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
|
|
1179
1246
|
.session-menu #session-menu-new { flex: 0 0 auto; }
|
|
1180
1247
|
|
|
1248
|
+
/* Sessions list: every shell in the server's order, the current one marked,
|
|
1249
|
+
Rename and Close on each row, and the limit said where it would be hit. */
|
|
1250
|
+
.session-menu-count { margin: -6px 0 10px 4px; font-size: 11px; color: var(--ws-muted); font-variant-numeric: tabular-nums; }
|
|
1251
|
+
.session-menu-count:empty { display: none; }
|
|
1252
|
+
.session-row { display: flex; align-items: center; gap: 2px; border-radius: 10px; }
|
|
1253
|
+
/* The current row takes the list's usual active fill and check. */
|
|
1254
|
+
.session-row-main { flex: 1 1 auto; min-width: 0; }
|
|
1255
|
+
.session-row-main .drawer-row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1256
|
+
/* A folder or a name can have no space to wrap at; it may break anywhere. */
|
|
1257
|
+
.session-row-main .drawer-row-copy::after { min-width: 0; overflow-wrap: anywhere; }
|
|
1258
|
+
/* The check marks the current shell. The other rows do not need a chevron to
|
|
1259
|
+
say they switch; the description already does. */
|
|
1260
|
+
.session-row-main:not(.active)::after { content: none; }
|
|
1261
|
+
.session-row-action {
|
|
1262
|
+
flex: 0 0 auto;
|
|
1263
|
+
display: inline-flex;
|
|
1264
|
+
align-items: center;
|
|
1265
|
+
justify-content: center;
|
|
1266
|
+
width: 32px;
|
|
1267
|
+
min-width: 32px;
|
|
1268
|
+
min-height: 44px;
|
|
1269
|
+
padding: 0;
|
|
1270
|
+
border: 0;
|
|
1271
|
+
border-radius: 8px;
|
|
1272
|
+
background: transparent;
|
|
1273
|
+
color: var(--ws-muted);
|
|
1274
|
+
}
|
|
1275
|
+
.session-row-action:hover { background: var(--ws-paper); color: var(--ws-ink); }
|
|
1276
|
+
.session-row-action:focus-visible { outline: 2px solid var(--ws-blue); outline-offset: -2px; }
|
|
1277
|
+
.session-row-close:hover { color: var(--ws-danger); }
|
|
1278
|
+
.session-row-action svg { width: 18px; height: 18px; }
|
|
1279
|
+
/* While a name is being edited the field has the row to itself. */
|
|
1280
|
+
.session-row.renaming .session-row-action { visibility: hidden; }
|
|
1281
|
+
.session-row.renaming .session-row-main > svg { display: none; }
|
|
1282
|
+
.session-row-input {
|
|
1283
|
+
width: 100%;
|
|
1284
|
+
min-height: 36px;
|
|
1285
|
+
padding: 4px 8px;
|
|
1286
|
+
border: 1px solid var(--ws-control);
|
|
1287
|
+
border-radius: 7px;
|
|
1288
|
+
background: white;
|
|
1289
|
+
color: var(--ws-ink);
|
|
1290
|
+
font-size: 14px;
|
|
1291
|
+
}
|
|
1292
|
+
.session-menu-empty { margin: 0; padding: 10px 10px 12px; font-size: 12px; line-height: 1.5; color: var(--ws-muted); }
|
|
1293
|
+
@media (pointer: coarse) {
|
|
1294
|
+
.session-row-action { width: 44px; min-width: 44px; }
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
/* No shell open: what happened, and the one way forward. It takes the
|
|
1298
|
+
terminal's place in the flow; nothing floats over a live surface. */
|
|
1299
|
+
.session-empty {
|
|
1300
|
+
height: 100%;
|
|
1301
|
+
display: flex;
|
|
1302
|
+
flex-direction: column;
|
|
1303
|
+
align-items: center;
|
|
1304
|
+
justify-content: center;
|
|
1305
|
+
gap: 6px;
|
|
1306
|
+
padding: 24px;
|
|
1307
|
+
text-align: center;
|
|
1308
|
+
color: var(--ws-muted);
|
|
1309
|
+
}
|
|
1310
|
+
.session-empty h2 { margin: 0; font-size: 18px; letter-spacing: -.3px; color: var(--ws-ink); }
|
|
1311
|
+
.session-empty p { margin: 0; max-width: 46ch; font-size: 14px; line-height: 1.6; }
|
|
1312
|
+
.session-empty-output {
|
|
1313
|
+
margin: 8px 0 0;
|
|
1314
|
+
max-width: 100%;
|
|
1315
|
+
max-height: 9em;
|
|
1316
|
+
overflow: auto;
|
|
1317
|
+
padding: 10px 12px;
|
|
1318
|
+
border: 1px solid var(--ws-line);
|
|
1319
|
+
border-radius: 9px;
|
|
1320
|
+
background: var(--ws-paper);
|
|
1321
|
+
color: var(--ws-ink);
|
|
1322
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
1323
|
+
font-size: 12px;
|
|
1324
|
+
line-height: 1.5;
|
|
1325
|
+
text-align: left;
|
|
1326
|
+
white-space: pre-wrap;
|
|
1327
|
+
overflow-wrap: anywhere;
|
|
1328
|
+
}
|
|
1329
|
+
.session-empty button {
|
|
1330
|
+
margin-top: 12px;
|
|
1331
|
+
min-height: 44px;
|
|
1332
|
+
padding: 0 16px;
|
|
1333
|
+
border: 1px solid var(--ws-control);
|
|
1334
|
+
border-radius: 9px;
|
|
1335
|
+
background: var(--ws-glass);
|
|
1336
|
+
color: var(--ws-ink);
|
|
1337
|
+
font-size: 13px;
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1181
1340
|
/* Short landscape screens (iPhone at 852x393): the tablet rail must compact
|
|
1182
1341
|
instead of pushing Tools below the viewport. */
|
|
1183
1342
|
@media (min-width: 700px) and (max-width: 1099px) and (max-height: 500px) {
|
|
@@ -1374,9 +1533,24 @@ body.split-dragging { user-select: none; }
|
|
|
1374
1533
|
font-size: 12px;
|
|
1375
1534
|
line-height: 1.4;
|
|
1376
1535
|
}
|
|
1377
|
-
.workspace .banner.error { display:
|
|
1378
|
-
.workspace .banner.warn { display:
|
|
1379
|
-
|
|
1536
|
+
.workspace .banner.error { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; background: #f6d9d5; color: #5a1b15; }
|
|
1537
|
+
.workspace .banner.warn { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; background: #f4e6c2; color: #45360f; }
|
|
1538
|
+
/* A notice stays until the person has read it; it is not a toast. */
|
|
1539
|
+
.workspace .banner.info { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; background: #e7eef9; color: #1c3352; }
|
|
1540
|
+
.workspace .banner-text { flex: 1 1 12ch; min-width: 0; overflow-wrap: anywhere; }
|
|
1541
|
+
.workspace .banner button {
|
|
1542
|
+
flex: 0 0 auto;
|
|
1543
|
+
min-height: 36px;
|
|
1544
|
+
padding: 0 12px;
|
|
1545
|
+
border: 1px solid currentColor;
|
|
1546
|
+
border-radius: 8px;
|
|
1547
|
+
background: transparent;
|
|
1548
|
+
color: inherit;
|
|
1549
|
+
font-size: 12px;
|
|
1550
|
+
}
|
|
1551
|
+
@media (pointer: coarse) {
|
|
1552
|
+
.workspace .banner button { min-height: 44px; }
|
|
1553
|
+
}
|
|
1380
1554
|
|
|
1381
1555
|
.workspace .t1toast-host {
|
|
1382
1556
|
position: static;
|