dsh-select-quote 0.3.14 → 0.3.15

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 (2) hide show
  1. package/lib/client.js +24 -2
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -4505,6 +4505,13 @@ function attachConfigForm(form) {
4505
4505
  * content-sized and the chat's own `.icaHSq_scroll` is `overflow: visible`;
4506
4506
  * - regular layout: `.icaHSq_scroll` is the scroller.
4507
4507
  * Walking up from the selected flow item finds whichever one is live.
4508
+ *
4509
+ * Message content may nest its own scroll containers, and those must never
4510
+ * host the floating UI: the reasoning block renders its text as a nested flow
4511
+ * item inside `r52wTW_body`, which caps itself at `min(400px, 50vh)` with its
4512
+ * own scrolling and a bottom fade mask. A host placed there is clipped against
4513
+ * that box and has the mask painted over it. Only a scroller that lives
4514
+ * outside every flow item — the transcript's own — is eligible.
4508
4515
  */
4509
4516
  const HOST_ATTR = "data-dsq-layer";
4510
4517
  /** Below the composer seat (sticky, z-index 7); above in-content stickies (6). */
@@ -4622,6 +4629,22 @@ function fallbackLayer() {
4622
4629
  };
4623
4630
  return fallback;
4624
4631
  }
4632
+ /** True when the element scrolls its own overflow on the y axis. */
4633
+ function isScrollContainer(overflowY) {
4634
+ return overflowY === "auto" || overflowY === "scroll" || overflowY === "overlay";
4635
+ }
4636
+ /**
4637
+ * May this ancestor host the floating UI?
4638
+ *
4639
+ * A scroll container inside a chat flow item is **message content**, not the
4640
+ * transcript frame: the reasoning block nests a flow item inside a box capped
4641
+ * at `min(400px, 50vh)` that scrolls on its own and fades its bottom edge with
4642
+ * a mask. Hosting there would clip the toolbar against that box and paint the
4643
+ * mask over it, so the walk keeps going until it leaves every flow item.
4644
+ */
4645
+ function canHostFloatingLayer(overflowY, insideFlowItem) {
4646
+ return isScrollContainer(overflowY) && !insideFlowItem;
4647
+ }
4625
4648
  /** Layer for a node inside the transcript (falls back to a body host). */
4626
4649
  function floatingLayerFor(node) {
4627
4650
  const item = flowItemOf(node);
@@ -4629,8 +4652,7 @@ function floatingLayerFor(node) {
4629
4652
  if (cached?.host.isConnected) return cached;
4630
4653
  let el = item;
4631
4654
  while (el && el !== document.body) {
4632
- const { overflowY } = getComputedStyle(el);
4633
- if (overflowY === "auto" || overflowY === "scroll" || overflowY === "overlay") {
4655
+ if (canHostFloatingLayer(getComputedStyle(el).overflowY, flowItemOf(el) !== null)) {
4634
4656
  const layer = layerFor(el);
4635
4657
  if (item) itemLayers.set(item, layer);
4636
4658
  return layer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-select-quote",
3
- "version": "0.3.14",
3
+ "version": "0.3.15",
4
4
  "description": "DeepSeek Harness web plugin: annotate text selected in the conversation — the selection rides along with your next message, is marked in the source text, and the model points back at it.",
5
5
  "keywords": [
6
6
  "deepseek",