@kodaris/krubble-app-components 1.0.124 → 1.0.125

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.
@@ -3020,6 +3020,14 @@
3020
3020
  this._inputValue = '';
3021
3021
  this._isStreaming = false;
3022
3022
  this._error = '';
3023
+ /**
3024
+ * The current conversation's title. In the floating widget it replaces the
3025
+ * static header label so the user sees which conversation they're in. Set from
3026
+ * the loaded/switched conversation and from the live `CONVERSATION_TITLE` event
3027
+ * (the server generates a title at the end of a new conversation's first turn);
3028
+ * empty for a brand-new conversation, where the header falls back to `label`.
3029
+ */
3030
+ this._conversationTitle = '';
3023
3031
  /**
3024
3032
  * User-facing context warning text (`CONVERSATION_TOKEN_WARNING`). Shown as a
3025
3033
  * dismissible banner in all variants. Carries only friendly guidance, no numbers.
@@ -3079,12 +3087,23 @@
3079
3087
  */
3080
3088
  this._drawerOpen = false;
3081
3089
  /**
3082
- * Which view the drawer shows — settings, debug, or a single tool call's full
3083
- * detail. One drawer holds all three; the header buttons switch settings/debug
3084
- * and clicking a tool line switches to `toolDetail`. The content/width swap
3085
- * inside. Never null, so the content stays visible while the drawer slides shut.
3090
+ * Which view the drawer shows — settings, debug, history, or a single tool
3091
+ * call's full detail. One drawer holds them all; header buttons switch
3092
+ * settings/debug/history and clicking a tool line switches to `toolDetail`. The
3093
+ * content/width swap inside. Never null, so the content stays visible while the
3094
+ * drawer slides shut. `history` is floating-only (the previous-conversations
3095
+ * picker); in floating the drawer fills the panel over the transcript.
3086
3096
  */
3087
3097
  this._drawerView = 'settings';
