@adecore/agents-react 0.53.2 → 0.54.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.
- package/dist/agents/AgentIcon.js +1 -1
- package/dist/agents/AgentModelLabel.js +1 -1
- package/dist/agents/accounts.js +1 -1
- package/dist/chat/attachments.js +1 -1
- package/dist/chat/forks.js +1 -1
- package/dist/chat/logic/limit.js +1 -1
- package/dist/chat/logic/scrubber.js +1 -1
- package/dist/chat/logic/selection-switch.d.ts +6 -0
- package/dist/chat/logic/selection-switch.js +42 -0
- package/dist/chat/logic/timeline-target.d.ts +1 -1
- package/dist/chat/logic/timeline.d.ts +6 -1
- package/dist/chat/logic/timeline.js +16 -2
- package/dist/chat/logic/tool-looks.js +1 -1
- package/dist/chat/logic/tools.js +1 -1
- package/dist/chat/logic/workflow.js +1 -1
- package/dist/chat/preferences.js +1 -1
- package/dist/chat/runtime-modes.js +1 -1
- package/dist/chat/send-key.js +1 -1
- package/dist/chat/stash.js +2 -2
- package/dist/chat/subagent-list.js +1 -1
- package/dist/chat/ui/AccountPill.js +3 -3
- package/dist/chat/ui/BookmarkMarker.js +6 -6
- package/dist/chat/ui/BookmarkSubmenu.js +5 -5
- package/dist/chat/ui/ChatActivity.js +15 -14
- package/dist/chat/ui/CodeBlock.js +9 -7
- package/dist/chat/ui/Composer.js +13 -13
- package/dist/chat/ui/ComposerInput.d.ts +1 -1
- package/dist/chat/ui/ComposerInput.js +35 -18
- package/dist/chat/ui/DiffPool.js +1 -1
- package/dist/chat/ui/EditDiff.js +2 -2
- package/dist/chat/ui/GoalDock.js +5 -5
- package/dist/chat/ui/ImageView.js +4 -4
- package/dist/chat/ui/LimitState.js +12 -12
- package/dist/chat/ui/Markdown.d.ts +1 -1
- package/dist/chat/ui/Markdown.js +11 -10
- package/dist/chat/ui/MermaidBlock.js +7 -6
- package/dist/chat/ui/MessageActions.js +7 -7
- package/dist/chat/ui/ModelMarks.js +2 -2
- package/dist/chat/ui/Pickers.d.ts +1 -1
- package/dist/chat/ui/Pickers.js +32 -27
- package/dist/chat/ui/PromptComposer.d.ts +1 -1
- package/dist/chat/ui/PromptComposer.js +5 -5
- package/dist/chat/ui/PromptEditor.js +3 -3
- package/dist/chat/ui/QuoteButton.js +2 -2
- package/dist/chat/ui/ReferenceChip.js +3 -3
- package/dist/chat/ui/ReferenceTrail.js +2 -2
- package/dist/chat/ui/ResumeCompactionDock.js +3 -3
- package/dist/chat/ui/RunSettings.js +11 -11
- package/dist/chat/ui/Scrubber.js +4 -4
- package/dist/chat/ui/SessionLine.js +2 -2
- package/dist/chat/ui/ShellCommand.d.ts +1 -1
- package/dist/chat/ui/ShellCommand.js +2 -2
- package/dist/chat/ui/SubagentControls.js +3 -3
- package/dist/chat/ui/SubagentInfo.js +5 -5
- package/dist/chat/ui/SubagentStopButton.js +2 -2
- package/dist/chat/ui/SubagentTimeline.js +18 -16
- package/dist/chat/ui/Timeline.js +231 -145
- package/dist/chat/ui/TimelineMenu.js +7 -7
- package/dist/chat/ui/UnifiedDiff.js +2 -2
- package/dist/chat/ui/VisualDialogs.js +1 -1
- package/dist/chat/ui/VisualFrame.js +4 -4
- package/dist/chat/ui/WorkflowAgentLine.d.ts +1 -1
- package/dist/chat/ui/WorkflowAgentLine.js +3 -3
- package/dist/chat/ui/chip-clipboard.d.ts +1 -1
- package/dist/chat/ui/composer/ComposerControls.d.ts +1 -1
- package/dist/chat/ui/composer/ComposerControls.js +4 -4
- package/dist/chat/ui/composer/ComposerMenu.js +5 -4
- package/dist/chat/ui/composer/DraftParts.js +2 -2
- package/dist/chat/ui/composer/QueuedMessages.js +2 -2
- package/dist/chat/ui/composer/chip-paste.d.ts +1 -1
- package/dist/chat/ui/composer/chips.d.ts +1 -1
- package/dist/chat/ui/composer/chips.js +2 -2
- package/dist/chat/ui/composer/key-handler.js +1 -1
- package/dist/chat/ui/composer/placeholder.js +1 -1
- package/dist/chat/ui/composer/use-composer-menus.d.ts +1 -1
- package/dist/chat/ui/composer/use-composer-menus.js +1 -1
- package/dist/chat/ui/composer/use-composer-submit.d.ts +1 -1
- package/dist/chat/ui/composer/use-draft-files.d.ts +2 -2
- package/dist/chat/ui/composer/use-draft-files.js +1 -1
- package/dist/chat/ui/composer/use-effort-stepper.js +1 -1
- package/dist/chat/ui/composer/use-prompt-menus.d.ts +2 -2
- package/dist/chat/ui/composer/use-prompt-menus.js +1 -1
- package/dist/chat/ui/diff/ApprovalReview.js +2 -2
- package/dist/chat/ui/diff/DiffOmitted.js +1 -1
- package/dist/chat/ui/diff/DiffStack.js +2 -2
- package/dist/chat/ui/diff/EditorEditDiff.d.ts +1 -1
- package/dist/chat/ui/diff/EditorEditDiff.js +5 -5
- package/dist/chat/ui/diff/EditorPatchDiff.d.ts +1 -1
- package/dist/chat/ui/diff/EditorPatchDiff.js +1 -1
- package/dist/chat/ui/diff/LegacyEditDiff.js +47 -31
- package/dist/chat/ui/diff/LegacyUnifiedDiff.js +93 -69
- package/dist/chat/ui/diff/RawDiff.js +54 -35
- package/dist/chat/ui/diff/syntax-runtime.d.ts +1 -1
- package/dist/chat/ui/highlighter.d.ts +1 -1
- package/dist/chat/ui/highlighter.js +1 -1
- package/dist/chat/ui/icons.js +1 -1
- package/dist/chat/ui/intelligent-ui/UiBlockFrame.d.ts +1 -1
- package/dist/chat/ui/intelligent-ui/UiBlockFrame.js +4 -4
- package/dist/chat/ui/intelligent-ui/UiFallbackPart.js +2 -2
- package/dist/chat/ui/intelligent-ui/UiReply.d.ts +2 -2
- package/dist/chat/ui/intelligent-ui/UiReply.js +8 -8
- package/dist/chat/ui/intelligent-ui/node-text.d.ts +1 -1
- package/dist/chat/ui/intelligent-ui/render-context.d.ts +1 -1
- package/dist/chat/ui/intelligent-ui/renderers/chart.js +28 -15
- package/dist/chat/ui/intelligent-ui/renderers/choices.js +4 -4
- package/dist/chat/ui/intelligent-ui/renderers/content.js +6 -6
- package/dist/chat/ui/intelligent-ui/renderers/data.js +104 -87
- package/dist/chat/ui/intelligent-ui/renderers/inputs.js +3 -3
- package/dist/chat/ui/intelligent-ui/renderers/links.js +2 -2
- package/dist/chat/ui/intelligent-ui/renderers/map-view.js +4 -4
- package/dist/chat/ui/intelligent-ui/renderers/map.js +3 -3
- package/dist/chat/ui/intelligent-ui/renderers/structure.js +2 -2
- package/dist/chat/ui/intelligent-ui/renderers/text.js +5 -5
- package/dist/chat/ui/intelligent-ui/tones.d.ts +1 -1
- package/dist/chat/ui/intelligent-ui/use-ui-links.d.ts +1 -1
- package/dist/chat/ui/intelligent-ui/use-ui-links.js +2 -2
- package/dist/chat/ui/intelligent-ui/use-ui-queries.js +1 -1
- package/dist/chat/ui/reference-icons.d.ts +1 -1
- package/dist/chat/ui/reference-icons.js +2 -2
- package/dist/chat/ui/reply-context.d.ts +1 -1
- package/dist/chat/ui/rows/ForksRow.js +3 -3
- package/dist/chat/ui/rows/GeneratedImageRow.js +5 -5
- package/dist/chat/ui/rows/MessageRows.d.ts +6 -1
- package/dist/chat/ui/rows/MessageRows.js +151 -22
- package/dist/chat/ui/rows/Rows.js +39 -21
- package/dist/chat/ui/rows/SubagentRow.js +16 -16
- package/dist/chat/ui/rows/TaskRow.js +3 -3
- package/dist/chat/ui/rows/VisualRow.js +2 -2
- package/dist/chat/ui/rows/WorkRows.d.ts +2 -2
- package/dist/chat/ui/rows/WorkRows.js +37 -25
- package/dist/chat/ui/rows/WorkflowRow.js +8 -8
- package/dist/chat/ui/use-diff-source-tokens.js +1 -1
- package/dist/chat/ui/visual-theme.d.ts +1 -1
- package/dist/chat/ui/visual-theme.js +2 -2
- package/dist/chat/workflow-list.js +1 -1
- package/dist/host.d.ts +4 -4
- package/dist/host.js +1 -1
- package/dist/lazy.js +1 -1
- package/dist/locales/en/agent-chat.d.ts +4 -0
- package/dist/locales/en/agent-chat.js +4 -0
- package/dist/locales/nl/agent-chat.d.ts +4 -0
- package/dist/locales/nl/agent-chat.js +4 -0
- package/dist/port-transport.js +1 -1
- package/dist/prompts/logic/subjects.d.ts +1 -1
- package/dist/prompts/ui/ApprovalBody.js +16 -7
- package/dist/prompts/ui/PromptActions.js +2 -2
- package/dist/prompts/ui/PromptCard.js +5 -4
- package/dist/prompts/ui/PromptView.js +1 -1
- package/dist/prompts/ui/QuestionBody.js +4 -4
- package/dist/providers/AccountDetail.js +4 -4
- package/dist/providers/AccountOrderList.js +2 -2
- package/dist/providers/AccountVariables.js +3 -3
- package/dist/providers/AddAccountForm.js +6 -6
- package/dist/providers/CliDetail.js +8 -8
- package/dist/providers/InstallPage.js +3 -3
- package/dist/providers/ProviderList.js +2 -2
- package/dist/providers/ProvidersPane.d.ts +1 -1
- package/dist/providers/ProvidersPane.js +5 -5
- package/dist/providers/install-steps.d.ts +1 -1
- package/dist/settings/sections.d.ts +2 -2
- package/dist/state/chats.js +1 -1
- package/dist/state/usage.js +2 -2
- package/dist/theme.css +4 -4
- package/dist/transport.d.ts +1 -1
- package/dist/usage/LimitsList.js +4 -4
- package/dist/usage/UsageBreakdown.js +5 -5
- package/dist/usage/UsageChart.js +1 -1
- package/dist/usage/UsageDialog.js +1 -1
- package/dist/usage/UsageLimits.js +6 -6
- package/dist/usage/UsageLimitsCard.js +2 -2
- package/dist/usage/UsagePage.js +200 -189
- package/dist/usage/UsagePane.js +2 -2
- package/dist/usage/UsageSummary.js +1 -1
- package/dist/usage/UsageTiles.js +1 -1
- package/dist/usage/limit-groups.js +2 -2
- package/dist/usage/summary.js +1 -1
- package/package.json +9 -8
- package/src/agents/AgentIcon.tsx +1 -1
- package/src/agents/AgentModelLabel.tsx +2 -2
- package/src/agents/ProviderLogo.tsx +1 -1
- package/src/agents/accounts.ts +1 -1
- package/src/agents/option-words.ts +1 -1
- package/src/chat/attachments.ts +1 -1
- package/src/chat/bookmarks.ts +1 -1
- package/src/chat/drafts.ts +1 -1
- package/src/chat/forks.ts +1 -1
- package/src/chat/logic/fork.ts +1 -1
- package/src/chat/logic/limit.ts +1 -1
- package/src/chat/logic/scrubber.ts +1 -1
- package/src/chat/logic/selection-switch.ts +47 -0
- package/src/chat/logic/timeline-copy.ts +1 -1
- package/src/chat/logic/timeline-target.ts +1 -1
- package/src/chat/logic/timeline.ts +28 -4
- package/src/chat/logic/tool-looks.ts +1 -1
- package/src/chat/logic/tools.ts +1 -1
- package/src/chat/logic/workflow.ts +1 -1
- package/src/chat/pending-prompts.ts +1 -1
- package/src/chat/preferences.ts +1 -1
- package/src/chat/reading-width.ts +1 -1
- package/src/chat/runtime-modes.ts +1 -1
- package/src/chat/send-key.ts +1 -1
- package/src/chat/stash.ts +2 -2
- package/src/chat/subagent-conversation.ts +1 -1
- package/src/chat/subagent-list.ts +1 -1
- package/src/chat/subagent-view.ts +1 -1
- package/src/chat/thumbnails.ts +1 -1
- package/src/chat/ui/AccountPill.tsx +4 -4
- package/src/chat/ui/BookmarkMarker.tsx +6 -6
- package/src/chat/ui/BookmarkSubmenu.tsx +5 -5
- package/src/chat/ui/ChatActivity.tsx +15 -15
- package/src/chat/ui/CodeBlock.tsx +10 -8
- package/src/chat/ui/Composer.tsx +13 -13
- package/src/chat/ui/ComposerInput.tsx +10 -2
- package/src/chat/ui/DiffPool.tsx +1 -1
- package/src/chat/ui/EditDiff.tsx +3 -4
- package/src/chat/ui/GoalDock.tsx +6 -6
- package/src/chat/ui/ImageView.tsx +4 -4
- package/src/chat/ui/LimitState.tsx +13 -13
- package/src/chat/ui/Markdown.tsx +12 -12
- package/src/chat/ui/MermaidBlock.tsx +6 -6
- package/src/chat/ui/MessageActions.tsx +7 -7
- package/src/chat/ui/ModelMarks.tsx +2 -2
- package/src/chat/ui/Pickers.tsx +10 -10
- package/src/chat/ui/PromptComposer.tsx +6 -6
- package/src/chat/ui/PromptEditor.tsx +4 -4
- package/src/chat/ui/QuoteButton.tsx +2 -2
- package/src/chat/ui/ReferenceChip.tsx +3 -3
- package/src/chat/ui/ReferenceTrail.tsx +2 -2
- package/src/chat/ui/ResumeCompactionDock.tsx +3 -3
- package/src/chat/ui/RunSettings.tsx +13 -13
- package/src/chat/ui/Scrubber.tsx +4 -4
- package/src/chat/ui/SessionLine.tsx +2 -2
- package/src/chat/ui/ShellCommand.tsx +2 -2
- package/src/chat/ui/SubagentControls.tsx +3 -3
- package/src/chat/ui/SubagentInfo.tsx +5 -5
- package/src/chat/ui/SubagentStopButton.tsx +3 -3
- package/src/chat/ui/SubagentTimeline.tsx +20 -17
- package/src/chat/ui/Timeline.tsx +232 -143
- package/src/chat/ui/TimelineMenu.tsx +7 -7
- package/src/chat/ui/UnifiedDiff.tsx +3 -3
- package/src/chat/ui/VisualDialogs.tsx +2 -2
- package/src/chat/ui/VisualFrame.tsx +4 -4
- package/src/chat/ui/WorkflowAgentLine.tsx +4 -4
- package/src/chat/ui/chip-clipboard.ts +1 -1
- package/src/chat/ui/composer/ComposerControls.tsx +4 -4
- package/src/chat/ui/composer/ComposerMenu.tsx +6 -6
- package/src/chat/ui/composer/DraftParts.tsx +2 -2
- package/src/chat/ui/composer/QueuedMessages.tsx +2 -2
- package/src/chat/ui/composer/chip-paste.ts +1 -1
- package/src/chat/ui/composer/chips.ts +2 -2
- package/src/chat/ui/composer/key-handler.ts +2 -2
- package/src/chat/ui/composer/placeholder.ts +1 -1
- package/src/chat/ui/composer/use-chat-controls.ts +1 -1
- package/src/chat/ui/composer/use-compaction-offer.ts +1 -1
- package/src/chat/ui/composer/use-composer-menus.ts +2 -2
- package/src/chat/ui/composer/use-composer-submit.ts +2 -2
- package/src/chat/ui/composer/use-draft-files.ts +3 -3
- package/src/chat/ui/composer/use-effort-stepper.ts +2 -2
- package/src/chat/ui/composer/use-pending-requests.ts +1 -1
- package/src/chat/ui/composer/use-prompt-menus.ts +3 -3
- package/src/chat/ui/composer/use-take-back.ts +1 -1
- package/src/chat/ui/diff/ApprovalReview.tsx +3 -3
- package/src/chat/ui/diff/DiffOmitted.tsx +1 -1
- package/src/chat/ui/diff/DiffStack.tsx +2 -2
- package/src/chat/ui/diff/EditorEditDiff.tsx +5 -5
- package/src/chat/ui/diff/EditorPatchDiff.tsx +1 -1
- package/src/chat/ui/diff/LegacyDiffPool.tsx +1 -1
- package/src/chat/ui/diff/LegacyEditDiff.tsx +18 -9
- package/src/chat/ui/diff/LegacyUnifiedDiff.tsx +24 -13
- package/src/chat/ui/diff/RawDiff.tsx +8 -5
- package/src/chat/ui/diff/syntax-runtime.ts +1 -1
- package/src/chat/ui/highlighter.ts +1 -1
- package/src/chat/ui/icons.tsx +2 -2
- package/src/chat/ui/intelligent-ui/UiBlockFrame.tsx +5 -5
- package/src/chat/ui/intelligent-ui/UiFallbackPart.tsx +2 -2
- package/src/chat/ui/intelligent-ui/UiReply.tsx +18 -18
- package/src/chat/ui/intelligent-ui/node-text.ts +1 -1
- package/src/chat/ui/intelligent-ui/render-context.ts +1 -1
- package/src/chat/ui/intelligent-ui/renderers/chart.tsx +15 -7
- package/src/chat/ui/intelligent-ui/renderers/choices.tsx +4 -4
- package/src/chat/ui/intelligent-ui/renderers/content.tsx +7 -7
- package/src/chat/ui/intelligent-ui/renderers/data.tsx +8 -7
- package/src/chat/ui/intelligent-ui/renderers/inputs.tsx +3 -3
- package/src/chat/ui/intelligent-ui/renderers/links.tsx +4 -4
- package/src/chat/ui/intelligent-ui/renderers/map-view.tsx +4 -4
- package/src/chat/ui/intelligent-ui/renderers/map.tsx +5 -5
- package/src/chat/ui/intelligent-ui/renderers/structure.tsx +3 -3
- package/src/chat/ui/intelligent-ui/renderers/text.tsx +5 -5
- package/src/chat/ui/intelligent-ui/tones.ts +1 -1
- package/src/chat/ui/intelligent-ui/use-ui-links.ts +2 -2
- package/src/chat/ui/intelligent-ui/use-ui-queries.ts +1 -1
- package/src/chat/ui/reference-icons.ts +2 -2
- package/src/chat/ui/reply-context.ts +1 -1
- package/src/chat/ui/rows/ForksRow.tsx +3 -3
- package/src/chat/ui/rows/GeneratedImageRow.tsx +7 -7
- package/src/chat/ui/rows/MessageRows.tsx +57 -33
- package/src/chat/ui/rows/RowContainer.tsx +1 -1
- package/src/chat/ui/rows/Rows.tsx +7 -4
- package/src/chat/ui/rows/SubagentRow.tsx +16 -16
- package/src/chat/ui/rows/TaskRow.tsx +4 -4
- package/src/chat/ui/rows/VisualRow.tsx +2 -2
- package/src/chat/ui/rows/WorkRows.tsx +44 -32
- package/src/chat/ui/rows/WorkflowRow.tsx +9 -9
- package/src/chat/ui/rows/row-rhythm.ts +1 -1
- package/src/chat/ui/use-diff-source-tokens.ts +1 -1
- package/src/chat/ui/visual-theme.ts +2 -2
- package/src/chat/workflow-list.ts +1 -1
- package/src/host.ts +6 -6
- package/src/lazy.tsx +1 -1
- package/src/locales/en/agent-chat.ts +4 -0
- package/src/locales/nl/agent-chat.ts +4 -0
- package/src/port-transport.ts +1 -1
- package/src/prompts/logic/subjects.ts +1 -1
- package/src/prompts/ui/ApprovalBody.tsx +19 -9
- package/src/prompts/ui/PromptActions.tsx +2 -2
- package/src/prompts/ui/PromptCard.tsx +4 -4
- package/src/prompts/ui/PromptView.tsx +1 -1
- package/src/prompts/ui/QuestionBody.tsx +5 -5
- package/src/providers/AccountDetail.tsx +5 -5
- package/src/providers/AccountOrderList.tsx +2 -2
- package/src/providers/AccountVariables.tsx +4 -4
- package/src/providers/AddAccountForm.tsx +7 -7
- package/src/providers/CliDetail.tsx +9 -9
- package/src/providers/InstallPage.tsx +4 -4
- package/src/providers/ProviderList.tsx +4 -4
- package/src/providers/ProvidersPane.tsx +7 -7
- package/src/providers/account-actions.ts +1 -1
- package/src/providers/install-steps.ts +1 -1
- package/src/providers/parts.tsx +1 -1
- package/src/providers/provider-abilities.ts +1 -1
- package/src/providers/provider-groups.ts +1 -1
- package/src/providers/variables.ts +1 -1
- package/src/settings/sections.ts +2 -2
- package/src/state/chats.ts +2 -2
- package/src/state/provider-accounts.ts +1 -1
- package/src/state/providers.ts +1 -1
- package/src/state/usage.ts +2 -2
- package/src/theme.css +4 -4
- package/src/transport.ts +1 -1
- package/src/usage/LimitsList.tsx +5 -5
- package/src/usage/UsageBreakdown.tsx +6 -6
- package/src/usage/UsageChart.tsx +2 -2
- package/src/usage/UsageDialog.tsx +2 -2
- package/src/usage/UsageLimits.tsx +7 -7
- package/src/usage/UsageLimitsCard.tsx +2 -2
- package/src/usage/UsagePage.tsx +5 -5
- package/src/usage/UsagePane.tsx +2 -2
- package/src/usage/UsageSummary.tsx +2 -2
- package/src/usage/UsageTiles.tsx +1 -1
- package/src/usage/limit-groups.ts +2 -2
- package/src/usage/limits.ts +1 -1
- package/src/usage/summary.ts +1 -1
- package/dist/chat/logic/json.d.ts +0 -1
- package/dist/chat/logic/json.js +0 -4
- package/src/chat/logic/json.ts +0 -4
package/dist/chat/ui/Timeline.js
CHANGED
|
@@ -1,46 +1,48 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
2
|
+
import { ContextMenu, EmptyState, ErrorBoundary, Icon, ScrollArea, SectionLabel } from '@adecore/ui';
|
|
4
3
|
import { defaultRangeExtractor, useVirtualizer } from '@tanstack/react-virtual';
|
|
5
4
|
import clsx from 'clsx';
|
|
6
5
|
import { LoaderCircle } from 'lucide-react';
|
|
6
|
+
import { memo, useCallback, useEffect, useLayoutEffect, useMemo, useReducer, useRef, useState } from 'react';
|
|
7
|
+
import { useTranslation } from 'react-i18next';
|
|
8
|
+
import { AgentIcon } from '../../agents/AgentIcon.js';
|
|
9
|
+
import { useModelName } from '../../agents/model-name.js';
|
|
10
|
+
import { useChatHost } from '../../host.js';
|
|
11
|
+
import { useHostContextSources, useHostHidesFolder, useHostHidesToolCalls, useHostThreadCards, useHostTimelineFind, useHostWelcome } from '../../host-hooks.js';
|
|
12
|
+
import { useChatScope } from '../../scope.js';
|
|
13
|
+
import { useChatRow, useChats } from '../../state/chats.js';
|
|
7
14
|
import { useForkedTurns } from '../forks.js';
|
|
8
15
|
import { bookmarkRows } from '../logic/bookmarks.js';
|
|
9
|
-
import {
|
|
16
|
+
import { forkRefusal } from '../logic/fork.js';
|
|
17
|
+
import { SCRUBBER_MIN_TICKS, STRIP_INSET_PX, STRIP_WIDTH_PX, messagesInView, stepMessage, threadPaddingLeft, STRIP_CLEARANCE_PX, tickOfRow, ticksOf, ticksWithHits, EARLIER_ROW } from '../logic/scrubber.js';
|
|
10
18
|
import { timedRowsOf, withTimedRows } from '../logic/thread-cards.js';
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { useTimelineFlash } from '../timeline-flash.js';
|
|
19
|
+
import { deriveTimelineRows, findSubagentBranch } from '../logic/timeline.js';
|
|
20
|
+
import { EMPTY_TARGET, readTimelineTarget, revealUiReplyBlock, uiReplyJump, withCurrentText } from '../logic/timeline-target.js';
|
|
14
21
|
import { useChatPreferences } from '../preferences.js';
|
|
15
22
|
import { readingMeasure, readingWidthStyle } from '../reading-width.js';
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { UiReplyNavigationContext } from './reply-context.js';
|
|
20
|
-
import { FindRevealContext } from './find-reveal.js';
|
|
23
|
+
import { openFromMain, useSubagentTrail } from '../subagent-view.js';
|
|
24
|
+
import { useTimelineFlash } from '../timeline-flash.js';
|
|
25
|
+
import { registerItemJumper, registerMessageStepper, registerTimeline, registerTurnJumper, setTimelineAtEnd, wantsEarlier } from '../timeline-scroll.js';
|
|
21
26
|
import { BookmarkMarker } from './BookmarkMarker.js';
|
|
27
|
+
import { FileLinkContext } from './file-links.js';
|
|
28
|
+
import { FindRevealContext } from './find-reveal.js';
|
|
22
29
|
import { MessageActions } from './MessageActions.js';
|
|
30
|
+
import { QuoteTakerContext } from './quote-selection.js';
|
|
31
|
+
import { QuoteButton } from './QuoteButton.js';
|
|
32
|
+
import { UiReplyNavigationContext } from './reply-context.js';
|
|
33
|
+
import { ReplyHeader } from './rows/MessageRows.js';
|
|
34
|
+
import { FOLLOW_THRESHOLD_PX, replyHeader } from './rows/row-rhythm.js';
|
|
35
|
+
import { RowContainer } from './rows/RowContainer.js';
|
|
36
|
+
import { Row } from './rows/Rows.js';
|
|
23
37
|
import { Scrubber } from './Scrubber.js';
|
|
24
38
|
import { TimelineMenuPopup } from './TimelineMenu.js';
|
|
25
|
-
import { VisualDialogs } from './VisualDialogs.js';
|
|
26
|
-
import { FOLLOW_THRESHOLD_PX, replyHeader } from './rows/row-rhythm.js';
|
|
27
|
-
import { QuoteButton } from './QuoteButton.js';
|
|
28
|
-
import { QuoteTakerContext } from './quote-selection.js';
|
|
29
39
|
import { useToggleSet } from './useToggleSet.js';
|
|
40
|
+
import { VisualDialogs } from './VisualDialogs.js';
|
|
30
41
|
import { WelcomeGreeting } from './Welcome.js';
|
|
31
|
-
import { Row } from './rows/Rows.js';
|
|
32
|
-
import { RowContainer } from './rows/RowContainer.js';
|
|
33
|
-
import { ReplyHeader } from './rows/MessageRows.js';
|
|
34
|
-
import { useChatRow, useChats } from '../../state/chats.js';
|
|
35
|
-
import { useChatHost } from '../../host.js';
|
|
36
|
-
import { useChatScope } from '../../scope.js';
|
|
37
|
-
import { FileLinkContext } from './file-links.js';
|
|
38
|
-
import { AgentIcon } from '../../agents/AgentIcon.js';
|
|
39
|
-
import { useModelName } from '../../agents/model-name.js';
|
|
40
|
-
import { ContextMenu, EmptyState, ErrorBoundary, Icon, SectionLabel } from '@adecore/ui';
|
|
41
|
-
import { useHostContextSources, useHostHidesFolder, useHostHidesToolCalls, useHostThreadCards, useHostTimelineFind, useHostWelcome } from '../../host-hooks.js';
|
|
42
42
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
43
43
|
const ESTIMATED_ROW_PX = 56;
|
|
44
|
+
// A wheel that counts in lines rather than pixels moves this far per line.
|
|
45
|
+
const WHEEL_LINE_PX = 16;
|
|
44
46
|
// How long a jump waits for a thread that is still loading before it calls the item missing.
|
|
45
47
|
const JUMP_THREAD_WAIT_MS = 8000;
|
|
46
48
|
/* A jump puts its row at the top and stops following the end, so the reader stays where they landed. */
|
|
@@ -50,6 +52,31 @@ function showRowAtTop(virtualizer, followRef, index) {
|
|
|
50
52
|
align: 'start'
|
|
51
53
|
});
|
|
52
54
|
}
|
|
55
|
+
/* What of the composer's height covers the thread: all of it while it fits, none in a welcome or once it fills the frame. */
|
|
56
|
+
function coveredBy(composerHeight, frameHeight, welcome) {
|
|
57
|
+
return !welcome && composerHeight < frameHeight - FOLLOW_THRESHOLD_PX ? composerHeight : 0;
|
|
58
|
+
}
|
|
59
|
+
/* Whether a wheel over `target` moves a scroller between it and `boundary`, such as a long draft. */
|
|
60
|
+
function scrollsWithin(target, boundary, deltaX, deltaY) {
|
|
61
|
+
for (let element = target; element !== null; element = element.parentElement) {
|
|
62
|
+
const {
|
|
63
|
+
overflowX,
|
|
64
|
+
overflowY
|
|
65
|
+
} = getComputedStyle(element);
|
|
66
|
+
const scrollsY = (overflowY === 'auto' || overflowY === 'scroll') && element.scrollHeight > element.clientHeight;
|
|
67
|
+
const scrollsX = (overflowX === 'auto' || overflowX === 'scroll') && element.scrollWidth > element.clientWidth;
|
|
68
|
+
if (scrollsY && (deltaY < 0 ? element.scrollTop > 0 : deltaY > 0 && element.scrollTop + element.clientHeight < element.scrollHeight)) {
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
if (scrollsX && (deltaX < 0 ? element.scrollLeft > 0 : deltaX > 0 && element.scrollLeft + element.clientWidth < element.scrollWidth)) {
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
if (element === boundary) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
53
80
|
/*
|
|
54
81
|
* A thread before its first message: which model answers, what the lines into this node let it read,
|
|
55
82
|
* and the folder it works in, so a first question can lean on all three.
|
|
@@ -467,6 +494,7 @@ export function Timeline({
|
|
|
467
494
|
} = useSubagentTrail(chatId);
|
|
468
495
|
const frameRef = useRef(null);
|
|
469
496
|
const composerRef = useRef(null);
|
|
497
|
+
const spacerRef = useRef(null);
|
|
470
498
|
const [composerHeight, setComposerHeight] = useState(0);
|
|
471
499
|
const [frame, setFrame] = useState({
|
|
472
500
|
width: 0,
|
|
@@ -557,20 +585,46 @@ export function Timeline({
|
|
|
557
585
|
measure();
|
|
558
586
|
return () => observer.disconnect();
|
|
559
587
|
}, []);
|
|
588
|
+
const coverRef = useRef({
|
|
589
|
+
frameHeight: frame.height,
|
|
590
|
+
welcome
|
|
591
|
+
});
|
|
592
|
+
coverRef.current = {
|
|
593
|
+
frameHeight: frame.height,
|
|
594
|
+
welcome
|
|
595
|
+
};
|
|
560
596
|
useLayoutEffect(() => {
|
|
561
597
|
const element_0 = composerRef.current;
|
|
562
598
|
if (element_0 === null) {
|
|
563
599
|
return;
|
|
564
600
|
}
|
|
565
|
-
|
|
601
|
+
// The composer lies outside the scroller, so the space under the thread follows its height here,
|
|
602
|
+
// before the page paints, and the end with it; the state is drawn only after that paint.
|
|
603
|
+
const measure_0 = () => {
|
|
604
|
+
const height = element_0.offsetHeight;
|
|
605
|
+
const spacer = spacerRef.current;
|
|
606
|
+
const scroller = scrollRef.current;
|
|
607
|
+
if (spacer !== null && scroller !== null) {
|
|
608
|
+
spacer.style.height = `${coveredBy(height, coverRef.current.frameHeight, coverRef.current.welcome)}px`;
|
|
609
|
+
if (followRef.current) {
|
|
610
|
+
scroller.scrollTop = scroller.scrollHeight;
|
|
611
|
+
scrollGeometry.current = {
|
|
612
|
+
top: scroller.scrollTop,
|
|
613
|
+
height: scroller.scrollHeight,
|
|
614
|
+
viewport: scroller.clientHeight
|
|
615
|
+
};
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
setComposerHeight(height);
|
|
619
|
+
};
|
|
566
620
|
const observer_0 = new ResizeObserver(measure_0);
|
|
567
621
|
observer_0.observe(element_0);
|
|
568
622
|
measure_0();
|
|
569
623
|
return () => observer_0.disconnect();
|
|
570
624
|
}, []);
|
|
571
|
-
//
|
|
572
|
-
const
|
|
573
|
-
const
|
|
625
|
+
// A composer that would leave too little of the thread covers the frame and scrolls by itself.
|
|
626
|
+
const coveredHeight = coveredBy(composerHeight, frame.height, welcome);
|
|
627
|
+
const fillsFrame = !welcome && coveredHeight === 0 && composerHeight > 0;
|
|
574
628
|
const coveredHeightRef = useRef(coveredHeight);
|
|
575
629
|
coveredHeightRef.current = coveredHeight;
|
|
576
630
|
// The composer pages through the thread with PageUp and PageDown; this is the element it moves.
|
|
@@ -639,7 +693,7 @@ export function Timeline({
|
|
|
639
693
|
if (!followRef.current || element_2 === null) {
|
|
640
694
|
return;
|
|
641
695
|
}
|
|
642
|
-
// The
|
|
696
|
+
// The space under the thread is the composer's height, so that height is part of this end position.
|
|
643
697
|
element_2.scrollTop = element_2.scrollHeight;
|
|
644
698
|
scrollGeometry.current = {
|
|
645
699
|
top: element_2.scrollTop,
|
|
@@ -648,9 +702,9 @@ export function Timeline({
|
|
|
648
702
|
};
|
|
649
703
|
}, [rows.length, totalSize, composerHeight, frame.height]);
|
|
650
704
|
/*
|
|
651
|
-
* A
|
|
652
|
-
*
|
|
653
|
-
*
|
|
705
|
+
* A row measured again after the first paint is seen by an observer before the page paints, but the
|
|
706
|
+
* state it sets is drawn after that paint. The end is pinned here as well, so the page never paints
|
|
707
|
+
* the thread with its end out of view.
|
|
654
708
|
*/
|
|
655
709
|
useLayoutEffect(() => {
|
|
656
710
|
const content = contentRef.current;
|
|
@@ -893,8 +947,8 @@ export function Timeline({
|
|
|
893
947
|
let frame_0 = 0;
|
|
894
948
|
let attempts = 0;
|
|
895
949
|
const reveal = () => {
|
|
896
|
-
const
|
|
897
|
-
if (
|
|
950
|
+
const scroller_0 = scrollRef.current;
|
|
951
|
+
if (scroller_0 && revealUiReplyBlock(scroller_0, landing.target)) {
|
|
898
952
|
useTimelineFlash.getState().flash(keyOf(chatId), landing.target.itemId, false, landing.target);
|
|
899
953
|
setLanding(null);
|
|
900
954
|
} else if (++attempts < 30) {
|
|
@@ -1000,121 +1054,153 @@ export function Timeline({
|
|
|
1000
1054
|
style: readingWidthStyle(readingWidth),
|
|
1001
1055
|
"data-file-cwd": info?.cwd ?? '',
|
|
1002
1056
|
"data-file-scope-id": scope.id,
|
|
1003
|
-
children: [searching && chatFind.bar, /*#__PURE__*/_jsxs(
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
//
|
|
1008
|
-
,
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
inert: overlay ? true : undefined,
|
|
1048
|
-
onContextMenu: e_0 => setTarget(readTimelineTarget(e_0.target, threadRef.current, withCurrentText(rows, fullItems()))),
|
|
1049
|
-
children: loadingHistory ? /*#__PURE__*/_jsxs("div", {
|
|
1050
|
-
className: "flex grow items-center justify-center gap-2 text-sm text-text-muted",
|
|
1051
|
-
role: "status",
|
|
1052
|
-
children: [/*#__PURE__*/_jsx(Icon, {
|
|
1053
|
-
icon: LoaderCircle,
|
|
1054
|
-
size: 16,
|
|
1055
|
-
className: "animate-spin"
|
|
1056
|
-
}), /*#__PURE__*/_jsx("span", {
|
|
1057
|
-
children: t('timeline.loading')
|
|
1058
|
-
})]
|
|
1059
|
-
}) : welcome ? /*#__PURE__*/_jsx(WelcomeGreeting, {
|
|
1060
|
-
chatId: chatId
|
|
1061
|
-
}) : empty ? /*#__PURE__*/_jsx(EmptyThread, {
|
|
1062
|
-
chatId: chatId
|
|
1063
|
-
}) : /*#__PURE__*/_jsx("div", {
|
|
1064
|
-
className: "relative w-full shrink-0",
|
|
1057
|
+
children: [searching && chatFind.bar, /*#__PURE__*/_jsxs("div", {
|
|
1058
|
+
className: clsx('relative flex min-h-0 grow flex-col', welcome && 'justify-center'),
|
|
1059
|
+
children: [/*#__PURE__*/_jsxs(ContextMenu.Root, {
|
|
1060
|
+
children: [/*#__PURE__*/_jsx(ScrollArea
|
|
1061
|
+
// Only down: wide content such as code and diffs scrolls in its own box, so a thread never moves sideways.
|
|
1062
|
+
, {
|
|
1063
|
+
axis: "y",
|
|
1064
|
+
viewportRef: scrollRef,
|
|
1065
|
+
className: clsx(!welcome && 'grow'),
|
|
1066
|
+
viewportClassName: "chat-scroll",
|
|
1067
|
+
coveredBottom: coveredHeight
|
|
1068
|
+
// The thread keeps its reader in place itself when a page goes in above.
|
|
1069
|
+
,
|
|
1070
|
+
style: {
|
|
1071
|
+
overflowAnchor: 'none'
|
|
1072
|
+
},
|
|
1073
|
+
onScrollCapture: e => {
|
|
1074
|
+
const el = e.currentTarget;
|
|
1075
|
+
// Capture the reader's movement before virtualization remeasures rows and shifts the scroll offset.
|
|
1076
|
+
const previous = scrollGeometry.current;
|
|
1077
|
+
const layoutChanged = previous.height !== el.scrollHeight || previous.viewport !== el.clientHeight;
|
|
1078
|
+
const atEnd = el.scrollHeight - el.scrollTop - el.clientHeight < FOLLOW_THRESHOLD_PX;
|
|
1079
|
+
if (!layoutChanged && el.scrollTop < previous.top) {
|
|
1080
|
+
followRef.current = false;
|
|
1081
|
+
} else if (atEnd) {
|
|
1082
|
+
followRef.current = true;
|
|
1083
|
+
}
|
|
1084
|
+
scrollGeometry.current = {
|
|
1085
|
+
top: el.scrollTop,
|
|
1086
|
+
height: el.scrollHeight,
|
|
1087
|
+
viewport: el.clientHeight
|
|
1088
|
+
};
|
|
1089
|
+
setTimelineAtEnd(chatId, followRef.current);
|
|
1090
|
+
if (wantsEarlier(el)) {
|
|
1091
|
+
loadEarlier();
|
|
1092
|
+
}
|
|
1093
|
+
followStrip(el);
|
|
1094
|
+
},
|
|
1095
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
1096
|
+
ref: contentRef,
|
|
1097
|
+
className: "relative flex min-h-full flex-col",
|
|
1098
|
+
children: [/*#__PURE__*/_jsx(ContextMenu.Trigger, {
|
|
1099
|
+
ref: threadRef,
|
|
1100
|
+
className: clsx('chat-thread flex flex-col px-4 pt-4', !welcome && 'grow'),
|
|
1065
1101
|
style: {
|
|
1066
|
-
|
|
1067
|
-
|
|
1102
|
+
paddingLeft,
|
|
1103
|
+
'--chat-wide-inset': `${2 * (showsScrubber ? STRIP_CLEARANCE_PX : paddingLeft) - paddingLeft}px`
|
|
1068
1104
|
},
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1105
|
+
inert: overlay ? true : undefined,
|
|
1106
|
+
onContextMenu: e_0 => setTarget(readTimelineTarget(e_0.target, threadRef.current, withCurrentText(rows, fullItems()))),
|
|
1107
|
+
children: loadingHistory ? /*#__PURE__*/_jsxs("div", {
|
|
1108
|
+
className: "flex grow items-center justify-center gap-2 text-sm text-text-muted",
|
|
1109
|
+
role: "status",
|
|
1110
|
+
children: [/*#__PURE__*/_jsx(Icon, {
|
|
1111
|
+
icon: LoaderCircle,
|
|
1112
|
+
size: 16,
|
|
1113
|
+
className: "animate-spin"
|
|
1114
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
1115
|
+
children: t('timeline.loading')
|
|
1116
|
+
})]
|
|
1117
|
+
}) : welcome ? /*#__PURE__*/_jsx(WelcomeGreeting, {
|
|
1118
|
+
chatId: chatId
|
|
1119
|
+
}) : empty ? /*#__PURE__*/_jsx(EmptyThread, {
|
|
1120
|
+
chatId: chatId
|
|
1121
|
+
}) : /*#__PURE__*/_jsx("div", {
|
|
1122
|
+
className: "relative w-full shrink-0",
|
|
1123
|
+
style: {
|
|
1124
|
+
height: totalSize,
|
|
1125
|
+
visibility: initialLayout ? 'hidden' : undefined
|
|
1126
|
+
},
|
|
1127
|
+
children: /*#__PURE__*/_jsx(UiReplyNavigationContext.Provider, {
|
|
1128
|
+
value: uiNavigation,
|
|
1129
|
+
children: /*#__PURE__*/_jsx(FindRevealContext.Provider, {
|
|
1130
|
+
value: chatFind.reveal,
|
|
1131
|
+
children: virtualRows.map(virtualRow_1 => {
|
|
1132
|
+
const row_15 = rows[virtualRow_1.index];
|
|
1133
|
+
return /*#__PURE__*/_jsx(ThreadRow, {
|
|
1134
|
+
row: row_15,
|
|
1135
|
+
previous: virtualRow_1.index > 0 ? rows[virtualRow_1.index - 1] : null,
|
|
1136
|
+
index: virtualRow_1.index,
|
|
1137
|
+
top: virtualRow_1.start,
|
|
1138
|
+
measure: virtualizer.measureElement,
|
|
1139
|
+
chatId: chatId,
|
|
1140
|
+
flashNonce: flash !== null && flashedRow === row_15.id ? flash.nonce : null,
|
|
1141
|
+
bookmark: marks.get(row_15.id) ?? null,
|
|
1142
|
+
toggleGroup: groups.toggle,
|
|
1143
|
+
toggleTurn: turns.toggle,
|
|
1144
|
+
toggleSubagent: subagents.toggle,
|
|
1145
|
+
openSubagent: openSubagent,
|
|
1146
|
+
openConversation: openConversation
|
|
1147
|
+
}, row_15.id);
|
|
1148
|
+
})
|
|
1090
1149
|
})
|
|
1091
1150
|
})
|
|
1092
1151
|
})
|
|
1093
|
-
})
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1152
|
+
}), /*#__PURE__*/_jsx(QuoteButton, {
|
|
1153
|
+
thread: threadRef,
|
|
1154
|
+
frame: contentRef,
|
|
1155
|
+
taker: quoteTakerRef
|
|
1156
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
1157
|
+
ref: spacerRef,
|
|
1158
|
+
className: "shrink-0",
|
|
1159
|
+
style: {
|
|
1160
|
+
height: coveredHeight
|
|
1161
|
+
},
|
|
1162
|
+
"aria-hidden": true
|
|
1163
|
+
})]
|
|
1164
|
+
})
|
|
1165
|
+
}), /*#__PURE__*/_jsx(TimelineMenuPopup, {
|
|
1166
|
+
target: target,
|
|
1167
|
+
thread: threadRef,
|
|
1168
|
+
chatId: onMainAgent ? chatId : null,
|
|
1169
|
+
column: frame.column
|
|
1170
|
+
})]
|
|
1171
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
1172
|
+
className: "isolate shrink-0",
|
|
1173
|
+
style: welcome ? {
|
|
1174
|
+
position: 'relative'
|
|
1175
|
+
} : fillsFrame ? {
|
|
1176
|
+
position: 'absolute',
|
|
1177
|
+
inset: 0,
|
|
1178
|
+
overflowY: 'auto'
|
|
1179
|
+
} : {
|
|
1180
|
+
position: 'absolute',
|
|
1181
|
+
insetInline: 0,
|
|
1182
|
+
bottom: 0
|
|
1183
|
+
},
|
|
1184
|
+
onWheel: e_1 => {
|
|
1185
|
+
const scroller_1 = scrollRef.current;
|
|
1186
|
+
// A wheel over the composer moves the thread it lies over, as it did inside the scroller.
|
|
1187
|
+
if (scroller_1 === null || coveredHeight === 0 || e_1.ctrlKey || scrollsWithin(e_1.target, e_1.currentTarget, e_1.deltaX, e_1.deltaY)) {
|
|
1188
|
+
return;
|
|
1189
|
+
}
|
|
1190
|
+
const unit = e_1.deltaMode === 1 ? WHEEL_LINE_PX : e_1.deltaMode === 2 ? scroller_1.clientHeight : 1;
|
|
1191
|
+
scroller_1.scrollTop += e_1.deltaY * unit;
|
|
1192
|
+
scroller_1.scrollLeft += e_1.deltaX * unit;
|
|
1193
|
+
},
|
|
1194
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
1195
|
+
ref: composerRef
|
|
1196
|
+
// The card is translucent so the thread shows through it, but the pb-3 strip under it must stay opaque.
|
|
1197
|
+
,
|
|
1198
|
+
className: clsx(composer && 'px-3 pb-3 pt-3 bg-[linear-gradient(to_bottom,transparent_calc(100%-12px),var(--surface)_calc(100%-12px))]'),
|
|
1199
|
+
children: /*#__PURE__*/_jsx(QuoteTakerContext.Provider, {
|
|
1200
|
+
value: registerQuoteTaker,
|
|
1201
|
+
children: composer
|
|
1202
|
+
})
|
|
1112
1203
|
})
|
|
1113
|
-
}), /*#__PURE__*/_jsx(TimelineMenuPopup, {
|
|
1114
|
-
target: target,
|
|
1115
|
-
thread: threadRef,
|
|
1116
|
-
chatId: onMainAgent ? chatId : null,
|
|
1117
|
-
column: frame.column
|
|
1118
1204
|
})]
|
|
1119
1205
|
}), drawsVisuals && /*#__PURE__*/_jsx(VisualDialogs, {
|
|
1120
1206
|
chatId: chatId
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { ContextMenu, copyText, DisabledReason, EDIT_SHORTCUTS, Icon, Kbd, selectAllWithin } from '@adecore/ui';
|
|
3
3
|
import { BookmarkPlus, BookmarkX, Braces, Copy, Eye, FileText, GitFork, MessageSquare, MoveHorizontal, Pencil, Scan } from 'lucide-react';
|
|
4
|
-
import {
|
|
5
|
-
import { rememberReadingWidth, useChatPreferences } from '../preferences.js';
|
|
6
|
-
import { CHAT_READING_WIDTHS, readingWidthLabel } from '../reading-width.js';
|
|
7
|
-
import { forkRefusal, turnIdOfRow } from '../logic/fork.js';
|
|
8
|
-
import { markdownOf, messageTextOf } from '../logic/timeline-copy.js';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
9
5
|
import { useChatHost } from '../../host.js';
|
|
10
6
|
import { useChatScope } from '../../scope.js';
|
|
11
7
|
import { useChatRow } from '../../state/chats.js';
|
|
8
|
+
import { placeBookmark, removeBookmark, useBookmarkNaming } from '../bookmarks.js';
|
|
9
|
+
import { forkRefusal, turnIdOfRow } from '../logic/fork.js';
|
|
10
|
+
import { markdownOf, messageTextOf } from '../logic/timeline-copy.js';
|
|
11
|
+
import { rememberReadingWidth, useChatPreferences } from '../preferences.js';
|
|
12
|
+
import { CHAT_READING_WIDTHS, readingWidthLabel } from '../reading-width.js';
|
|
12
13
|
import { copyWithChips, rowClipboardChips } from './chip-clipboard.js';
|
|
13
14
|
import { useFileLinkCwd, useFileLinkScopeId, useOpenFileLink } from './file-links.js';
|
|
14
15
|
import { useReferenceLookup } from './thread-references.js';
|
|
15
|
-
import { ContextMenu, copyText, DisabledReason, EDIT_SHORTCUTS, Icon, Kbd, selectAllWithin } from '@adecore/ui';
|
|
16
16
|
/* The menu behind a right-click in a thread, mostly for copying: a whole message, a code block or an answer's markdown. */
|
|
17
17
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
18
18
|
export function TimelineMenuPopup(t0) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { LazyBoundary } from '@adecore/ui';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { useChatHost } from '../../host.js';
|
|
4
5
|
import { lazyNamed } from '../../lazy.js';
|
|
5
6
|
import { diffSourceBudget, legacyDiffBudget, patchSourceBudget } from './diff/diff-source-budget.js';
|
|
7
|
+
import { DiffFallbackBoundary } from './diff/DiffFallbackBoundary.js';
|
|
6
8
|
import { DiffOmitted } from './diff/DiffOmitted.js';
|
|
7
9
|
import { DiffUnavailable } from './diff/DiffUnavailable.js';
|
|
8
10
|
import { RawDiff } from './diff/RawDiff.js';
|
|
9
|
-
import { DiffFallbackBoundary } from './diff/DiffFallbackBoundary.js';
|
|
10
|
-
import { useChatHost } from '../../host.js';
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
12
|
const LegacyUnifiedDiff = lazyNamed(() => import('./diff/LegacyUnifiedDiff.js'), 'default', {
|
|
13
13
|
prefetch: false
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { CloseButton, Dialog, ErrorBoundary, PromptDialog } from '@adecore/ui';
|
|
2
3
|
import { useState } from 'react';
|
|
3
4
|
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import { CloseButton, Dialog, ErrorBoundary, PromptDialog } from '@adecore/ui';
|
|
5
5
|
import { useChatScope } from '../../scope.js';
|
|
6
6
|
import { useChatRow } from '../../state/chats.js';
|
|
7
7
|
import { useVisualDialog } from '../visuals.js';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
|
-
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import clsx from 'clsx';
|
|
5
2
|
import { VISUAL_LIMITS, visualThemeFragment } from '@adecore/agent-contracts/visual';
|
|
6
3
|
import { Spinner, useMeasuredWidth } from '@adecore/ui';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
6
|
+
import { useTranslation } from 'react-i18next';
|
|
7
7
|
import { useChatHost } from '../../host.js';
|
|
8
8
|
import { useChatScope } from '../../scope.js';
|
|
9
|
-
import { DEFAULT_HEIGHT_PX, initialVisualContentHeight, rememberVisualHeight } from '../logic/visual-height.js';
|
|
10
9
|
import { imageDocumentForDisplay } from '../image-display.js';
|
|
10
|
+
import { DEFAULT_HEIGHT_PX, initialVisualContentHeight, rememberVisualHeight } from '../logic/visual-height.js';
|
|
11
11
|
import { VisualBridge } from '../visual-bridge.js';
|
|
12
12
|
import { VisualViewportController } from '../visual-viewport.js';
|
|
13
13
|
import { useVisualTheme } from './visual-theme.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Ref } from 'react';
|
|
2
1
|
import { type AgentKind } from '@adecore/agent-contracts';
|
|
2
|
+
import type { Ref } from 'react';
|
|
3
3
|
import { type WorkflowAgentView } from '../logic/workflow.js';
|
|
4
4
|
import type { SubagentStep } from '../subagent-view.js';
|
|
5
5
|
export declare function WorkflowAgentLine({ view, provider, onOpen, selected, className, ref }: {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
|
-
import clsx from 'clsx';
|
|
3
|
-
import { Bot, ChevronRight, X } from 'lucide-react';
|
|
4
2
|
import { workflowAgentRef } from '@adecore/agent-contracts';
|
|
5
|
-
import { formatElapsedShort } from '@adecore/ui/format';
|
|
6
3
|
import { Icon, useTickingText } from '@adecore/ui';
|
|
4
|
+
import { formatElapsedShort } from '@adecore/ui/format';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import { Bot, ChevronRight, X } from 'lucide-react';
|
|
7
7
|
import { AgentIcon } from '../../agents/AgentIcon.js';
|
|
8
8
|
import { workflowAgentPreview, workflowAgentTime } from '../logic/workflow.js';
|
|
9
9
|
import { ROW_GUTTER } from './icons.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ChatAssistantItem, ChatUserItem } from '@adecore/agent-contracts';
|
|
2
|
-
import { type ClipboardChips } from '../mentions.js';
|
|
3
2
|
import type { TimelineRow } from '../logic/timeline.js';
|
|
3
|
+
import { type ClipboardChips } from '../mentions.js';
|
|
4
4
|
import type { ReferenceLookup } from './reference-lookup.js';
|
|
5
5
|
export declare function messageClipboardChips(item: ChatUserItem | ChatAssistantItem, text: string, lookup: Pick<ReferenceLookup, 'items' | 'referenced'>): ClipboardChips;
|
|
6
6
|
export declare function rowClipboardChips(row: TimelineRow, text: string, lookup: Pick<ReferenceLookup, 'items' | 'referenced'>): ClipboardChips;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type Ref } from 'react';
|
|
2
1
|
import { type ChatInfo } from '@adecore/agent-contracts';
|
|
3
2
|
import { type Shortcut } from '@adecore/ui';
|
|
3
|
+
import { type Ref } from 'react';
|
|
4
4
|
import { type ComposerSendAction, type ComposerSendDraft } from '../../../host.js';
|
|
5
5
|
import type { StashedPrompt } from '../../stash.js';
|
|
6
6
|
import type { ChatControls } from './use-chat-controls.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
|
-
import { useRef, useState } from 'react';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import clsx from 'clsx';
|
|
5
|
-
import { ArrowUp, ChevronDown, Play, Plus, Square } from 'lucide-react';
|
|
6
2
|
import { holdsConversation } from '@adecore/agent-contracts';
|
|
7
3
|
import { Button, ErrorBoundary, Icon, Menu, Tooltip } from '@adecore/ui';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import { ArrowUp, ChevronDown, Play, Plus, Square } from 'lucide-react';
|
|
6
|
+
import { useRef, useState } from 'react';
|
|
7
|
+
import { useTranslation } from 'react-i18next';
|
|
8
8
|
import { useChatHost } from '../../../host.js';
|
|
9
9
|
import { useChatScope } from '../../../scope.js';
|
|
10
10
|
import { useProviders } from '../../../state/providers.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { FileIcon, Icon, Menu, MiddleTruncate, ScrollArea } from '@adecore/ui';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import { SquareSlash, Zap } from 'lucide-react';
|
|
5
|
-
import {
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import { useChatHost } from '../../../host.js';
|
|
7
7
|
import { referenceGlyph } from '../reference-icons.js';
|
|
8
8
|
import { optionIdOf } from './menu-aria.js';
|
|
@@ -320,8 +320,9 @@ function ReferenceMenu(t0) {
|
|
|
320
320
|
const key = item.section?.id ?? item.group;
|
|
321
321
|
groups.set(key, [...(groups.get(key) ?? []), item]);
|
|
322
322
|
}
|
|
323
|
-
t1 = /*#__PURE__*/_jsx(
|
|
324
|
-
className: "max-h-96
|
|
323
|
+
t1 = /*#__PURE__*/_jsx(ScrollArea, {
|
|
324
|
+
className: "max-h-96 border-b border-border",
|
|
325
|
+
viewportClassName: "px-1.5 py-1.5",
|
|
325
326
|
children: referenceMatches.length > 0 ? /*#__PURE__*/_jsx("div", {
|
|
326
327
|
id: listId,
|
|
327
328
|
role: "listbox",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
|
-
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import { Paperclip, X } from 'lucide-react';
|
|
4
2
|
import { Icon, IconButton, Tooltip } from '@adecore/ui';
|
|
3
|
+
import { Paperclip, X } from 'lucide-react';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import { useChatScope } from '../../../scope.js';
|
|
6
6
|
import { formatBytes, isImageAttachment, uploadBytes } from '../../attachments.js';
|
|
7
7
|
import { jumpToTimelineItem } from '../../timeline-scroll.js';
|