samagotchi 0.164.0 → 0.165.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.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +52 -1
  3. data/docs/architecture.md +7 -5
  4. data/docs/cli.md +20 -13
  5. data/docs/configuration.md +5 -1
  6. data/docs/guardrails.md +13 -16
  7. data/docs/internals/block-renderers.md +1 -1
  8. data/docs/internals/bridge.md +4 -3
  9. data/docs/internals/bundles.md +4 -2
  10. data/docs/internals/inline-widgets.md +8 -1
  11. data/docs/internals/web-frontend.md +36 -9
  12. data/docs/memory.md +12 -7
  13. data/docs/plugins.md +6 -4
  14. data/docs/releasing.md +6 -2
  15. data/docs/scheduling.md +25 -3
  16. data/docs/sessions.md +8 -6
  17. data/docs/testing.md +28 -4
  18. data/lib/samagotchi/block_renderers.rb +3 -6
  19. data/lib/samagotchi/bridge/card_store.rb +2 -1
  20. data/lib/samagotchi/bridge/turn_accumulator.rb +7 -8
  21. data/lib/samagotchi/bridge.rb +45 -3
  22. data/lib/samagotchi/bundle_command/installed_check.rb +2 -1
  23. data/lib/samagotchi/bundles/system/manifest.yml +1 -1
  24. data/lib/samagotchi/chi_home.rb +44 -2
  25. data/lib/samagotchi/client_id.rb +34 -3
  26. data/lib/samagotchi/compat.rb +36 -0
  27. data/lib/samagotchi/context_command.rb +3 -0
  28. data/lib/samagotchi/context_providers.rb +5 -6
  29. data/lib/samagotchi/context_sources.rb +2 -2
  30. data/lib/samagotchi/continue_intent.rb +50 -5
  31. data/lib/samagotchi/events.rb +4 -4
  32. data/lib/samagotchi/extension_load.rb +2 -1
  33. data/lib/samagotchi/guardrails/child_boundary.rb +7 -27
  34. data/lib/samagotchi/guardrails/rules.rb +11 -9
  35. data/lib/samagotchi/guardrails/targets.rb +3 -4
  36. data/lib/samagotchi/inline_widgets.rb +16 -1
  37. data/lib/samagotchi/memory_bundle/provenance.rb +46 -4
  38. data/lib/samagotchi/memory_bundle/status.rb +2 -1
  39. data/lib/samagotchi/memory_command.rb +3 -0
  40. data/lib/samagotchi/memory_orphans.rb +4 -7
  41. data/lib/samagotchi/memory_paths.rb +64 -7
  42. data/lib/samagotchi/memory_usage.rb +1 -1
  43. data/lib/samagotchi/plugin/sessions.rb +4 -2
  44. data/lib/samagotchi/project_command.rb +4 -1
  45. data/lib/samagotchi/project_id_clash.rb +37 -26
  46. data/lib/samagotchi/project_init.rb +24 -7
  47. data/lib/samagotchi/reply_wait/poll.rb +2 -1
  48. data/lib/samagotchi/schedules.rb +124 -106
  49. data/lib/samagotchi/send_command.rb +71 -18
  50. data/lib/samagotchi/session.rb +3 -2
  51. data/lib/samagotchi/session_access/local.rb +19 -2
  52. data/lib/samagotchi/session_access/remote.rb +15 -4
  53. data/lib/samagotchi/session_chain/links.rb +109 -0
  54. data/lib/samagotchi/session_chain.rb +7 -19
  55. data/lib/samagotchi/session_continue.rb +138 -54
  56. data/lib/samagotchi/session_inbox_delivery.rb +57 -38
  57. data/lib/samagotchi/session_manager/delivery.rb +104 -18
  58. data/lib/samagotchi/session_manager/removal.rb +13 -7
  59. data/lib/samagotchi/session_manager.rb +1 -0
  60. data/lib/samagotchi/session_retention.rb +20 -10
  61. data/lib/samagotchi/session_setup.rb +31 -1
  62. data/lib/samagotchi/state_format.rb +12 -8
  63. data/lib/samagotchi/terminal_ui/attach_launcher.rb +6 -7
  64. data/lib/samagotchi/terminal_ui.rb +20 -9
  65. data/lib/samagotchi/tools/delegate.rb +2 -1
  66. data/lib/samagotchi/verify_fresh.rb +4 -1
  67. data/lib/samagotchi/version.rb +1 -1
  68. data/lib/samagotchi/web/public/activity.js +2 -2
  69. data/lib/samagotchi/web/public/app.js +13 -13
  70. data/lib/samagotchi/web/public/bar_fold.js +293 -0
  71. data/lib/samagotchi/web/public/card.js +1 -1
  72. data/lib/samagotchi/web/public/composer_mode.js +5 -7
  73. data/lib/samagotchi/web/public/index.html +132 -65
  74. data/lib/samagotchi/web/public/info_bar.js +28 -16
  75. data/lib/samagotchi/web/public/info_bar_model.js +70 -1
  76. data/lib/samagotchi/web/public/more_sheet.js +98 -40
  77. data/lib/samagotchi/web/public/stage_view.js +3 -1
  78. data/lib/samagotchi/web/public/stream_handlers.js +1 -1
  79. data/lib/samagotchi/web/public/turn_events.js +0 -122
  80. data/lib/samagotchi/web/public/turn_model.js +1 -1
  81. data/lib/samagotchi/web/public/widget_picks.js +18 -3
  82. data/lib/samagotchi/web/session_control.rb +15 -2
  83. data/lib/samagotchi/web/session_create.rb +4 -2
  84. data/lib/samagotchi/web/update_check.rb +27 -8
  85. metadata +3 -1
