@aparte/core 0.16.0 → 0.16.1

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/dist/index.css CHANGED
@@ -4454,6 +4454,15 @@ aparte-chat-viewport.aparte-viewport--framework::-webkit-scrollbar-thumb {
4454
4454
  so it can't collide with the framework's children). */
4455
4455
  aparte-chat-viewport.aparte-viewport--framework,
4456
4456
  aparte-chat-viewport[framework-managed] {
4457
+ /* The base rule gives this element `width: 100%`, and core ships no global
4458
+ border-box reset — every `box-sizing` in these sheets is per-element, on purpose.
4459
+ So the padding below was ADDED to 100% and the host overflowed its own chat by
4460
+ 32px, which `aparte-chat`'s `overflow: hidden` then clipped: measured on a 1500px
4461
+ chat, the host was 1532 wide and hung 32px past the end edge. An app with its own
4462
+ `* { box-sizing: border-box }` never saw it, which is exactly why it survived —
4463
+ every example in this repo has one. The composer cannot share a column with a
4464
+ transcript that is off-centre, so it is fixed here rather than compensated there. */
4465
+ box-sizing: border-box;
4457
4466
  overflow-y: auto;
4458
4467
  overflow-x: hidden;
4459
4468
  overscroll-behavior: contain;
@@ -5259,6 +5268,34 @@ aparte-composer {
5259
5268
  display: block;
5260
5269
  /* Container-query root — see aparte-chat-viewport. */
5261
5270
  container-type: inline-size;
5271
+ /* The transcript's own inline gutter, read from the token that produces it.
5272
+ `.aparte-composer-shell` and `.aparte-message` both cap at
5273
+ `--aparte-message-max-width` and centre with `margin: 0 auto`, so on a container
5274
+ WIDER than the cap they lined up by construction. Below it the cap stops applying,
5275
+ each becomes 100% of its own parent — and this element had no padding, so the
5276
+ composer went flush to the chat's edges while the transcript kept its inset.
5277
+ Measured at a 512px chat: message column 26/26, composer 0/0. Every chat narrower
5278
+ than 800px was hit — a phone, an embedded widget, either pane of `<aparte-split>`,
5279
+ an app shell whose docked sidebar leaves the chat narrow on a wide window.
5280
+
5281
+ INLINE ONLY, and that is not shorthand-avoidance: the block axis is already spaced
5282
+ deliberately, 16px above from the viewport and 16px below from
5283
+ `--aparte-chat-bottom-gap` (shell.css), which were tuned to match. The `padding`
5284
+ shorthand would add a second 16px to each.
5285
+
5286
+ No 520px step to follow the transcript's, and it is not an oversight: a container
5287
+ query cannot match its own container, and this element IS one (the line above).
5288
+ Nothing above it is a container either, and `aparte-chat` may never become one —
5289
+ it would then be the containing block of the `position: fixed` select dropdown
5290
+ that exists to escape `overflow: hidden` (select.css, and the same warning in
5291
+ split.css). So below 520px the transcript tightens to 8px and this stays at 16.
5292
+ A flat 16 was measured against a step: the step wins for vanilla at phone width
5293
+ and LOSES for framework-managed, which is the majority path, because the
5294
+ transcript's own step targets a class framework mode never builds. Flat is a
5295
+ uniform 10px worst case in both modes — which is the scrollbar gutter the
5296
+ transcript reserves and the composer cannot, and which is 0 on the overlay
5297
+ scrollbars every phone has. */
5298
+ padding-inline: var(--aparte-viewport-padding);
5262
5299
  }
5263
5300
 
5264
5301
  aparte-composer-input {
@@ -5593,7 +5630,16 @@ aparte-composer-cancel .aparte-cc-button:hover {
5593
5630
  reply text beside it for attention it did not deserve. */
5594
5631
  .aparte-tool-summary {
5595
5632
  display: flex; align-items: center; gap: var(--aparte-space-4);
5596
- padding: var(--aparte-space-2) var(--aparte-space-3); margin-inline-start: calc(var(--aparte-space-3) * -1);
5633
+ /* The negative margin is what puts the row's CONTENT on the message column rather
5634
+ than one padding in from it — the padding here is the hover surface, not the
5635
+ column. So it has to be given back on BOTH sides. It used to be
5636
+ `margin-inline-start` alone: the name, the icon and the chevron landed on the
5637
+ column, and the trailing state stopped `--aparte-space-3` short of the right edge
5638
+ every line of prose reaches. Measured at a 512px chat: text L26/R26, the state's
5639
+ right edge at R32 — six pixels, on the one line of a turn whose whole job is to
5640
+ read as a quiet aside beside the text. `margin-inline` puts it at R26 and makes
5641
+ the hover surface symmetric with it. */
5642
+ padding: var(--aparte-space-2) var(--aparte-space-3); margin-inline: calc(var(--aparte-space-3) * -1);
5597
5643
  border-radius: var(--aparte-tool-row-radius);
5598
5644
  cursor: pointer; list-style: none;
5599
5645
  }
@@ -6807,7 +6853,7 @@ aparte-sidebar,
6807
6853
  * <aparte-composer>
6808
6854
  * <div class="aparte-composer-shell">
6809
6855
  * <div class="aparte-composer-row">
6810
- * <aparte-composer-input style="flex: 1"></aparte-composer-input>
6856
+ * <aparte-composer-input></aparte-composer-input>
6811
6857
  * <aparte-composer-send></aparte-composer-send>
6812
6858
  * </div>
6813
6859
  * </div>
@@ -7295,6 +7341,26 @@ aparte-split[disabled] > .aparte-split__handle:hover {
7295
7341
  overflow-y: auto;
7296
7342
  }
7297
7343
 
7344
+ /* A fenced block that came through MARKDOWN, not through the `code` segment.
7345
+ `@aparte/plugin-marked` renders ``` as a bare <pre><code>, and the recipe below is
7346
+ scoped to `.aparte-code-content-wrapper` — a class only the code SEGMENT renderer
7347
+ emits, which marked cannot produce. So a markdown block matched no `pre` rule at all
7348
+ and kept the UA's `white-space: pre`: it never wrapped, laid out at its own intrinsic
7349
+ width, and `aparte-chat-bubble`'s `overflow: hidden` amputated the tail. No scrollbar,
7350
+ no ellipsis — the code was simply gone. Measured on the vanilla example: one block's
7351
+ `scrollWidth` was a CONSTANT 963px at chat widths 1500, 800, 600, 512 and 380, against
7352
+ client widths 776 / 724 / 524 / 460 / 328. It overflowed even at 1500.
7353
+
7354
+ Only the two wrapping declarations are shared, not the surface: the padding and the
7355
+ background below are the code CARD's, and a markdown block has no card. Giving it one
7356
+ is a look decision, not this fix. */
7357
+ .aparte-content pre,
7358
+ .aparte-segment-content pre,
7359
+ .aparte-thinking-content pre {
7360
+ white-space: pre-wrap;
7361
+ overflow-wrap: anywhere;
7362
+ }
7363
+
7298
7364
  .aparte-code-content-wrapper pre {
7299
7365
  margin: 0;
7300
7366
  padding: var(--aparte-space-6);
package/dist/index.js CHANGED
@@ -3290,9 +3290,10 @@ class AparteChatViewport extends HTMLElement {
3290
3290
  const now = performance.now();
3291
3291
  const settlingOurs = drop <= churn + 2 && now - this._ownScrollAt < this._ownScrollWindowMs && now - this._readerInputAt >= this._ownScrollWindowMs;
3292
3292
  const readerWentUp = drop > 1 && !settlingOurs;
3293
+ const readerHandOnIt = drop > 1 && now - this._readerInputAt < this._ownScrollWindowMs;
3293
3294
  this._lastScrollTop = top;
3294
3295
  this._lastScrollHeight = height;
3295
- if (this._isAtBottom()) {
3296
+ if (this._isAtBottom() && !readerHandOnIt) {
3296
3297
  this._isAutoScrollEnabled = true;
3297
3298
  } else if (readerWentUp) {
3298
3299
  this._isAutoScrollEnabled = false;