@saltcorn/agents 0.8.9 → 0.8.10

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/agent-view.js CHANGED
@@ -713,10 +713,21 @@ const run = async (
713
713
  `
714
714
  function scrollAgentToBottom() {
715
715
  const container = document.getElementById('copilotinteractions');
716
- if (container) {
717
- if (container.scrollHeight > container.clientHeight) {
718
- container.scrollTo({ top: container.scrollHeight, behavior: 'smooth' });
719
- }
716
+ if (!container) return;
717
+ // The message list scrolls internally when its height is bounded.
718
+ if (container.scrollHeight > container.clientHeight + 2) {
719
+ container.scrollTo({ top: container.scrollHeight, behavior: 'smooth' });
720
+ }
721
+ const layout = container.closest('.modern-chat-layout');
722
+ if (layout) {
723
+ // Footer-sticky modern chat: the page scrolls while the input bar is
724
+ // position:sticky, so scrollIntoView() on the bar is a no-op (it
725
+ // always reports as already "in view"). Scroll the page down by the
726
+ // amount the chat extends past the viewport bottom, so the newest
727
+ // content + input bar end up at the bottom of the screen.
728
+ const overshoot = layout.getBoundingClientRect().bottom - window.innerHeight;
729
+ if (overshoot > 0) window.scrollBy({ top: overshoot + 8, behavior: 'smooth' });
730
+ } else {
720
731
  const inputForm = document.querySelector('form.agent-view');
721
732
  if (inputForm) inputForm.scrollIntoView({ behavior: 'smooth', block: 'end' });
722
733
  }
@@ -758,7 +769,7 @@ const run = async (
758
769
  const user_input = $("textarea[name=userinput]").val()
759
770
  if(user_input && (!${JSON.stringify(dyn_updates)}))
760
771
  $("#copilotinteractions").append(wrapSegment('<p>'+user_input+'</p>'+fileBadge, "You", true))
761
- $("textarea[name=userinput]").val("")
772
+ $("textarea[name=userinput]").val("").trigger("update.autogrow")
762
773
  $('div.next_response_scratch').html("")
763
774
  window['stream scratch ${viewname} ${rndid}'] = []
764
775
  $("button.modern-share").show()
package/agents.css CHANGED
@@ -411,19 +411,65 @@ p.prevrun_content {
411
411
  Everything else uses Bootstrap utility classes in the markup; only
412
412
  the rules below are custom and cannot be expressed via utilities. */
413
413
  .modern-chat-shell.chat-wide .modern-sessions-offcanvas {
414
- position: static !important;
414
+ position: sticky !important;
415
+ top: 1rem;
416
+ align-self: flex-start;
417
+ max-height: calc(100vh - 2rem);
418
+ overflow-y: auto;
415
419
  transform: none !important;
420
+ transition: none !important;
416
421
  visibility: visible !important;
417
422
  z-index: auto !important;
418
423
  width: 260px;
419
424
  max-width: 260px;
420
425
  flex: 0 0 260px;
421
426
  background: transparent;
422
- height: auto;
423
427
  box-shadow: none;
424
428
  }
425
429
  .modern-chat-shell.chat-wide .modern-chat-hamburger { display: none; }
426
430
 
431
+ /* Slim, subtle scrollbars for the scrollable chat areas (sessions sidebar
432
+ and the message list). Firefox uses scrollbar-width/-color; WebKit/Blink
433
+ use the ::-webkit-scrollbar pseudo-elements. The thumb is mostly
434
+ transparent and only becomes clearly visible on hover, so the scrollbar
435
+ doesn't visually clutter the layout. */
436
+ .modern-chat-shell.chat-wide .modern-sessions-offcanvas,
437
+ .modern-chat-layout #copilotinteractions {
438
+ scrollbar-width: thin;
439
+ scrollbar-color: transparent transparent;
440
+ }
441
+ .modern-chat-shell.chat-wide .modern-sessions-offcanvas:hover,
442
+ .modern-chat-layout #copilotinteractions:hover {
443
+ scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
444
+ }
445
+ .modern-chat-shell.chat-wide .modern-sessions-offcanvas::-webkit-scrollbar,
446
+ .modern-chat-layout #copilotinteractions::-webkit-scrollbar {
447
+ width: 6px;
448
+ height: 6px;
449
+ }
450
+ .modern-chat-shell.chat-wide
451
+ .modern-sessions-offcanvas::-webkit-scrollbar-track,
452
+ .modern-chat-layout #copilotinteractions::-webkit-scrollbar-track {
453
+ background: transparent;
454
+ }
455
+ .modern-chat-shell.chat-wide
456
+ .modern-sessions-offcanvas::-webkit-scrollbar-thumb,
457
+ .modern-chat-layout #copilotinteractions::-webkit-scrollbar-thumb {
458
+ background-color: transparent;
459
+ border-radius: 10px;
460
+ transition: background-color 0.2s ease;
461
+ }
462
+ .modern-chat-shell.chat-wide
463
+ .modern-sessions-offcanvas:hover::-webkit-scrollbar-thumb,
464
+ .modern-chat-layout #copilotinteractions:hover::-webkit-scrollbar-thumb {
465
+ background-color: rgba(0, 0, 0, 0.25);
466
+ }
467
+ .modern-chat-shell.chat-wide
468
+ .modern-sessions-offcanvas::-webkit-scrollbar-thumb:hover,
469
+ .modern-chat-layout #copilotinteractions::-webkit-scrollbar-thumb:hover {
470
+ background-color: rgba(0, 0, 0, 0.4);
471
+ }
472
+
427
473
  /* Bootstrap has no `:empty` utility — collapse the interaction list when
428
474
  it has no content so the input form sits directly under the header. */
429
475
  .modern-chat-layout #copilotinteractions:empty { display: none; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saltcorn/agents",
3
- "version": "0.8.9",
3
+ "version": "0.8.10",
4
4
  "description": "AI agents for Saltcorn",
5
5
  "main": "index.js",
6
6
  "dependencies": {