@@ -100,7 +100,7 @@ main{flex:1;display:flex;flex-direction:column;gap:16px;padding:16px;overflow:au
100
100
  .revise-btn:disabled{cursor:default}
101
101
  .revise-btn.armed,.revise-btn.armed:hover:not(:disabled){opacity:1;color:var(--on-solid);background:var(--accent-strong);border-color:var(--accent-strong)}
102
102
  .bubble.output:hover+.revise-row .revise-btn,.revise-row:hover .revise-btn,.revise-row.stacked .revise-btn,.revise-btn:focus-visible{opacity:1}
103
- @media (hover:none){.revise-btn{opacity:.55}}
103
+ @media (hover:none){.revise-btn{opacity:.8}}
104
104
  .stack-versions{position:relative;font-size:12px;color:var(--text-muted)}
105
105
  .stack-versions>summary{list-style:none;cursor:pointer;padding:1px 8px;border-radius:999px;border:1px solid var(--accent-border);background:var(--accent-bg);color:var(--text-2);white-space:nowrap;font-variant-numeric:tabular-nums}
106
106
  .stack-versions>summary::-webkit-details-marker{display:none}
@@ -129,7 +129,7 @@ main{flex:1;display:flex;flex-direction:column;gap:16px;padding:16px;overflow:au
129
129
  .bubble.output.markdown,.bubble.user>.user-message.markdown{white-space:normal}
130
130
  .bubble.output.markdown pre,.bubble.user>.user-message.markdown pre{overflow:auto;padding:10px;border-radius:8px;background:var(--bg-inset)}
131
131
  .bubble.output.markdown code,.bubble.user>.user-message.markdown code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.88em}
132
- .bubble.output.markdown :not(pre)>code,.bubble.user>.user-message.markdown :not(pre)>code{background:var(--bg-inset);border:1px solid var(--border);border-radius:4px;padding:1px 5px;color:var(--text)}
132
+ .bubble.output.markdown :not(pre)>code,.bubble.user>.user-message.markdown :not(pre)>code{background:var(--bg-inset);border:1px solid var(--border);border-radius:4px;padding:1px 3px;color:var(--text)}
133
133
  .bubble.output.markdown pre,.bubble.user>.user-message.markdown pre{font-size:13px;line-height:1.45;border:1px solid var(--border)}
134
134
  /* Code highlighting (markdown_renderer.rb): syntect scope classes, hl-prefixed, coloured from the palette's --code-* tokens. More classes win over fewer (a function name is also "entity"). */
135
135
  .syntax-highlighting{color:var(--code-text)}
@@ -460,7 +460,7 @@ button.system-one-wrong,.system-one-wrong.marked{flex:none;padding:1px 6px;borde
460
460
  .md-compact hr{border:0;border-top:1px solid var(--border);margin:8px 0}
461
461
  .md-compact blockquote{border-left:3px solid var(--border-strong);padding-left:10px;color:var(--md-blockquote-color)}
462
462
  .md-compact code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.88em}
463
- .md-compact :not(pre)>code{background:var(--bg-inset);border:1px solid var(--border);border-radius:4px;padding:0 4px;color:var(--md-code-color)}
463
+ .md-compact :not(pre)>code{background:var(--bg-inset);border:1px solid var(--border);border-radius:4px;padding:0 3px;color:var(--md-code-color)}
464
464
  .md-compact strong{color:var(--md-strong-color)}
465
465
  .md-compact pre{overflow:auto;padding:6px 8px;border-radius:6px;background:var(--bg-inset);border:1px solid var(--border);font-size:var(--md-pre-size);line-height:1.45;white-space:pre}
466
466
  .md-compact table{border-collapse:collapse;display:block;max-width:100%;overflow:auto}
@@ -616,7 +616,7 @@ button.system-one-wrong,.system-one-wrong.marked{flex:none;padding:1px 6px;borde
616
616
  .card-body ul,.card-body ol{margin:0 0 6px 20px}
617
617
  .card-body pre{margin:0;white-space:pre-wrap;word-break:break-word;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12.5px;background:var(--bg-inset);border:1px solid var(--border);border-radius:6px;padding:8px 10px}
618
618
  .card-body>pre:only-child{background:transparent;border:none;padding:0;font-family:inherit;font-size:inherit}
619
- .card-body :not(pre)>code{background:var(--bg-inset);border:1px solid var(--border);border-radius:4px;padding:1px 5px;font-size:.88em}
619
+ .card-body :not(pre)>code{background:var(--bg-inset);border:1px solid var(--border);border-radius:4px;padding:1px 3px;font-size:.88em}
620
620
  .card-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
621
621
  .card-action{font-size:12.5px;padding:4px 10px}
622
622
  .card-error{color:var(--danger);font-size:12px;margin-top:6px}
@@ -640,6 +640,18 @@ button.system-one-wrong,.system-one-wrong.marked{flex:none;padding:1px 6px;borde
640
640
  .bubble.output.markdown .code-wrap>pre,.bubble.user>.user-message.markdown .code-wrap>pre{margin:0}
641
641
  .code-wrap>.copy-btn{top:5px;right:5px}
642
642
  @media (hover:none){.copy-btn{opacity:.55}}
643
+ /* On touch an answer's button is always drawn, so it floats in its corner (negative margins: back at 6px from it) and the
644
+ first line wraps short of it instead of running under it. A table or a code block first would only narrow beside it:
645
+ it starts under the button. Copied, the button keeps its width (a reflow on every tap): its label is drawn over the
646
+ text to its left, as the absolute button's is. */
647
+ @media (hover:none){
648
+ .bubble.output>.copy-btn{position:relative;top:auto;right:auto;float:right;margin:-6px -8px 2px 6px}
649
+ .answer-fold:not(.folded)+.bubble.output>.copy-btn{margin-top:-2px}
650
+ .ts-answer>.bubble.output>.copy-btn{margin:0 0 2px 6px}
651
+ .bubble.output>.copy-btn+:is(table,.code-wrap,pre){clear:right}
652
+ .bubble.output>.copy-btn[data-copied]{min-width:26px}
653
+ .bubble.output>.copy-btn[data-copied]::after{position:absolute;top:-1px;right:-1px;bottom:-1px;display:flex;align-items:center;padding:0 7px;border:1px solid var(--border-strong);border-radius:6px;background:var(--bg-raised)}
654
+ }
643
655
  /* Where the code button always shows (touch) or a phone's narrow block, the code starts under it: a strip above the first line holds the button (a line as wide as the block, or one that scrolls, would run under it). */
644
656
  @media (max-width:600px),(hover:none){.bubble.output.markdown .code-wrap>pre,.bubble.user>.user-message.markdown .code-wrap>pre{padding-top:32px}}
645
657
  /* The dock is the composer card (composer.css .composer-card): the text field, a toolbar row, the info bar as its footer. */
@@ -652,6 +664,16 @@ body.has-session #stage,body.has-session #history{background:transparent}
652
664
  body.no-glass.has-session #center{background:var(--bg);border-color:var(--border)}
653
665
  body.has-session #dock{position:absolute;left:16px;right:16px;bottom:16px;margin:0;z-index:3}
654
666
  body.has-session #history{padding-bottom:calc(var(--dock-h,160px) + 32px)}
667
+ /* A phone's session panel runs edge to edge: its sides, corners and bottom line go (main's 16px side padding is taken
668
+ back), so only the message cards are framed and an answer gets the width. The history, the objectives' strip and the
669
+ card keep 8px sides; the card's bottom offset (16px) and the history's bottom padding stay, so stage_frame.js's fitCap
670
+ reads the same. */
671
+ @media(max-width:600px){
672
+ body.has-session #center{margin:0 -16px;border-width:1px 0 0;border-radius:0}
673
+ body.has-session #history{padding-left:8px;padding-right:8px}
674
+ body.has-session #objectivesStrip{padding-left:8px;padding-right:8px}
675
+ body.has-session #dock{left:8px;right:8px}
676
+ }
655
677
  /* The delivery line (delivery_line.js): a session's row above the text field, always there so the composer never changes height: the key hint while idle; while a turn runs, where a message typed now goes in, then the cut and queue links. One quiet row, ellipsised; a phone gets the short text and chips. */
656
678
  #deliveryLine{display:flex;align-items:center;gap:10px}
657
679
  #deliveryLine[hidden]{display:none}
@@ -1094,14 +1116,15 @@ button.ws-row:hover:not(:disabled){filter:none}@media(hover:hover){button.ws-row
1094
1116
  .bubble.question.approval .question-option{padding:5px 8px}
1095
1117
  }
1096
1118
  @media (prefers-reduced-motion:reduce){.turn-stage.enter,.ts-arrive,.ts-headline.fresh,.ts-tick.running,.ts-mark,.ts-spin,.turn-work:not(.done) .activity-status.running::before{animation:none}.turn-stage.leaving,#center.reserve-easing #history{transition:none}}
1097
- #infoBar{display:flex;background:transparent;border-radius:0 0 16px 16px;color:var(--text-2);gap:10px;align-items:flex-start;flex-wrap:wrap;flex-shrink:0;transition:opacity 280ms ease}
1119
+ /* The session bar is one row at every width (bar_fold.js): what doesn't fit folds into ⋯. It wraps only for
1120
+ #contextChips, a line of its own: the info's basis is 0, so the row's buttons never move to a line of theirs. */
1121
+ #infoBar{display:flex;background:transparent;border-radius:0 0 16px 16px;color:var(--text-2);gap:10px;align-items:center;flex-wrap:wrap;flex-shrink:0;transition:opacity 280ms ease}
1098
1122
  #infoBar.visible{display:flex}
1099
- /* The meta row keeps its room: with a plain flex:1 the bar's own buttons (continue, archive, stop session, delete)
1100
- shrink it to a narrow column in a small window and its items wrap into five lines. With a 640px basis they share
1101
- the line while they fit; when they don't, the buttons wrap to a line of their own (the bar already wraps) and the
1102
- meta keeps the width. */
1103
- #infoBar .info{flex:1 1 640px;min-width:0;font-size:13px;line-height:1.4;word-break:break-word;display:flex;flex-direction:column;gap:2px}
1104
- #infoBar .meta{font-size:11px;display:flex;gap:8px;flex-wrap:wrap;align-items:center}
1123
+ /* The info takes the room the buttons leave; the fold keeps its chips within it (only pinned ones left, it clips). */
1124
+ #infoBar .info{flex:1 1 0;min-width:0;overflow:hidden;font-size:13px;line-height:1.4;display:flex;flex-direction:column;gap:2px}
1125
+ #infoBar .meta{font-size:11px;display:flex;gap:8px;flex-wrap:nowrap;white-space:nowrap;align-items:center}
1126
+ /* Nothing on the row shrinks: a chip's width is its natural one, as the fold measures it (bar_fold.js). */
1127
+ #infoBar .meta>*,#infoBar .meta .bar-group>*{flex:none}
1105
1128
  /* The id is a button (a click copies the full id, app.js): its own padding and no button look, the #infoBar button rule aside. */
1106
1129
  #infoBar .meta .id{padding:2px 6px;border-radius:6px;border:1px solid transparent;background:transparent;cursor:pointer;font-family:ui-monospace,monospace;font-weight:700;font-size:12px;color:var(--accent)}
1107
1130
  @media(hover:hover){#infoBar .meta .id:hover:not(:disabled){filter:none;border-color:var(--accent-border);background:var(--accent-bg)}}
@@ -1115,32 +1138,43 @@ button.ws-row:hover:not(:disabled){filter:none}@media(hover:hover){button.ws-row
1115
1138
  #infoBar .meta .dir{font-family:ui-monospace,monospace;font-size:11px;color:var(--text-muted);max-width:48ch;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;direction:rtl;text-align:left}
1116
1139
  /* The footer sits on the card's glass: its chips are tinted, not solid, so the glass reads through them. */
1117
1140
  #infoBar .meta .model{font-size:11px;padding:2px 6px;border-radius:6px;background:color-mix(in srgb,var(--bg-hover) 55%,transparent);color:var(--text-3)}
1118
- /* The meta's three groups (info_bar.js): setup | relations | telemetry, a hairline between two. */
1141
+ /* The meta's four groups (info_bar.js): identity | setup | relations | trail, a hairline before each but the first. */
1119
1142
  #infoBar .meta .bar-group{display:flex;gap:8px;align-items:center;min-width:0;flex:none}
1120
1143
  #infoBar .meta .bar-sep{flex:none;width:1px;height:14px;background:var(--border-strong)}
1121
- /* Above the phone's one scrolling line the meta is one line too: the telemetry takes the room left and its folder gives
1122
- way first (it already loses its start), then the model chip, down to 10ch; a chip is capped, cut with "…", their full
1123
- text in the title. The two groups are column grids: the giving chip's track (minmax(…, max-content)) leaves the
1124
- other chips as the group's min-content, so a group never shrinks under its fixed chips (they once slid under
1125
- continue →), and the info keeps that min-width: past it the bar's buttons wrap to a line of their own. */
1126
- @media(min-width:601px){
1127
- #infoBar .info{min-width:auto}
1128
- #infoBar .meta{flex-wrap:nowrap}
1129
- #infoBar .meta .bar-group:is(.setup,.telemetry){display:grid;grid-auto-flow:column;grid-auto-columns:max-content}
1130
- #infoBar .meta .bar-group.setup{flex:0 1 auto;min-width:auto;grid-template-columns:max-content max-content minmax(10ch,max-content)}
1131
- #infoBar .meta .bar-group.telemetry{flex:1 1 0;min-width:auto;grid-template-columns:minmax(0,max-content)}
1132
- #infoBar .meta .telemetry>.dir{max-width:48ch}
1133
- #infoBar .meta .model{max-width:40ch;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
1134
- }
1135
- /* Below 900px the buttons already have a line of their own, and the meta's one line can be wider than the bar: its
1136
- groups wrap instead of being cut, the telemetry first. The setup's basis is 0 (its min-content, the model at 10ch)
1137
- and its grow wins up to its max-content, so a group moves down only when the min-contents don't fit; the room left
1138
- is the telemetry's (its folder). The info never asks for more than the bar. */
1139
- @media(min-width:601px) and (max-width:899px){
1140
- #infoBar .info{max-width:100%}
1141
- #infoBar .meta{flex-wrap:wrap;row-gap:4px}
1142
- #infoBar .meta .bar-group.setup{flex:1000 1 0;max-width:max-content}
1143
- }
1144
+ /* A chip is capped, cut with "…", its full text in the title: the model (and ⚙'s values) at 40ch, the folder at 48ch
1145
+ (its own rule above). The caps hold while the fold measures, so a chip's measured width is its drawn one. */
1146
+ #infoBar .meta .model{max-width:40ch;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
1147
+ /* The fold (bar_fold.js) as attributes on #infoBar: a folded item is display:none (still in the DOM: ⋯'s rows click
1148
+ it), ⚙ compact is its icon with the dot when the session set its own, an empty group goes with its hairline. One
1149
+ selector per BAR_ITEMS key (info_bar_model.js; info_bar_fold_css.test.js checks every foldable key has one). */
1150
+ #infoBar[data-folded~="id"] .meta .id,
1151
+ #infoBar[data-folded~="continue"] #infoContinueBtn,
1152
+ #infoBar[data-folded~="settings"] .meta .settings-chip,
1153
+ #infoBar[data-folded~="worker"] .meta .worker-badge,
1154
+ #infoBar[data-folded~="speed"] .meta .speed,
1155
+ #infoBar[data-folded~="stop"] #infoStopBtn,
1156
+ #infoBar[data-folded~="prev"] .meta .chain-prev,
1157
+ #infoBar[data-folded~="next"] .meta .chain-next,
1158
+ #infoBar[data-folded~="pruned"] .meta .chain-pruned,
1159
+ #infoBar[data-folded~="parent"] .meta .parent,
1160
+ #infoBar[data-folded~="time"] .meta .session-time,
1161
+ #infoBar[data-folded~="model"] .meta .model-name,
1162
+ #infoBar[data-folded~="delegates"] .meta .children-chip,
1163
+ #infoBar[data-folded~="participants"] .meta .participants-chip,
1164
+ #infoBar[data-folded~="workingSet"] .meta .ws-chip,
1165
+ #infoBar[data-folded~="memories"] .meta .mem-chip,
1166
+ #infoBar[data-folded~="notes"] .meta .notes-chip,
1167
+ #infoBar[data-folded~="toolkit"] .meta .tools-chip,
1168
+ #infoBar[data-folded~="dir"] .meta .dir,
1169
+ #infoBar[data-folded~="archive"] #infoArchiveBtn,
1170
+ #infoBar[data-folded~="delete"] #infoDeleteBtn,
1171
+ #infoBar[data-empty-groups~="identity"] .meta .bar-group.identity,
1172
+ #infoBar[data-empty-groups~="setup"] .meta :is(.bar-group.setup,.sep-setup),
1173
+ #infoBar[data-empty-groups~="relations"] .meta :is(.bar-group.relations,.sep-relations),
1174
+ #infoBar[data-empty-groups~="trail"] .meta :is(.bar-group.trail,.sep-trail){display:none}
1175
+ #infoBar[data-compact~="settings"] .meta .settings-chip .sc-own{display:none}
1176
+ #infoBar[data-compact~="settings"] .meta .settings-chip.own{padding-right:6px}
1177
+ #infoBar[data-compact~="settings"] .meta .settings-chip.own::after{content:"";position:absolute;top:3px;right:3px;width:5px;height:5px;border-radius:50%;background:var(--accent)}
1144
1178
  /* The plain chips (spans, links) and the status take the button chips' 1px border, transparent and outside their tint, so every chip is one height: a chip wrapping onto a row of plain ones doesn't grow it. */
1145
1179
  #infoBar .meta :is(span,a).model,#infoBar .meta .status{border:1px solid transparent;background-clip:padding-box}
1146
1180
  /* The chips a running turn rewrites (the session clock each second, the last generation's speed, ctx): tabular digits in a reserved width, so a tick ("9.5s" → "10s" → "1m 00s") or a new number doesn't widen the line and move the chips after it. The speed and the clock show from the session's start, a muted placeholder until there is a number. */
@@ -1157,8 +1191,7 @@ button.ws-row:hover:not(:disabled){filter:none}@media(hover:hover){button.ws-row
1157
1191
  #infoBar .meta .worker-restart{padding:1px 8px;border-radius:5px;font-size:11px;font-weight:600;background:var(--bg-raised);color:var(--warn-bright);border:1px solid var(--warn-border)}
1158
1192
  @media(hover:hover){#infoBar .meta .worker-restart:hover:not(:disabled){background:var(--warn-border);color:var(--on-warn)}}
1159
1193
  #infoBar .meta .worker-restart:disabled{opacity:.7;cursor:default}
1160
- /* The bar's action buttons are one flex item: when they don't fit beside the info line they wrap to a line of their
1161
- own together, never one button alone. */
1194
+ /* The bar's action buttons (continue →, stop session; archive and delete live in ⋯), right-aligned, never moving. */
1162
1195
  #infoBar .info-actions{display:flex;flex:none;gap:10px;align-items:center}
1163
1196
  #infoBar button{padding:4px 12px;border-radius:8px;font-size:12px;font-weight:600}
1164
1197
  #infoBar #infoStopBtn{background:var(--bg-raised);color:var(--warn-text);border:1px solid var(--border-strong)}
@@ -1170,7 +1203,7 @@ button.ws-row:hover:not(:disabled){filter:none}@media(hover:hover){button.ws-row
1170
1203
  /* The composer folded away (composer_grip.js, composer.css): the info bar is the page's bottom edge; the plugins' setup row folds with it. */
1171
1204
  body.has-session.composer-folded #initRow{display:none}
1172
1205
  body.has-session.composer-folded #infoBar{border-top-color:transparent}
1173
- /* The ⚙ chip (settings_chip.js): a model-like chip that opens the session's settings panel; accent when the session set its own (capped like the model chip in the min-width:601px rule above, the full text in its tooltip; a phone shows ⚙ with a dot). */
1206
+ /* The ⚙ chip (settings_chip.js): a model-like chip that opens the session's settings panel; accent when the session set its own (capped like the model chip above, the full text in its tooltip; compact, as on a phone, ⚙ with a dot). */
1174
1207
  #infoBar .meta .settings-chip{position:relative;padding:2px 6px;border-radius:6px;font-size:11px;font-weight:400;border:1px solid transparent;cursor:pointer;font-family:inherit;white-space:nowrap}
1175
1208
  #infoBar .meta .settings-chip[aria-expanded="true"]{color:var(--text);border-color:var(--accent-border);background:var(--accent-bg)}@media(hover:hover){#infoBar .meta .settings-chip:hover{color:var(--text);border-color:var(--accent-border);background:var(--accent-bg)}}
1176
1209
  #infoBar .meta .settings-chip.own{color:var(--accent);border-color:var(--accent-border)}
@@ -1370,46 +1403,39 @@ body.has-session.composer-folded #infoBar{border-top-color:transparent}
1370
1403
  @media(hover:hover){.ctx-pop-actions button:hover{color:var(--text-hover)}}
1371
1404
  .ctx-pop-actions .ctx-pop-detach{color:var(--text-muted);background:transparent}
1372
1405
  @media(hover:hover){.ctx-pop-actions .ctx-pop-detach:hover{color:var(--danger-text);border-color:color-mix(in srgb,var(--danger) 55%,transparent)}}
1373
- /* ⋯ (more_sheet.js): a phone's alone. */
1374
- #infoBar #infoMoreBtn{display:none}
1375
- /* Phones: the footer is one line with no swiping: id, status, model (it gives way first), ⚙ and ⋯. The other chips and the
1376
- four buttons stay in the DOM, unseen: ⋯'s sheet clicks them, and what they open is placed at ⋯ (chip_popover.js). */
1406
+ /* ⋯ (more_sheet.js): on the row at every width, pinned at its end; on a desktop the count of what it holds for the
1407
+ row (none at 0), its dot when something folded asks for a look. */
1408
+ #infoBar #infoMoreBtn{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:5px;flex:none;min-height:24px;padding:0 8px;font-size:14px;line-height:1;letter-spacing:1px;color:var(--text-3);background:var(--bg-raised);border:1px solid var(--border-strong)}
1409
+ #infoBar #infoMoreBtn .more-count{font-size:11px;font-weight:600;letter-spacing:0;font-variant-numeric:tabular-nums}
1410
+ #infoBar #infoMoreBtn .more-count:empty{display:none}
1411
+ #infoBar #infoMoreBtn[aria-expanded="true"]{color:var(--text);border-color:var(--accent-border);background:var(--accent-bg)}
1412
+ #infoBar #infoMoreBtn[data-attention]::after{content:"";position:absolute;top:3px;right:3px;width:6px;height:6px;border-radius:50%;background:var(--accent)}
1413
+ #infoBar #infoMoreBtn[data-attention="warn"]::after{background:var(--warn-bright)}
1414
+ /* Phones: the row is status, ctx, speed, ⚙ and ⋯ (the fold's phone profile); the rest is in ⋯'s sheet. */
1377
1415
  @media(max-width:600px){
1378
- #infoBar{flex-wrap:nowrap;align-items:center;gap:6px;padding:6px 10px 8px}
1379
- #infoBar .info{flex:1 1 0}
1380
- #infoBar .meta{flex-wrap:nowrap;white-space:nowrap;gap:6px}
1381
- #infoBar .meta .id{padding:2px 3px}
1416
+ #infoBar{align-items:center;gap:6px;padding:6px 10px 8px}
1417
+ #infoBar .meta{gap:6px}
1382
1418
  #infoBar .meta .status{padding:2px 5px}
1383
- #infoBar .meta>*,#infoBar .meta .bar-group>*{flex-shrink:0}
1384
- /* One run: the groups' chips are the meta's. */
1419
+ /* One run: the groups' chips are the meta's, no hairlines. */
1385
1420
  #infoBar .meta .bar-group{display:contents}
1386
1421
  #infoBar .meta .bar-sep{display:none}
1387
- #infoBar .meta :is(.tools-chip,.notes-chip,.mem-chip,.ws-chip,.chain-link,.chain-pruned,.parent,.children-chip,.participants-chip,.dir,.ctx,.speed,.session-time,.worker-badge){display:none}
1388
- #infoBar .info-actions{display:none}
1389
- #infoBar .meta .status+.model{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis}
1390
- /* ⚙ alone, the start page's dot when the session set its own (its values in the tooltip and accessible name). */
1391
- #infoBar .meta .settings-chip .sc-own{display:none}
1392
- #infoBar .meta .settings-chip.own{padding-right:6px}
1393
- #infoBar .meta .settings-chip.own::after{content:"";position:absolute;top:3px;right:3px;width:5px;height:5px;border-radius:50%;background:var(--accent)}
1394
1422
  /* ⚙ and ⋯: bigger to the thumb than to the eye. 2 px of negative margin keep the row its height, and each one's ::before reaches the foot's edges for the tap. */
1395
1423
  #infoBar .meta .settings-chip{margin:-2px 0 -2px auto;min-width:32px;min-height:30px;justify-content:center}
1396
1424
  #infoBar .meta .settings-chip::before,#infoBar #infoMoreBtn::before{content:"";position:absolute;inset:-4px -3px -6px}
1397
- #infoBar #infoMoreBtn{position:relative;display:inline-flex;align-items:center;justify-content:center;flex:none;width:38px;height:30px;margin:-2px 0;padding:0;font-size:16px;line-height:1;letter-spacing:1px;color:var(--text-3);background:var(--bg-raised);border:1px solid var(--border-strong)}
1398
- #infoBar #infoMoreBtn[aria-expanded="true"]{color:var(--text);border-color:var(--accent-border);background:var(--accent-bg)}
1399
- #infoBar #infoMoreBtn[data-attention]::after{content:"";position:absolute;top:4px;right:4px;width:6px;height:6px;border-radius:50%;background:var(--accent)}
1400
- #infoBar #infoMoreBtn[data-attention="warn"]::after{background:var(--warn-bright)}
1401
- /* The attached context's chips get a second line of their own (only when there are some), scrolling sideways. */
1402
- #infoBar:has(#contextChips:not([hidden])){flex-wrap:wrap;row-gap:4px}
1403
- #infoBar:has(#contextChips:not([hidden])) .info{flex-basis:calc(100% - 44px)}
1425
+ #infoBar #infoMoreBtn{width:38px;height:30px;margin:-2px 0;padding:0;font-size:16px}
1426
+ #infoBar #infoMoreBtn .more-count{display:none}
1427
+ #infoBar #infoMoreBtn[data-attention]::after{top:4px;right:4px}
1428
+ /* The attached context's chips: their line scrolls sideways. */
1404
1429
  #contextChips{order:1;flex:1 0 100%;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}
1405
1430
  #contextChips::-webkit-scrollbar{display:none}
1406
1431
  #contextChips>*{flex-shrink:0}
1407
1432
  #infoBar button{padding:4px 8px}
1408
1433
  }
1409
- /* ⋯'s sheet (more_sheet.js): a row per chip the phone's bar folded away, the telemetry, the actions. */
1434
+ /* ⋯'s menu (more_sheet.js): a row per chip the bar folded away, the folded telemetry, the actions; its grip on a phone's sheet alone. */
1410
1435
  .more-sheet{gap:2px;font-size:13.5px}
1411
1436
  .more-sheet.sheet{border-radius:14px;padding:10px 14px 12px;box-shadow:0 0 0 100vmax color-mix(in srgb,var(--bg) 62%,transparent)}
1412
1437
  .more-grip{flex:none;align-self:center;width:34px;height:4px;border-radius:2px;background:var(--border-strong);margin-bottom:4px}
1438
+ .more-sheet:not(.sheet) .more-grip{display:none}
1413
1439
  .more-rows{display:flex;flex-direction:column}
1414
1440
  .more-row{display:flex;align-items:center;justify-content:space-between;gap:12px;box-sizing:border-box;width:100%;min-height:40px;padding:6px 0;border:0;border-bottom:1px solid var(--border);border-radius:0;background:transparent;color:var(--text);font:inherit;text-align:left;text-decoration:none;cursor:pointer}
1415
1441
  div.more-row{cursor:default}
@@ -1431,7 +1457,7 @@ a.more-row .more-text{color:var(--accent)}
1431
1457
  /* Its start gives way, as the bar's folder does: the end names the project. Its separator goes with it, so it isn't the clipped side's. */
1432
1458
  .more-telemetry .more-dir{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;font-family:ui-monospace,monospace;direction:rtl;text-align:left}
1433
1459
  .more-telemetry .more-dir::before{content:none}
1434
- .more-telemetry .more-clock::after{content:"·";margin-left:6px}
1460
+ .more-telemetry .more-clock:has(+.more-dir)::after{content:"·";margin-left:6px}
1435
1461
  .more-actions{display:flex;gap:6px}
1436
1462
  .more-act{flex:1 1 0;min-width:0;min-height:40px;padding:0 2px;border-radius:9px;font-size:12px;font-weight:600;color:var(--text-2);background:transparent;border:1px solid var(--border-strong)}
1437
1463
  .more-act.accent{color:var(--accent);background:var(--bg-raised);border-color:var(--accent-border)}
@@ -1509,6 +1535,11 @@ body.all-view #scope .scope-where{display:none}
1509
1535
  #scope .scope-back{min-width:0;overflow:hidden;text-overflow:ellipsis}
1510
1536
  #stripStatus{padding:3px 8px}
1511
1537
  #newBtn .brand-new{font-size:16px}
1538
+ /* In a session the brand gives its room to the bar: a bare "+", a 32px round button (the start page keeps "chi"); its extra 4px
1539
+ taken back so the bar keeps its height. */
1540
+ body.has-session #newBtn .brand-name{display:none}
1541
+ body.has-session #newBtn.brand{width:32px;height:32px;margin:-2px 0;padding:0;justify-content:center;align-items:center;border-radius:999px;border:1px solid var(--border-strong)}
1542
+ body.has-session #newBtn .brand-new{font-size:20px;line-height:1;color:var(--text-2)}
1512
1543
  }
1513
1544
  /* The bell (notifications): quiet at the top bar's right end; filled in the accent when on, struck through when the browser blocks it. */
1514
1545
  /* The open session's title, when no strip card in sight shows it (session_title.js): the bar's middle, cut with an ellipsis; the whole first message in its tooltip.
@@ -1782,6 +1813,42 @@ body.all-view #allHead{display:flex}
1782
1813
  #topStrip #allTile{width:auto}
1783
1814
  }
1784
1815
  a{color:var(--accent)}
1816
+ /* Touch: tap targets of about 40px. A small control grows an invisible pseudo-element over what's around it (never over
1817
+ a link or another control: the sides that have a neighbour stay short); one that clips (the scope pill:
1818
+ overflow:hidden) or sits in a clipping strip (the card's ✎) grows its own box, its look unchanged; the composer's
1819
+ 🖼 and Send grow visibly. */
1820
+ @media (pointer:coarse){
1821
+ /* Revise: the unstacked one sits over the answer's bottom-right corner, so it grows down (the answer's text is above). */
1822
+ .revise-btn{position:relative}
1823
+ .revise-btn::after{content:"";position:absolute;inset:-2px -4px -19px}
1824
+ .revise-row.stacked .revise-btn::after{inset:-11px 0 -10px}
1825
+ /* Copy: ::after is the "copied" label. The answer's grows up and right, out of its text; a code block's left and down,
1826
+ inside its own strip; a prompt's left and down, away from its bubble and the strip's grip above it. */
1827
+ .copy-btn::before{content:"";position:absolute}
1828
+ .bubble.output>.copy-btn::before{inset:-15px -8px -2px -6px}
1829
+ .code-wrap>.copy-btn::before{inset:-5px -5px -12px -10px}
1830
+ .bubble.user>.copy-btn::before{inset:0 -2px -17px -13px}
1831
+ /* The top bar. A phone's has two rows 2px apart (the scope pill over the title's ✎): the pill grows up only, the ✎
1832
+ mostly down. */
1833
+ .title-rename{position:relative;z-index:1}
1834
+ .title-rename::after{content:"";position:absolute;inset:-5px -9px -16px}
1835
+ #notifyBtn{position:relative}
1836
+ #notifyBtn::after{content:"";position:absolute;inset:-7px}
1837
+ #scope .scope-all{position:relative}
1838
+ #scope .scope-all::after{content:"";position:absolute;inset:-14px -4px -11px -3px}
1839
+ /* The pill: its box 40px tall and borderless, its border drawn at the box's bottom at the old height (21px) with the
1840
+ text in its middle, the box's extra height above taken back by a negative margin so the row keeps its height; the box's
1841
+ corners no rounder than the drawn pill's (overflow:hidden would clip them). */
1842
+ #scope .scope-name,#scope .scope-name.error{position:relative;min-height:40px;margin:-19px 0 0;padding-top:21px;border-color:transparent;border-radius:11px}
1843
+ #scope .scope-name::before{content:"";position:absolute;left:0;right:0;top:19px;bottom:0;border:1px solid var(--border-strong);border-radius:999px;pointer-events:none}
1844
+ #scope .scope-name.error::before{border-color:var(--warn-border)}
1845
+ /* The active strip card's ✎: inside the strip (overflow-x:auto clips), so its own box grows, into the card's padding. */
1846
+ #topStrip .card-rename{padding:9px 13px;margin:-9px -8px}
1847
+ /* 🖼 and Send at 36px; the one-line field's line centred on Send (the field is 27px: it sits 4.5px up). */
1848
+ #composer .actions-col #attachBtn{width:36px;height:36px;min-height:36px;line-height:36px}
1849
+ #composer .actions-col #actionBtn{height:36px;min-height:36px;line-height:36px}
1850
+ body.has-session #composer .compose-col{margin-bottom:4.5px}
1851
+ }
1785
1852
  /* Under 16px iOS Safari zooms the page on focus (and a Home Screen app never zooms back), at any width: every text
1786
1853
  field gets 16px on a phone or a touch device. Last in the sheet so it wins over each field's own size; keep new text
1787
1854
  fields in this list (stage.spec.js's phone step checks the visible ones). */
@@ -1866,7 +1933,7 @@ a{color:var(--accent)}
1866
1933
  <button class="ghost" id="infoStopBtn" title="Stop session (terminate worker)" style="display:none">stop session</button>
1867
1934
  <button class="ghost" id="infoDeleteBtn" title="Delete session (for good)" style="display:none">delete</button>
1868
1935
  </div>
1869
- <button type="button" class="ghost" id="infoMoreBtn" data-anchor-stand-in aria-label="More" title="More" aria-haspopup="dialog" aria-expanded="false"><span aria-hidden="true">⋯</span></button>
1936
+ <button type="button" class="ghost" id="infoMoreBtn" data-anchor-stand-in aria-label="More" title="More" aria-haspopup="dialog" aria-expanded="false"><span aria-hidden="true">⋯</span><span class="more-count"></span></button>
1870
1937
  </div>
1871
1938
  </div>
1872
1939
  </section>
@@ -1,10 +1,11 @@
1
- // The session bar's info line (#infoText), three groups with hairlines
2
- // between them: the setup (the open session's id, a button that copies the
3
- // full id; status, model, the ⚙ settings chip (thinking, reasoning history,
4
- // LLM context), the 🧰 toolkit chip, model notes, memories or the working
5
- // set), the relations (chain links, the parent, delegates, participants)
6
- // and the telemetry (folder, ctx, speed, the session clock, the worker's
7
- // version badge). A lit-html template over a
1
+ // The session bar's info line (#infoText), four groups with hairlines
2
+ // between them: the identity (the open session's id, a button that copies
3
+ // the full id; status, ctx, speed, the session clock), the setup (the ⚙
4
+ // settings chip: thinking, reasoning history, LLM context; the model, the
5
+ // 🧰 toolkit chip, model notes, memories or the working set), the relations
6
+ // (chain links, the parent, delegates, participants) and the trail (folder,
7
+ // the worker's version badge). One row at every width: what doesn't fit
8
+ // folds into ⋯ (bar_fold.js, by BAR_ITEMS' ranks). A lit-html template over a
8
9
  // plain model (info_bar_model.js, applied by app.js's updateInfoBar), so the markup lives here and
9
10
  // runs under node --test (spec/web/public/info_bar.test.js).
10
11
  //
@@ -27,13 +28,15 @@ export const CLOCK_NONE = "–";
27
28
  export const NEXT = "→";
28
29
 
29
30
  // A chain's ← / → link (chains.js chainNeighbours): its date or time (else
30
- // its short id), its id, full start and preview in the tooltip. +link+:
31
+ // its short id), its id, full start and preview in the tooltip; classed
32
+ // chain-prev or chain-next by its side (info_bar_model.js BAR_ITEMS). +link+:
31
33
  // {id, date, stamp, preview, archived} (info_bar_model.js chainLinkView).
32
34
  export function chainLinkTemplate(link, arrow, what) {
33
35
  const short = String(link.id).slice(0, 8);
34
36
  const title = `${what}: ${short}${link.stamp ? ` · ${link.stamp}` : ""}${link.preview ? ` · ${link.preview}` : ""}${link.archived ? " (archived)" : ""}`;
35
37
  const text = arrow === PREV ? `${arrow} ${link.date || short}` : `${link.date || short} ${arrow}`;
36
- return html`<a class="model chain-link" href=${sessionHash(link.id)} title=${title}>${text}</a>`;
38
+ const side = arrow === PREV ? "chain-prev" : "chain-next";
39
+ return html`<a class=${`model chain-link ${side}`} href=${sessionHash(link.id)} title=${title}>${text}</a>`;
37
40
  }
38
41
 
39
42
  // `memories: a, b · preloaded: c · muted: d`: the used memories always,
@@ -92,20 +95,29 @@ export function workingSetChipTemplate(chip) {
92
95
  // first generation; null: no chip), clock (the session time's text, "" for
93
96
  // none: the muted CLOCK_NONE), worker ({badge, busy} or null), participants (the
94
97
  // participants chip: participants_panel.js chipModel, or null).
95
- // Three span.bar-group (setup, relations, telemetry), a span.bar-sep
96
- // between two drawn ones; the relations only when it has a part.
98
+ // Four span.bar-group, left to right: identity (the id, status, ctx, speed,
99
+ // the session clock), setup (⚙, the model, 🧰, model notes, memories or the
100
+ // working set), relations (the pruned note, chain links, the parent,
101
+ // delegates, participants; drawn only when it has a part) and trail (the
102
+ // folder, the worker's badge). A span.bar-sep before each group but the
103
+ // first, classed by the group it precedes (sep-setup…): the fold
104
+ // (bar_fold.js) names a group left with nothing on the row in #infoBar's
105
+ // data-empty-groups, and index.html's CSS hides it and its hairline.
97
106
  export function infoBarHtml(bar) {
98
107
  if (!bar) return nothing;
99
108
  const memories = bar.memories || [];
100
- const setup = html`<button type="button" class="id" title=${`Session id ${bar.id}: click to copy it`}>${String(bar.id).slice(0, 8)}</button><span class=${bar.status ? `status ${bar.status}` : "status"}><span>${bar.status || ""}</span></span><span class=${`model${bar.model.mismatch ? " served-mismatch" : ""}`} title=${bar.model.title}>${bar.model.text}</span>${settingsChip(bar.settings)}${toolkitChip(bar.toolkit)}${bar.notes ? html`<span class="model notes-chip" title=${bar.notes.title}>${bar.notes.text}</span>` : nothing}${bar.workingSet ? workingSetChipTemplate(bar.workingSet.chip) : memories.length ? html`<span class="model mem-chip" title=${memChipTitle(memories)}>${memChipText(memories)}</span>` : nothing}`;
101
- const related = !!(bar.chain?.prev || bar.chain?.next || bar.chain?.pruned || bar.parent || bar.kids || bar.participants);
109
+ const sep = (group) => html`<span class=${`bar-sep sep-${group}`} aria-hidden="true"></span>`;
110
+ const identity = html`<button type="button" class="id" title=${`Session id ${bar.id}: click to copy it`}>${String(bar.id).slice(0, 8)}</button><span class=${bar.status ? `status ${bar.status}` : "status"}><span>${bar.status || ""}</span></span><span class="model ctx" title=${bar.ctx.tip}>${bar.ctx.text}</span>${bar.speed ? html`<span class=${`model speed${bar.speed.empty ? " empty" : ""}`} title=${bar.speed.tip}>${bar.speed.text}</span>` : nothing}<span class=${`model session-time${bar.clock ? "" : " empty"}`} title=${bar.clock ? "This session's time: its turns, and the running one" : "This session's time: no turn yet"}>${bar.clock || CLOCK_NONE}</span>`;
111
+ const setup = html`${settingsChip(bar.settings)}<span class=${`model model-name${bar.model.mismatch ? " served-mismatch" : ""}`} title=${bar.model.title}>${bar.model.text}</span>${toolkitChip(bar.toolkit)}${bar.notes ? html`<span class="model notes-chip" title=${bar.notes.title}>${bar.notes.text}</span>` : nothing}${bar.workingSet ? workingSetChipTemplate(bar.workingSet.chip) : memories.length ? html`<span class="model mem-chip" title=${memChipTitle(memories)}>${memChipText(memories)}</span>` : nothing}`;
112
+ const pruned = !!bar.chain?.pruned && !bar.chain?.prev;
113
+ const related = !!(bar.chain?.prev || bar.chain?.next || pruned || bar.parent || bar.kids || bar.participants);
102
114
  // A chain pruned by a schedule (docs/scheduling.md): the link before this one
103
115
  // is gone, so there is nothing to link to — the bar says so instead.
104
116
  const relations = related
105
- ? html`<span class="bar-sep" aria-hidden="true"></span><span class="bar-group relations">${bar.chain?.prev ? chainLinkTemplate(bar.chain.prev, PREV, "The previous link of this chain") : nothing}${bar.chain?.pruned && !bar.chain?.prev ? html`<span class="model chain-pruned" title="The links before this one were pruned by a schedule">↩ earlier links pruned</span>` : nothing}${bar.chain?.next ? chainLinkTemplate(bar.chain.next, NEXT, "The next link of this chain") : nothing}${bar.parent ? html`<a class="model parent" href=${sessionHash(bar.parent.id)} title=${bar.parent.title}>↑ ${String(bar.parent.id).slice(0, 8)}</a>` : nothing}${kidsTemplate(bar.kids)}${participantsChip(bar.participants)}</span>`
117
+ ? html`${sep("relations")}<span class="bar-group relations">${pruned ? html`<span class="model chain-pruned" title="The links before this one were pruned by a schedule">↩ earlier links pruned</span>` : nothing}${bar.chain?.prev ? chainLinkTemplate(bar.chain.prev, PREV, "The previous link of this chain") : nothing}${bar.chain?.next ? chainLinkTemplate(bar.chain.next, NEXT, "The next link of this chain") : nothing}${bar.parent ? html`<a class="model parent" href=${sessionHash(bar.parent.id)} title=${bar.parent.title}>↑ ${String(bar.parent.id).slice(0, 8)}</a>` : nothing}${kidsTemplate(bar.kids)}${participantsChip(bar.participants)}</span>`
106
118
  : nothing;
107
- const telemetry = html`<span class="dir" title=${bar.dir || ""}><bdi>${bar.dir || ""}</bdi></span><span class="model ctx" title=${bar.ctx.tip}>${bar.ctx.text}</span>${bar.speed ? html`<span class=${`model speed${bar.speed.empty ? " empty" : ""}`} title=${bar.speed.tip}>${bar.speed.text}</span>` : nothing}<span class=${`model session-time${bar.clock ? "" : " empty"}`} title=${bar.clock ? "This session's time: its turns, and the running one" : "This session's time: no turn yet"}>${bar.clock || CLOCK_NONE}</span>${workerBadgeTemplate(bar.worker)}`;
108
- return html`<div class="meta"><span class="bar-group setup">${setup}</span>${relations}<span class="bar-sep" aria-hidden="true"></span><span class="bar-group telemetry">${telemetry}</span></div>`;
119
+ const trail = html`<span class="dir" title=${bar.dir || ""}><bdi>${bar.dir || ""}</bdi></span>${workerBadgeTemplate(bar.worker)}`;
120
+ return html`<div class="meta"><span class="bar-group identity">${identity}</span>${sep("setup")}<span class="bar-group setup">${setup}</span>${relations}${sep("trail")}<span class="bar-group trail">${trail}</span></div>`;
109
121
  }
110
122
 
111
123
  // Draws +bar+ into +el+ (#infoText), with the memories in its tooltip
@@ -8,6 +8,73 @@ import { chainClock, chainDate, chainNeighbours } from "./chains.js";
8
8
  import { ctxBarText, ctxBarTip, lastSpeedText, speedText } from "./ctx.js";
9
9
  import { formatDuration, sessionDurationNow } from "./timing.js";
10
10
  import { workerBadge } from "./update_notice.js";
11
+ import { chipModel as settingsChipModel } from "./settings_chip.js";
12
+
13
+ // Every chip and button of the session bar (#infoBar), one item per key:
14
+ // {key, selector (its element in #infoBar), group (the .meta's identity,
15
+ // setup, relations, trail as info_bar.js draws them; actions: #infoActions
16
+ // and ⋯), rank, phone, compact, menuOrder}.
17
+ // rank: the desktop fold order, a higher rank stays longer; "pinned"
18
+ // never folds, "menu" is never on the row. Items of one rank fold together.
19
+ // phone: "row" (a row candidate at the phone width) or "menu".
20
+ // compact: a smaller row form tried before the item folds (⚙ alone).
21
+ // menuOrder: its place in ⋯ (more_sheet.js ROW_KEYS, ACTION_KEYS: the
22
+ // actions group's are the actions, the others rows); null: no row (status,
23
+ // ⋯ itself; ctx, speed, time and the folder are its telemetry line).
24
+ // Data for the fold (docs/internals/web-frontend.md): shaped so a bundle or
25
+ // the user can add an item with a rank later.
26
+ export const BAR_ITEMS = Object.freeze([
27
+ { key: "status", selector: ".status", group: "identity", rank: "pinned", phone: "row", menuOrder: null },
28
+ { key: "ctx", selector: ".ctx", group: "identity", rank: "pinned", phone: "row", menuOrder: null },
29
+ { key: "more", selector: "#infoMoreBtn", group: "actions", rank: "pinned", phone: "row", menuOrder: null },
30
+ { key: "id", selector: ".id", group: "identity", rank: 12, phone: "menu", menuOrder: 1 },
31
+ { key: "continue", selector: "#infoContinueBtn", group: "actions", rank: 11, phone: "menu", menuOrder: 1 },
32
+ { key: "settings", selector: ".settings-chip", group: "setup", rank: 10, phone: "row", compact: true, menuOrder: 3 },
33
+ { key: "worker", selector: ".worker-badge", group: "trail", rank: 9, phone: "menu", menuOrder: 14 },
34
+ { key: "speed", selector: ".speed", group: "identity", rank: 8, phone: "row", menuOrder: null },
35
+ { key: "stop", selector: "#infoStopBtn", group: "actions", rank: 7, phone: "menu", menuOrder: 3 },
36
+ { key: "prev", selector: ".chain-prev", group: "relations", rank: 6, phone: "menu", menuOrder: 9 },
37
+ { key: "next", selector: ".chain-next", group: "relations", rank: 6, phone: "menu", menuOrder: 10 },
38
+ { key: "pruned", selector: ".chain-pruned", group: "relations", rank: 6, phone: "menu", menuOrder: 8 },
39
+ { key: "parent", selector: ".parent", group: "relations", rank: 6, phone: "menu", menuOrder: 11 },
40
+ { key: "time", selector: ".session-time", group: "identity", rank: 5, phone: "menu", menuOrder: null },
41
+ { key: "model", selector: ".model-name", group: "setup", rank: 4, phone: "menu", menuOrder: 2 },
42
+ { key: "delegates", selector: ".children-chip", group: "relations", rank: 3, phone: "menu", menuOrder: 12 },
43
+ { key: "participants", selector: ".participants-chip", group: "relations", rank: 3, phone: "menu", menuOrder: 7 },
44
+ { key: "workingSet", selector: ".ws-chip", group: "setup", rank: 2, phone: "menu", menuOrder: 5 },
45
+ { key: "memories", selector: ".mem-chip", group: "setup", rank: 2, phone: "menu", menuOrder: 6 },
46
+ { key: "notes", selector: ".notes-chip", group: "setup", rank: 2, phone: "menu", menuOrder: 13 },
47
+ { key: "toolkit", selector: ".tools-chip", group: "setup", rank: 1, phone: "menu", menuOrder: 4 },
48
+ { key: "dir", selector: ".dir", group: "trail", rank: 1, phone: "menu", menuOrder: null },
49
+ { key: "archive", selector: "#infoArchiveBtn", group: "actions", rank: "menu", phone: "menu", menuOrder: 2 },
50
+ { key: "delete", selector: "#infoDeleteBtn", group: "actions", rank: "menu", phone: "menu", menuOrder: 4 },
51
+ ].map((item) => Object.freeze({ compact: false, ...item })));
52
+
53
+ // The BAR_ITEMS keys the open session's bar draws (info_bar.js infoBarHtml
54
+ // for +bar+, the buttons app.js shows from +buttons+), in BAR_ITEMS' order;
55
+ // [] without a session.
56
+ export function barItemKeys(bar, buttons) {
57
+ if (!bar) return [];
58
+ const has = {
59
+ status: true, ctx: true, more: true, id: true, time: true, model: true, dir: true,
60
+ continue: !!buttons?.continue?.shown, stop: !!buttons?.stop?.shown,
61
+ archive: !!buttons?.archive?.shown, delete: !!buttons?.delete?.shown,
62
+ settings: !!(bar.settings && settingsChipModel(bar.settings)),
63
+ worker: !!bar.worker?.badge,
64
+ speed: !!bar.speed,
65
+ prev: !!bar.chain?.prev,
66
+ next: !!bar.chain?.next,
67
+ pruned: !!bar.chain?.pruned && !bar.chain?.prev,
68
+ parent: !!bar.parent,
69
+ delegates: !!bar.kids,
70
+ participants: !!bar.participants,
71
+ workingSet: !!bar.workingSet?.chip,
72
+ memories: !bar.workingSet && (bar.memories || []).length > 0,
73
+ notes: !!bar.notes,
74
+ toolkit: !!bar.toolkit,
75
+ };
76
+ return BAR_ITEMS.filter((item) => has[item.key]).map((item) => item.key);
77
+ }
11
78
 
12
79
  // The speed chip's placeholder before the session's first generation.
13
80
  export const SPEED_NONE = "– tok/s";
@@ -91,7 +158,9 @@ export function infoBarModel({ id, state, sessions, chain, cardTitle, badge, res
91
158
  model: modelLabel(state.model, ...(state.served || [])),
92
159
  // A link of a session chain: ← the previous link, → the next one (each
93
160
  // only while the list holds it).
94
- chain: { prev: chainLinkView(chain.prev, cardTitle, selfIso), next: chainLinkView(chain.next, cardTitle, selfIso) },
161
+ // +pruned+: the link before this one is gone (a schedule pruned it).
162
+ chain: { prev: chainLinkView(chain.prev, cardTitle, selfIso), next: chainLinkView(chain.next, cardTitle, selfIso),
163
+ pruned: !!chain.pruned },
95
164
  parent: parentChip ? { id: state.parentId, title: parentChip.title } : null,
96
165
  // A parent names its delegates; the link opens all sessions.
97
166
  kids: childrenSummary({ id }, sessions),