@lysyi3m/sidecar 1.6.1 → 1.7.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.
@@ -3,6 +3,7 @@ import { effortLabel, modelLabel } from "../adapters/index.js";
3
3
  import { html, raw } from "./html.js";
4
4
  import { MARKS, markUrl } from "./marks.js";
5
5
  import { decisionState, flagsOf, reviewsOf } from "../cases/items.js";
6
+ import { SIDECAR_VERSION } from "../lib/version.js";
6
7
  import { foundNothingToReview } from "../turns/prompt.js";
7
8
  // The dashboard's markup, rendered on the server from the view model. Every element the live
8
9
  // stream may replace carries a stable id: the case header, and one id per timeline entry.
@@ -143,10 +144,10 @@ function shell(opts) {
143
144
  <link rel="stylesheet" href="/assets/app.css">
144
145
  <script type="module" src="/assets/app.js"></script>
145
146
  </head>
146
- <body>
147
+ <body data-sidecar-version="${SIDECAR_VERSION}">
147
148
  <div class="shell${opts.chrome.collapsed ? " is-collapsed" : ""}">
148
149
  <aside class="sidebar">
149
- <div class="sidebar-head"><a class="brand" href="/">${BRAND_MARK}sidecar</a></div>
150
+ <div class="sidebar-head"><a class="brand" href="/">${BRAND_MARK}sidecar</a><span class="brand-version">v${SIDECAR_VERSION}</span></div>
150
151
  ${sideList(opts.cases, opts.activeCase)}
151
152
  </aside>
152
153
  <main class="main"><div class="page">
@@ -227,7 +228,8 @@ export function casePage(model, cases, chrome = { collapsed: false }) {
227
228
  const content = html `${caseHead(model)}
228
229
  ${brief(model)}
229
230
  <p class="message problem" role="alert" data-problem hidden></p>
230
- <div class="timeline" id="timeline" data-stream="/api/cases/${model.caseId}/stream?after=${last}">${timelineUnits(model).map((u) => u.html)}</div>`;
231
+ <div class="timeline" id="timeline" data-stream="/api/cases/${model.caseId}/stream?after=${last}">${timelineUnits(model).map((u) => u.html)}</div>
232
+ <div class="to-top" data-to-top><a class="ref" href="#top">↑ Back to top</a></div>`;
231
233
  return shell({
232
234
  title: `${String(opened.title)} — sidecar`,
233
235
  cases,
@@ -119,6 +119,13 @@ button {
119
119
  text-decoration: none;
120
120
  }
121
121
 
122
+ .brand-version {
123
+ margin-left: 8px;
124
+ font-family: var(--font-mono);
125
+ font-size: 12px;
126
+ color: var(--ink-3);
127
+ }
128
+
122
129
  /* The mark: two linked squares — a driver and its navigator. */
123
130
  .brand-mark {
124
131
  width: 18px;
@@ -187,12 +194,39 @@ button {
187
194
  }
188
195
 
189
196
  .page {
197
+ --page-gap: 22px;
198
+ --page-end: 96px;
199
+ --entry-end: 16px;
200
+ --service-end: 10px;
190
201
  max-width: 1080px;
191
202
  margin: 0 auto;
192
- padding: 26px 32px 96px;
203
+ padding: 26px 32px var(--page-end);
193
204
  display: flex;
194
205
  flex-direction: column;
195
- gap: 22px;
206
+ gap: var(--page-gap);
207
+ }
208
+
209
+ /*
210
+ * A link back to the top of a long case. It fills the empty band between the last entry and the
211
+ * end of the page, centred in it, without making the page taller: the top margin takes back the
212
+ * flex gap and the last entry's bottom padding, the bottom margin the page's end padding. It shows
213
+ * only once the timeline holds more than 10 entries; CSS counts them, so streamed entries count too.
214
+ */
215
+ .to-top {
216
+ --last-end: var(--entry-end);
217
+ display: none;
218
+ align-items: center;
219
+ justify-content: center;
220
+ height: calc(var(--last-end) + var(--page-end));
221
+ margin: calc(-1 * (var(--page-gap) + var(--last-end))) 0 calc(-1 * var(--page-end));
222
+
223
+ .timeline:has(> .entry.service:last-child) + & {
224
+ --last-end: var(--service-end);
225
+ }
226
+
227
+ .timeline:has(> .entry:nth-child(11)) + & {
228
+ display: flex;
229
+ }
196
230
  }
197
231
 
198
232
  .topbar {
@@ -772,7 +806,7 @@ tbody td:first-child {
772
806
  }
773
807
 
774
808
  .entry-body {
775
- padding: 6px 0 16px;
809
+ padding: 6px 0 var(--entry-end);
776
810
  min-width: 0;
777
811
  }
778
812
 
@@ -993,7 +1027,7 @@ tbody td:first-child {
993
1027
  }
994
1028
 
995
1029
  .entry.service .entry-body {
996
- padding: 0 0 10px;
1030
+ padding: 0 0 var(--service-end);
997
1031
  }
998
1032
 
999
1033
  .entry.service .marker {
@@ -1053,7 +1087,8 @@ tbody td:first-child {
1053
1087
  }
1054
1088
 
1055
1089
  .page {
1056
- padding: 18px 16px 72px;
1090
+ --page-end: 72px;
1091
+ padding: 18px 16px var(--page-end);
1057
1092
  }
1058
1093
 
1059
1094
  /* The time moves from its gutter onto a line of its own above the entry. */
@@ -118,6 +118,7 @@ async function exportCase(caseId) {
118
118
  const page = document.querySelector(".page").cloneNode(true);
119
119
  page.querySelector(".topbar")?.remove();
120
120
  page.querySelector("[data-problem]")?.remove();
121
+ page.querySelector("[data-to-top]")?.remove();
121
122
  for (const node of page.querySelectorAll("[data-stream], [data-refresh]")) {
122
123
  node.removeAttribute("data-stream");
123
124
  node.removeAttribute("data-refresh");
@@ -136,7 +137,8 @@ async function exportCase(caseId) {
136
137
  }
137
138
  const note = document.createElement("footer");
138
139
  note.className = "export-note";
139
- note.textContent = `Exported from sidecar on ${utc(new Date().toISOString())}.`;
140
+ const version = document.body.dataset.sidecarVersion;
141
+ note.textContent = `Exported from sidecar v${version} on ${utc(new Date().toISOString())}.`;
140
142
  page.append(note);
141
143
 
142
144
  const file = document.implementation.createHTMLDocument(document.title);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lysyi3m/sidecar",
3
- "version": "1.6.1",
3
+ "version": "1.7.0",
4
4
  "description": "Lets one coding agent consult another mid-task: a driver asks, a read-only navigator answers",
5
5
  "license": "MIT",
6
6
  "repository": {