3098
+ /**
3099
+ * The user's previous conversations, loaded from `/conversation/list` when the
3100
+ * history view opens. Each is the raw ConversationViewDto (we read conversationID,
3101
+ * title, lastModified). Empty until the first open; reloaded on each open so a
3102
+ * freshly-created or renamed conversation shows.
3103
+ */
3104
+ this._conversations = [];
3105
+ /** True while the history list is being fetched (drives a loading state). */
3106
+ this._conversationsLoading = false;
3088
3107
  /**
3089
3108
  * The tool call whose full input/output the `toolDetail` drawer view shows —
3090
3109
  * the clicked `tool_use` message and its paired `tool_result` message, stored
@@ -3328,6 +3347,11 @@
3328
3347
  // --- Lifecycle ---
3329
3348
  connectedCallback() {
3330
3349
  super.connectedCallback();
3350
+ // Capture the consumer's targeting BEFORE we default `load` below: a custom
3351
+ // `load` or an explicitly-set `conversation-id` means the consumer owns which
3352
+ // conversation shows, so the tab-scoped resume must not override it.
3353
+ const usesBuiltInLoad = !this.load;
3354
+ const consumerSetConversationId = this.conversationId != null;
3331
3355
  // Default to loading a conversation's messages when the consumer hasn't
3332
3356
  // provided their own `load`. With `conversationId` set we rebuild that
3333
3357
  // conversation; with none set the user wants a NEW conversation, so we start
@@ -3410,7 +3434,54 @@
3410
3434
  })));
3411
3435
  };
3412
3436
  }
3413
- this.load().then((messages) => {
3437
+ // Tab-scoped resume (floating only): a reload should redisplay the exact
3438
+ // conversation this tab was on, and a brand-new tab should reopen the user's
3439
+ // most-recent one. The pinned id lives in sessionStorage (per-tab — unlike
3440
+ // localStorage it isn't shared across tabs, so two tabs can sit on different
3441
+ // conversations). We resolve the id FIRST, then run the built-in load so it
3442
+ // rebuilds the right transcript. Skipped when the consumer owns targeting (a
3443
+ // custom `load` or an explicit `conversation-id`) or in inline mode (embedded
3444
+ // as a page — the host route, not the tab, decides the conversation).
3445
+ const resolveConversationId = () => {
3446
+ if (this.variant !== 'floating' || !usesBuiltInLoad || consumerSetConversationId) {
3447
+ return Promise.resolve();
3448
+ }
3449
+ const stored = Number(sessionStorage.getItem('kr-chatbot-conversation-id'));
3450
+ if (stored > 0) {
3451
+ this.conversationId = stored;
3452
+ // Fetch the conversation so the header shows its title on reload (the
3453
+ // transcript load doesn't carry it). Best-effort — the header falls back
3454
+ // to the default label if this fails.
3455
+ return krubbleHttp.Http.fetch({ url: `/api/system/conversation/${stored}` })
3456
+ .then((r) => r.json())
3457
+ .then((res) => {
3458
+ this._conversationTitle = res?.data?.title || '';
3459
+ })
3460
+ .catch(() => { });
3461
+ }
3462
+ // Fresh tab, nothing pinned yet — resume the user's most recent conversation
3463
+ // (404 when they have none, which leaves us blank for a new one).
3464
+ return krubbleHttp.Http.fetch({ url: '/api/system/conversation/last' })
3465
+ .then((r) => {
3466
+ if (!r.ok) {
3467
+ return;
3468
+ }
3469
+ return r.json().then((res) => {
3470
+ const id = res?.data?.conversationID;
3471
+ if (typeof id === 'number') {
3472
+ this.conversationId = id;
3473
+ this._conversationTitle = res?.data?.title || '';
3474
+ this._persistConversationId();
3475
+ }
3476
+ });
3477
+ })
3478
+ .catch(() => { });
3479
+ };
3480
+ // `this.load` is always set by here (defaulted above when the consumer didn't
3481
+ // supply one), so capture it for the async chain — TS can't narrow the nullable
3482
+ // property across the promise boundary.
3483
+ const load = this.load;
3484
+ resolveConversationId().then(() => load()).then((messages) => {
3414
3485
  if (messages && messages.length) {
3415
3486
  this.messages = messages;
3416
3487
  }
@@ -3652,12 +3723,31 @@
3652
3723
  }
3653
3724
  this._saveState();
3654
3725
  }
3726
+ /**
3727
+ * Persist the pinned conversation id per-tab so a reload redisplays this exact
3728
+ * conversation. sessionStorage (not localStorage) is deliberate: it's scoped to
3729
+ * the tab, so two tabs can sit on different conversations without clobbering
3730
+ * each other. Only meaningful for the floating widget's built-in flow — inline
3731
+ * embeds and custom-`load` consumers own their own targeting.
3732
+ */
3733
+ _persistConversationId() {
3734
+ try {
3735
+ if (this.conversationId != null) {
3736
+ sessionStorage.setItem('kr-chatbot-conversation-id', String(this.conversationId));
3737
+ }
3738
+ else {
3739
+ sessionStorage.removeItem('kr-chatbot-conversation-id');
3740
+ }
3741
+ }
3742
+ catch { /* sessionStorage not available */ }
3743
+ }
3655
3744
  _saveState() {
3656
3745
  try {
3657
- // `toolDetail` is a transient peek, not a saved view — persist only the two
3658
- // real preference views so a reload never reopens a stale tool.
3746
+ // `toolDetail` and `history` are transient views, not saved ones — persist
3747
+ // only the real preference views so a reload never reopens a stale tool or a
3748
+ // stale conversation list.
3659
3749
  let persistedDrawerView = this._drawerView;
3660
- if (persistedDrawerView === 'toolDetail') {
3750
+ if (persistedDrawerView === 'toolDetail' || persistedDrawerView === 'history') {
3661
3751
  persistedDrawerView = 'settings';
3662
3752
  }
3663
3753
  const state = {
@@ -4662,6 +4752,8 @@
4662
4752
  const id = conversation?.conversationID;
4663
4753
  if (typeof id === 'number') {
4664
4754
  this.conversationId = id;
4755
+ // Pin it to this tab so a reload redisplays this new conversation.
4756
+ this._persistConversationId();
4665
4757
  // Announce the newly-created conversation so consumers can react
4666
4758
  // (e.g. update the route from /chat/new to /chat/{id}). The full
4667
4759
  // conversation object is passed, not just the id, so consumers
@@ -4859,9 +4951,111 @@
4859
4951
  else {
4860
4952
  this._drawerOpen = true;
4861
4953
  this._drawerView = view;
4954
+ // Opening the history view refetches the user's previous conversations
4955
+ // (most-recently modified first) so a just-created or renamed conversation
4956
+ // shows without a reload. Ownership is enforced server-side (the endpoint
4957
+ // scopes to the current administrator), so we only filter to active ones.
4958
+ if (view === 'history') {
4959
+ this._conversationsLoading = true;
4960
+ krubbleHttp.Http.fetch({
4961
+ url: '/api/system/conversation/list',
4962
+ method: 'POST',
4963
+ body: {
4964
+ page: 0,
4965
+ size: 50,
4966
+ sortBy: 'lastModified',
4967
+ sortDirection: 'desc',
4968
+ filterFields: [{
4969
+ name: 'active',
4970
+ operation: 'IS',
4971
+ value: 'true',
4972
+ }],
4973
+ },
4974
+ })
4975
+ .then((r) => r.json())
4976
+ .then((res) => {
4977
+ this._conversations = res?.data?.content || [];
4978
+ })
4979
+ .catch(() => {
4980
+ this._conversations = [];
4981
+ })
4982
+ .then(() => {
4983
+ this._conversationsLoading = false;
4984
+ });
4985
+ }
4986
+ }
4987
+ this._saveState();
4988
+ }
4989
+ /**
4990
+ * Switch the floating widget to a previously-created conversation (clicked in the
4991
+ * history list): stop any live turn, reset the transient turn/context state, pin
4992
+ * the new id (persisted per-tab so a reload stays here), then rebuild its
4993
+ * transcript via the built-in `load`. The drawer closes so the user lands back
4994
+ * in the conversation.
4995
+ */
4996
+ _handleSwitchConversation(conversationID) {
4997
+ if (conversationID === this.conversationId) {
4998
+ this._handleCloseDrawer();
4999
+ return;
5000
+ }
5001
+ this._handleStop();
5002
+ this.conversationId = conversationID;
5003
+ // Adopt the picked conversation's title for the header (empty for an untitled
5004
+ // one, so the header falls back to the default label).
5005
+ this._conversationTitle = this._conversations.find((c) => c.conversationID === conversationID)?.title || '';
5006
+ this._persistConversationId();
5007
+ this._resetConversationState();
5008
+ this._drawerOpen = false;
5009
+ this._saveState();
5010
+ if (this.load) {
5011
+ this.load().then((messages) => {
5012
+ this.messages = messages || [];
5013
+ // A turn may still be streaming server-side for the conversation we just
5014
+ // opened (started in another tab/device) — attach to it if so.
5015
+ if (this.conversationId && !this._isStreaming) {
5016
+ this._reconnectStream();
5017
+ }
5018
+ }).catch(() => { });
4862
5019
  }
5020
+ }
5021
+ /**
5022
+ * Start a brand-new conversation (clicked in the history list): unpin the id (the
5023
+ * next turn sends `createNew` and the resolved id re-pins), clear the transcript
5024
+ * and transient state, and close the drawer back to an empty composer.
5025
+ */
5026
+ _handleNewConversation() {
5027
+ this._handleStop();
5028
+ this.conversationId = null;
5029
+ // New conversation has no title yet — the header shows the default label until
5030
+ // the server generates one at the end of the first turn.
5031
+ this._conversationTitle = '';
5032
+ this._persistConversationId();
5033
+ this.messages = [];
5034
+ this._resetConversationState();
5035
+ this._drawerOpen = false;
4863
5036
  this._saveState();
4864
5037
  }
5038
+ /**
5039
+ * Clear the transient, per-conversation state that must not bleed across a
5040
+ * conversation switch/new — pending confirmations, context banners, errors, the
5041
+ * reconnect counter, and staged composer files. The transcript itself is set by
5042
+ * the caller (loaded for a switch, emptied for new).
5043
+ */
5044
+ _resetConversationState() {
5045
+ this._pendingActions = [];
5046
+ this._inlineConfirm = true;
5047
+ this._contextWarning = '';
5048
+ this._contextLimitReached = false;
5049
+ this._contextLimitMessage = '';
5050
+ this._error = '';
5051
+ this._reconnectAttempts = 0;
5052
+ this._pendingConversationFiles.forEach((p) => {
5053
+ if (p.previewUrl) {
5054
+ URL.revokeObjectURL(p.previewUrl);
5055
+ }
5056
+ });
5057
+ this._pendingConversationFiles = [];
5058
+ }
4865
5059
  /** Close the drawer. `_drawerView` is left intact so its content stays visible
4866
5060
  * while the drawer slides shut. */
4867
5061
  _handleCloseDrawer() {
@@ -5143,7 +5337,7 @@
5143
5337
  // deliberately never show). Adopt it as the header label and pass it
5144
5338
  // up so consumers can update their own chrome, e.g. a breadcrumb.
5145
5339
  if (data.data?.title) {
5146
- this.label = data.data.title;
5340
+ this._conversationTitle = data.data.title;
5147
5341
  this.dispatchEvent(new CustomEvent('conversation-title', {
5148
5342
  detail: { title: data.data.title },
5149
5343
  bubbles: true,
@@ -5729,10 +5923,75 @@
5729
5923
  * lifetime — plus a verbose per-iteration table. Never customer-facing.
5730
5924
  */
5731
5925
  /**
5732
- * The side drawer — one sliding panel that holds both the Settings and Debug
5733
- * views. The header buttons switch `_drawerView`; the title and body swap
5734
- * inside. The panel keeps one consistent (resizable) width across both views —
5735
- * switching views only changes the content, never the panel size.
5926
+ * The History view's body — the user's previous conversations (most recent
5927
+ * first) plus a "New conversation" action. Clicking a row switches the widget to
5928
+ * that conversation; the current one is marked so the user sees where they are.
5929
+ * Floating-only (opened from the header history button).
5930
+ */
5931
+ _renderHistoryContent() {
5932
+ return b `
5933
+ <div class="history">
5934
+ ${this._conversationsLoading ? b `
5935
+ <div class="history__empty">Loading…</div>
5936
+ ` : this._conversations.length === 0 ? b `
5937
+ <div class="history__empty">No previous conversations</div>
5938
+ ` : b `
5939
+ <div class="history__list">
5940
+ ${this._conversations.map((conversation) => b `
5941
+ <button
5942
+ type="button"
5943
+ class=${e({
5944
+ 'history__item': true,
5945
+ 'history__item--active': conversation.conversationID === this.conversationId,
5946
+ })}
5947
+ @click=${() => this._handleSwitchConversation(conversation.conversationID)}
5948
+ >
5949
+ <span class="history__item-title">${conversation.title || 'Untitled conversation'}</span>
5950
+ ${conversation.lastModified ? b `
5951
+ <span class="history__item-date">${this._renderConversationDate(conversation.lastModified)}</span>
5952
+ ` : A}
5953
+ </button>
5954
+ `)}
5955
+ </div>
5956
+ `}
5957
+ </div>
5958
+ `;
5959
+ }
5960
+ /**
5961
+ * Format a conversation's lastModified for the history list: today shows the
5962
+ * time, this year shows month/day, older shows month/day/year. Falls back to the
5963
+ * raw value if it isn't a parseable date.
5964
+ */
5965
+ _renderConversationDate(lastModified) {
5966
+ const date = new Date(lastModified);
5967
+ if (isNaN(date.getTime())) {
5968
+ return lastModified;
5969
+ }
5970
+ const now = new Date();
5971
+ if (date.toDateString() === now.toDateString()) {
5972
+ return date.toLocaleTimeString('en-US', {
5973
+ hour: 'numeric',
5974
+ minute: '2-digit',
5975
+ });
5976
+ }
5977
+ if (date.getFullYear() === now.getFullYear()) {
5978
+ return date.toLocaleDateString('en-US', {
5979
+ month: 'short',
5980
+ day: 'numeric',
5981
+ });
5982
+ }
5983
+ return date.toLocaleDateString('en-US', {
5984
+ month: 'short',
5985
+ day: 'numeric',
5986
+ year: 'numeric',
5987
+ });
5988
+ }
5989
+ /**
5990
+ * The side drawer — one sliding panel that holds the Settings, Debug, History,
5991
+ * and tool-detail views. The header buttons switch `_drawerView`; the title and
5992
+ * body swap inside. In inline mode it slides in beside the transcript at a
5993
+ * consistent (resizable) width; in floating mode it fills the panel over the
5994
+ * transcript with a back button (the panel is too narrow to show both).
5736
5995
  */
5737
5996
  _renderDrawer() {
5738
5997
  // The debug view is gated on the server-side flag (inline variant + debug
@@ -5750,41 +6009,101 @@
5750
6009
  title = this._toolDetail.use.data?.displayName || this._toolDetail.use.data?.toolName || 'Tool';
5751
6010
  body = this._renderToolDetailContent();
5752
6011
  }
6012
+ else if (this._drawerView === 'history') {
6013
+ title = 'Conversations';
6014
+ body = this._renderHistoryContent();
6015
+ }
6016
+ // In the floating widget the drawer fills the panel over the transcript (a
6017
+ // full-panel view with a back button) rather than sliding in beside it — the
6018
+ // panel is too narrow to show both. Inline keeps the side-drawer behavior.
6019
+ const fullPanel = this.variant === 'floating';
5753
6020
  return b `
5754
6021
  <div
5755
6022
  class=${e({
5756
6023
  'drawer': true,
5757
6024
  'drawer--open': this._drawerOpen,
5758
6025
  'drawer--resizing': this._isDrawerResizing,
6026
+ 'drawer--full': fullPanel,
5759
6027
  })}
5760
- style=${o({ width: `${this._drawerWidth}px` })}
6028
+ style=${o(fullPanel ? {} : { width: `${this._drawerWidth}px` })}
5761
6029
  >
5762
- <div
5763
- class="drawer__resize"
5764
- @mousedown=${this._handleDrawerResizeMouseDown}
5765
- ></div>
6030
+ ${fullPanel ? A : b `
6031
+ <div
6032
+ class="drawer__resize"
6033
+ @mousedown=${this._handleDrawerResizeMouseDown}
6034
+ ></div>
6035
+ `}
5766
6036
  <div class="drawer__header">
6037
+ ${fullPanel ? b `
6038
+ <button
6039
+ class="header-action"
6040
+ @click=${this._handleCloseDrawer}
6041
+ title="Back"
6042
+ >
6043
+ <svg
6044
+ xmlns="http://www.w3.org/2000/svg"
6045
+ fill="none"
6046
+ viewBox="0 0 24 24"
6047
+ stroke-width="2"
6048
+ stroke="currentColor"
6049
+ class="header-action-icon"
6050
+ >
6051
+ <path
6052
+ stroke-linecap="round"
6053
+ stroke-linejoin="round"
6054
+ d="M15.75 19.5 8.25 12l7.5-7.5"
6055
+ />
6056
+ </svg>
6057
+ </button>
6058
+ ` : A}
5767
6059
  <span class="drawer__title">${title}</span>
5768
- <button
5769
- class="header-action"
5770
- @click=${this._handleCloseDrawer}
5771
- title="Close"
5772
- >
5773
- <svg
5774
- xmlns="http://www.w3.org/2000/svg"
5775
- fill="none"
5776
- viewBox="0 0 24 24"
5777
- stroke-width="2"
5778
- stroke="currentColor"
5779
- class="header-action-icon"
6060
+ ${this._drawerView === 'history' ? b `
6061
+ <kr-button
6062
+ class="history__new"
6063
+ variant="flat"
6064
+ color="primary"
6065
+ size="small"
6066
+ @click=${this._handleNewConversation}
5780
6067
  >
5781
- <path
5782
- stroke-linecap="round"
5783
- stroke-linejoin="round"
5784
- d="M6 18 18 6M6 6l12 12"
5785
- />
5786
- </svg>
5787
- </button>
6068
+ <svg
6069
+ slot="icon"
6070
+ xmlns="http://www.w3.org/2000/svg"
6071
+ fill="none"
6072
+ viewBox="0 0 24 24"
6073
+ stroke-width="1.75"
6074
+ stroke="currentColor"
6075
+ >
6076
+ <path
6077
+ stroke-linecap="round"
6078
+ stroke-linejoin="round"
6079
+ d="M12 4.5v15m7.5-7.5h-15"
6080
+ />
6081
+ </svg>
6082
+ New conversation
6083
+ </kr-button>
6084
+ ` : A}
6085
+ ${fullPanel ? A : b `
6086
+ <button
6087
+ class="header-action"
6088
+ @click=${this._handleCloseDrawer}
6089
+ title="Close"
6090
+ >
6091
+ <svg
6092
+ xmlns="http://www.w3.org/2000/svg"
6093
+ fill="none"
6094
+ viewBox="0 0 24 24"
6095
+ stroke-width="2"
6096
+ stroke="currentColor"
6097
+ class="header-action-icon"
6098
+ >
6099
+ <path
6100
+ stroke-linecap="round"
6101
+ stroke-linejoin="round"
6102
+ d="M6 18 18 6M6 6l12 12"
6103
+ />
6104
+ </svg>
6105
+ </button>
6106
+ `}
5788
6107
  </div>
5789
6108
  <div class="drawer__body">
5790
6109
  ${body}
@@ -6045,9 +6364,10 @@
6045
6364
  const isDebugEnabled = this.variant === 'inline' && this._aiFrameworkConfig.debugTelemetryEnabled === true;
6046
6365
  // Push the content over by the open drawer's width so the drawer sits beside
6047
6366
  // the content rather than overlaying it. One consistent (resizable) width for
6048
- // both views. Only pushes while the drawer is open.
6367
+ // both views. Only pushes while the drawer is open, and only inline — the
6368
+ // floating drawer fills the panel over the transcript, so it must not push.
6049
6369
  const contentPadding = {};
6050
- if (this._drawerOpen) {
6370
+ if (this._drawerOpen && this.variant === 'inline') {
6051
6371
  contentPadding.paddingRight = `${this._drawerWidth}px`;
6052
6372
  }
6053
6373
  // Group the transcript into runs so an agent turn (its reasoning/tool/text/
@@ -6165,10 +6485,52 @@
6165
6485
  <div class="header" @mousedown=${this._handleHeaderMouseDown}>
6166
6486
  <div class="header-left">
6167
6487
  <div class="header-info">
6168
- <span class="header-title">${this.label}</span>
6488
+ <span class="header-title">${this._conversationTitle || this.label}</span>
6169
6489
  </div>
6170
6490
  </div>
6171
6491
  <div class="header-actions">
6492
+ ${this.variant === 'floating' ? b `
6493
+ <button
6494
+ class="header-action"
6495
+ @click=${this._handleNewConversation}
6496
+ title="New conversation"
6497
+ >
6498
+ <svg
6499
+ xmlns="http://www.w3.org/2000/svg"
6500
+ fill="none"
6501
+ viewBox="0 0 24 24"
6502
+ stroke-width="1.75"
6503
+ stroke="currentColor"
6504
+ class="header-action-icon"
6505
+ >
6506
+ <path
6507
+ stroke-linecap="round"
6508
+ stroke-linejoin="round"
6509
+ d="M12 4.5v15m7.5-7.5h-15"
6510
+ />
6511
+ </svg>
6512
+ </button>
6513
+ <button
6514
+ class="header-action"
6515
+ @click=${() => this._toggleDrawer('history')}
6516
+ title="Conversations"
6517
+ >
6518
+ <svg
6519
+ xmlns="http://www.w3.org/2000/svg"
6520
+ fill="none"
6521
+ viewBox="0 0 24 24"
6522
+ stroke-width="1.5"
6523
+ stroke="currentColor"
6524
+ class="header-action-icon"
6525
+ >
6526
+ <path
6527
+ stroke-linecap="round"
6528
+ stroke-linejoin="round"
6529
+ d="M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"
6530
+ />
6531
+ </svg>
6532
+ </button>
6533
+ ` : A}
6172
6534
  <button
6173
6535
  class="header-action"
6174
6536
  @click=${() => this._toggleDrawer('settings')}
@@ -6923,22 +7285,28 @@
6923
7285
  display: flex;
6924
7286
  align-items: center;
6925
7287
  gap: 10px;
7288
+ min-width: 0;
6926
7289
  }
6927
7290
 
6928
7291
  .header-info {
6929
7292
  display: flex;
6930
7293
  flex-direction: column;
7294
+ min-width: 0;
6931
7295
  }
6932
7296
 
6933
7297
  .header-title {
6934
7298
  font-size: 16px;
6935
7299
  font-weight: 600;
7300
+ white-space: nowrap;
7301
+ overflow: hidden;
7302
+ text-overflow: ellipsis;
6936
7303
  }
6937
7304
 
6938
7305
  .header-actions {
6939
7306
  display: flex;
6940
7307
  align-items: center;
6941
7308
  gap: 4px;
7309
+ flex-shrink: 0;
6942
7310
  }
6943
7311
 
6944
7312
  .header-action {
@@ -7793,6 +8161,13 @@
7793
8161
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
7794
8162
  }
7795
8163
 
8164
+ /* Full-panel (floating) header: back button then title, left-aligned. */
8165
+ .drawer--full .drawer__header {
8166
+ justify-content: flex-start;
8167
+ gap: 8px;
8168
+ padding: 0 12px;
8169
+ }
8170
+
7796
8171
  .drawer__title {
7797
8172
  font-size: 14px;
7798
8173
  font-weight: 600;
@@ -7806,6 +8181,78 @@
7806
8181
  padding: 4px 0;
7807
8182
  }
7808
8183
 
8184
+ /* Floating variant: the drawer fills the whole panel over the transcript (a
8185
+ full-panel view with a back button), rather than sliding in beside it. */
8186
+ .drawer--full {
8187
+ left: 0;
8188
+ width: 100%;
8189
+ max-width: 100%;
8190
+ z-index: 6;
8191
+ }
8192
+
8193
+ .drawer--full.drawer--open {
8194
+ box-shadow: none;
8195
+ }
8196
+
8197
+ /* History (previous conversations) view. */
8198
+ .history {
8199
+ display: flex;
8200
+ flex-direction: column;
8201
+ }
8202
+
8203
+ /* "New conversation" action in the Conversations header — pushed to the right. */
8204
+ .history__new {
8205
+ margin-left: auto;
8206
+ }
8207
+
8208
+ .history__empty {
8209
+ padding: 24px 20px;
8210
+ text-align: center;
8211
+ font-size: 13px;
8212
+ color: rgb(0 0 0 / 50%);
8213
+ }
8214
+
8215
+ .history__list {
8216
+ display: flex;
8217
+ flex-direction: column;
8218
+ padding: 4px 0;
8219
+ }
8220
+
8221
+ .history__item {
8222
+ display: flex;
8223
+ flex-direction: column;
8224
+ align-items: flex-start;
8225
+ gap: 5px;
8226
+ padding: 10px 20px;
8227
+ background: transparent;
8228
+ border: none;
8229
+ text-align: left;
8230
+ cursor: pointer;
8231
+ transition: background 0.15s;
8232
+ }
8233
+
8234
+ .history__item:hover {
8235
+ background: rgba(0, 0, 0, 0.04);
8236
+ }
8237
+
8238
+ .history__item--active {
8239
+ background: rgba(0, 0, 0, 0.06);
8240
+ }
8241
+
8242
+ .history__item-title {
8243
+ font-size: 14px;
8244
+ color: #000000;
8245
+ white-space: nowrap;
8246
+ overflow: hidden;
8247
+ text-overflow: ellipsis;
8248
+ max-width: 100%;
8249
+ }
8250
+
8251
+ .history__item-date {
8252
+ font-size: 12px;
8253
+ color: rgb(0 0 0 / 60%);
8254
+ }
8255
+
7809
8256
  .debug-section {
7810
8257
  padding: 14px 20px;
7811
8258
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
@@ -8740,6 +9187,9 @@
8740
9187
  __decorate$4([
8741
9188
  r()
8742
9189
  ], KRChatbot.prototype, "_error", void 0);
9190
+ __decorate$4([
9191
+ r()
9192
+ ], KRChatbot.prototype, "_conversationTitle", void 0);
8743
9193
  __decorate$4([
8744
9194
  r()
8745
9195
  ], KRChatbot.prototype, "_contextWarning", void 0);
@@ -8773,6 +9223,12 @@
8773
9223
  __decorate$4([
8774
9224
  r()
8775
9225
  ], KRChatbot.prototype, "_drawerView", void 0);
9226
+ __decorate$4([
9227
+ r()
9228
+ ], KRChatbot.prototype, "_conversations", void 0);
9229
+ __decorate$4([
9230
+ r()
9231
+ ], KRChatbot.prototype, "_conversationsLoading", void 0);
8776
9232
  __decorate$4([
8777
9233
  r()
8778
9234
  ], KRChatbot.prototype, "_toolDetail", void 0);