heyquilt 0.3.176 → 0.3.178

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/src/ui/tree.js CHANGED
@@ -1,5 +1,4 @@
1
- // The shared project's file tree: who edited what recently, and whose unfinished work is boxed.
2
- // Nobody holds files (no-holds, 2026-11-13): a box never stops anyone editing.
1
+ // The shared project's file tree: who edited what recently. Nobody holds files: anyone may edit any of them.
3
2
  import { esc, I, ago, colorFor, loadingNote } from './common.js'
4
3
 
5
4
  /** Where each person's chat files are kept (CHAT_FILES in pathrules.js, which the page can't load). */
@@ -27,21 +26,6 @@ function buildTree (files) {
27
26
  return root
28
27
  }
29
28
 
30
- const boxMineOf = (c, me) => c.by === me || c.of === me
31
-
32
- /** Boxes on files inside a folder: a collapsed folder shows them, so one deep in the tree is seen without opening every folder. */
33
- export function boxesInside (boxes, dir) {
34
- const pre = dir ? `${dir}/` : ''
35
- return (boxes || []).filter((c) => c && String(c.pattern).startsWith(pre))
36
- }
37
-
38
- /** The badge a collapsed folder shows for the boxes inside it: "Brandon", "you +1", with each box in the tooltip. */
39
- export function insideBadge (boxes, me) {
40
- if (!boxes.length) return ''
41
- const who = [...new Set(boxes.map((c) => boxMineOf(c, me) ? 'you' : c.by))]
42
- return `<span class="t-badge box inside" title="${esc(`Unfinished work inside:\n${boxes.map((c) => `${c.pattern}: ${boxMineOf(c, me) ? 'yours' : c.by}`).join('\n')}`)}">${I.box}${esc(who.length > 1 ? `${who[0]} +${who.length - 1}` : who[0])}</span>`
43
- }
44
-
45
29
  function hasRecent (node, me) {
46
30
  return node.files.some((f) => f.edited && f.edited.by !== me && Date.now() - f.edited.ts < RECENT_MS) ||
47
31
  [...node.dirs.values()].some((d) => hasRecent(d, me))
@@ -49,7 +33,7 @@ function hasRecent (node, me) {
49
33
 
50
34
  /**
51
35
  * @param {HTMLElement} el
52
- * @param {{ files: object[], boxes: object[] }} tree
36
+ * @param {{ files: object[] }} tree
53
37
  * @param {{ me: string, expanded: object, selected: string|null }} view
54
38
  */
55
39
  export function renderTree (el, tree, { me, expanded, selected }) {
@@ -59,9 +43,6 @@ export function renderTree (el, tree, { me, expanded, selected }) {
59
43
  const root = buildTree(files)
60
44
  const rows = []
61
45
 
62
- // A box (boxes.js): someone's unfinished work, marked in amber; theirs isn't in this folder yet.
63
- const boxMine = (c) => boxMineOf(c, me)
64
- const boxBadge = (c) => c ? `<span class="t-badge box${boxMine(c) ? ' own' : ''}" title="${esc(boxMine(c) ? 'Your unfinished work: in your folder only, until you commit it' : `${c.by}'s unfinished work: not in your folder until they commit it. Editing it opens the box. See it under them in People.`)}">${I.box}${esc(boxMine(c) ? 'you' : c.by)}</span>` : ''
65
46
  // Who just edited a file: a button to its Changes tab. Its +/− shows in the row's change card.
66
47
  const editBadge = (f, byOther) => `<button type="button" class="t-badge ${byOther ? 'edit' : 'mine'}" data-changes="${esc(f.path)}" aria-label="See what changed in ${esc(f.path)}">${esc(f.edited.by === me ? 'you' : f.edited.by)} · ${shortAgo(f.edited.ts)}</button>`
67
48
  const walk = (node, depth) => {
@@ -77,7 +58,7 @@ export function renderTree (el, tree, { me, expanded, selected }) {
77
58
  }
78
59
  rows.push(`<div class="t-row t-dir" role="treeitem" aria-expanded="${open}" tabindex="-1" data-dir="${esc(d.path)}" style="--depth:${depth}">
79
60
  <span class="t-caret${open ? ' open' : ''}">${I.caret}</span><span class="t-name">${esc(d.name)}</span>
80
- ${!open && hasRecent(d, me) ? '<span class="t-dot" title="Recently edited inside"></span>' : ''}${!open ? insideBadge(boxesInside(tree.boxes, d.path), me) : ''}
61
+ ${!open && hasRecent(d, me) ? '<span class="t-dot" title="Recently edited inside"></span>' : ''}
81
62
  <button class="t-more" data-more="${esc(d.path)}" data-kind="dir" aria-label="More for ${esc(d.name)}">${I.more}</button></div>`)
82
63
  if (open) walk(d, depth + 1)
83
64
  }
@@ -89,13 +70,9 @@ export function renderTree (el, tree, { me, expanded, selected }) {
89
70
  }
90
71
  const recent = !!f.edited && Date.now() - f.edited.ts < RECENT_MS
91
72
  const byOther = recent && f.edited.by !== me
92
- const box = f.box && f.box.pattern === f.path ? f.box : null
93
- // Whoever boxed it is the one editing it: their box badge says so, one badge is enough on a narrow row.
94
- const ghost = box && !boxMine(box)
95
- rows.push(`<div class="t-row t-file${selected === f.path ? ' on' : ''}${ghost ? ' ghost' : ''}" role="treeitem" tabindex="-1" data-file="${esc(f.path)}" style="--depth:${depth}" title="${esc(f.path)}">
73
+ rows.push(`<div class="t-row t-file${selected === f.path ? ' on' : ''}" role="treeitem" tabindex="-1" data-file="${esc(f.path)}" style="--depth:${depth}" title="${esc(f.path)}">
96
74
  <span class="t-ico">${I.file}</span><span class="t-name">${esc(f.name)}</span>
97
- ${recent && !(box && box.by === f.edited.by) ? editBadge(f, byOther) : ''}
98
- ${boxBadge(box)}
75
+ ${recent ? editBadge(f, byOther) : ''}
99
76
  <button class="t-more" data-more="${esc(f.path)}" data-kind="file" aria-label="More for ${esc(f.name)}">${I.more}</button></div>`)
100
77
  }
101
78
  }
package/src/ui-server.js CHANGED
@@ -176,7 +176,6 @@ export const STATIC = {
176
176
  '/changes.js': ['changes.js', 'text/javascript; charset=utf-8'],
177
177
  '/changes-seen.js': ['changes-seen.js', 'text/javascript; charset=utf-8'],
178
178
  '/diffview.js': ['diffview.js', 'text/javascript; charset=utf-8'],
179
- '/boxes.js': ['boxes.js', 'text/javascript; charset=utf-8'],
180
179
  '/releases.js': ['releases.js', 'text/javascript; charset=utf-8'],
181
180
  '/feed-convs.js': ['feed-convs.js', 'text/javascript; charset=utf-8'],
182
181
  '/loom.js': ['loom.js', 'text/javascript; charset=utf-8'],
@@ -1162,9 +1161,6 @@ export async function startUi ({ port = 7420, onShutdown, preview = false, repor
1162
1161
  'GET /api/sessions/:id/voice/speech-stream': (b, id, url) => voiceSpeechStream(get(id), url.searchParams.get('line') || ''),
1163
1162
  // The composer says while someone types (and stops when they clear it or send).
1164
1163
  'POST /api/sessions/:id/typing': (b, id) => get(id).setTyping(b.on !== false, { to: b.to || null }),
1165
- // Boxes (boxes.js): each one's change, for the people panel; and opening your own early (quilt_unpack).
1166
- 'GET /api/sessions/:id/boxes': (b, id) => get(id).boxes(),
1167
- 'POST /api/sessions/:id/unpack': async (b, id) => { const r = await get(id).unpack(Array.isArray(b.paths) ? b.paths : [b.path]); pushStatus(id); return r },
1168
1164
  'POST /api/sessions/:id/attach-from-workspace': async (b, id) => {
1169
1165
  const s = get(id)
1170
1166
  const workspace = (readConfig(s.root) || {}).workspace
package/src/boxes.js DELETED
@@ -1,36 +0,0 @@
1
- // Boxes as the app shows them (docs/superpowers/specs/2026-10-16-git-boxes-design.md): a box is
2
- // someone's unfinished work on one file. For each, what it changes from the version the viewer's
3
- // folder has (theirs: from before the box; ours: what git last committed), counted line by line.
4
- import { lineDiff } from './history.js'
5
-
6
- const isBin = (v) => !!v && typeof v === 'object' && v.binary === true
7
- const textOf = (v) => (v == null || isBin(v) ? '' : String(v))
8
-
9
- /**
10
- * One box for the app. `before` and `after` are the file's text, null (no file) or { binary: true }.
11
- * The diff is capped as history's are; added and removed count every line all the same.
12
- */
13
- export function boxEntry ({ box, mine = false, before = null, after = null }) {
14
- const kind = before == null && after != null ? 'new' : after == null && before != null ? 'deleted' : isBin(before) || isBin(after) ? 'binary' : 'edited'
15
- let added = 0
16
- let removed = 0
17
- let diff = ''
18
- if (kind !== 'binary') {
19
- diff = lineDiff(textOf(before), textOf(after))
20
- for (const line of lineDiff(textOf(before), textOf(after), { context: 0, max: Infinity }).split('\n')) {
21
- if (line.startsWith('+')) added++
22
- else if (line.startsWith('-')) removed++
23
- }
24
- }
25
- return {
26
- path: box.pattern,
27
- by: box.by,
28
- ...(box.of ? { of: box.of } : {}),
29
- ts: box.ts || 0,
30
- mine: !!mine,
31
- kind,
32
- added,
33
- removed,
34
- diff
35
- }
36
- }
package/src/ui/boxes.js DELETED
@@ -1,80 +0,0 @@
1
- // Boxes in the people panel (docs/mockups/2026-10-16-boxes.html, option C). A box is someone's
2
- // unfinished work on one file: everyone sees it, but it is in nobody else's folder until its owner
3
- // commits it. Each person's boxes are listed under them: "2 files not in your folder yet", each
4
- // file with its +/−, and its change opens in place (never in a dialog). A box never stops anyone:
5
- // editing someone else's boxed file opens it and merges the edit with their work. Your own (or your
6
- // AI's) has Unpack, which puts it in every folder now.
7
- import { esc, I, basename } from './common.js'
8
- import { diffLines } from './diffview.js'
9
-
10
- const files = (n) => `${n} file${n === 1 ? '' : 's'}`
11
-
12
- /** The line under a person: how many of their files are boxed, and where those are. */
13
- export function boxSummary (list) {
14
- if (!list.length) return 'No boxes'
15
- const mine = list.filter((b) => b.mine).length
16
- const theirs = list.length - mine
17
- return [theirs ? `${files(theirs)} not in your folder yet` : '', mine ? `${files(mine)} in your folder only` : ''].filter(Boolean).join(', ')
18
- }
19
-
20
- /** The boxes of any of `names` (a person, or each of a person's AI sessions). */
21
- export const boxesOf = (boxes, names) => boxes.filter((b) => names.includes(b.by))
22
-
23
- /** Boxes whose holder has no row in the panel (they left), as [holder, boxes] in the order first seen. */
24
- export function unplaced (boxes, shown) {
25
- const out = new Map()
26
- for (const b of boxes) if (!shown.includes(b.by)) out.set(b.by, [...(out.get(b.by) || []), b])
27
- return [...out]
28
- }
29
-
30
- /** What the app's boxes depend on in the session's status (`boxes`): a new one, or one gone. */
31
- export const boxesSig = (boxes) => (boxes || []).filter((c) => c && c.pattern && c.by).map((c) => `${c.by}\0${c.pattern}`).sort().join('\n')
32
-
33
- const delta = (b) => b.added || b.removed
34
- ? `<span class="bx-delta">${b.added ? `<span class="add">+${b.added}</span>` : ''}${b.added && b.removed ? ' ' : ''}${b.removed ? `<span class="del">−${b.removed}</span>` : ''}</span>`
35
- : ''
36
-
37
- function whatOf (b, holder) {
38
- const who = `<b>${esc(holder)}</b>'s unfinished work on <b>${esc(basename(b.path))}</b>`
39
- if (b.kind === 'new') return `${who}: a new file, not in your folder until they commit it`
40
- if (b.kind === 'deleted') return `${who}: they deleted it; it stays in your folder until they commit that`
41
- return `${who}: not in your folder until they commit it`
42
- }
43
-
44
- function changeOf (b) {
45
- if (b.kind === 'binary') return '<p class="bx-none">A binary file: no lines to show.</p>'
46
- if (!b.diff) return '<p class="bx-none">The same as your folder\'s version.</p>'
47
- return `<pre class="bx-diff">${diffLines(b.diff.replace(/\n$/, ''))}</pre>`
48
- }
49
-
50
- /**
51
- * One person's boxes in the Boxes sidebar, folded: one line saying how many files they have boxed,
52
- * and a click on it shows the files themselves (boxListHtml). `key`: whose they are (the row's name);
53
- * `unfolded`: the people whose boxes are showing. The rest of the options go to boxListHtml.
54
- */
55
- export function boxFoldHtml (list, { key = '', unfolded = new Set(), ...rest } = {}) {
56
- if (!list.length) return ''
57
- const shown = unfolded.has(key)
58
- const what = shown ? 'Hide' : 'Show'
59
- return `<button type="button" class="bs-fold" data-box-person="${esc(key)}" aria-expanded="${shown}" title="${what} ${esc(key)}'s ${files(list.length)}">${I.caret}<span class="bs-fold-sum">${esc(boxSummary(list))}</span></button>${shown ? boxListHtml(list, rest) : ''}`
60
- }
61
-
62
- /**
63
- * One person's boxes. `open`: the paths whose change is shown. `holder`: how people know whoever
64
- * made them ("Dex", "Dex's AI"). Your own say "Your" or "Your AI's" (one of your AI sessions).
65
- */
66
- export function boxListHtml (list, { me, open = new Set(), holder = '' } = {}) {
67
- if (!list.length) return ''
68
- return `<div class="pm-boxes">${list.map((b) => {
69
- const shown = open.has(b.path)
70
- const who = holder || b.by
71
- const row = `<button type="button" class="pm-box" data-box-toggle="${esc(b.path)}" aria-expanded="${shown}" title="${esc(b.mine ? `${b.path}: your unfinished work, in your folder only` : `${b.path}: ${who}'s unfinished work, not in your folder yet`)}">${I.box}<span class="pm-box-name">${esc(b.path)}</span>${delta(b)}</button>`
72
- const head = b.mine
73
- ? `${b.by === me ? 'Your' : 'Your AI\'s'} unfinished work: in your folder only, until you commit it. Unpack puts it in everyone's folder now.`
74
- : whatOf(b, who)
75
- const foot = b.mine ? '' : `<div class="bx-foot"><span class="bx-note">Editing it opens the box: your change goes in with ${esc(who)}'s work.</span></div>`
76
- const body = shown ? `<div class="bx-open"><div class="bx-head"><span class="bx-ico">${I.box}</span><span class="bx-what">${head}</span>${delta(b)}</div>${changeOf(b)}${foot}</div>` : ''
77
- const unpack = b.mine ? `<button type="button" class="btn sm bx-unpack" data-unpack="${esc(b.path)}">${I.unpack}Unpack ${esc(basename(b.path))}</button>` : ''
78
- return row + body + unpack
79
- }).join('')}</div>`
80
- }