Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ index f3488ebd3b..3ebcd4817e 100644
onSendMessage={handleStart}
onReconnectEnvironment={() => onReconnectEnvironment(selectedProject.environmentId)}
diff --git a/apps/mobile/src/features/threads/ThreadComposer.tsx b/apps/mobile/src/features/threads/ThreadComposer.tsx
index 52ef705e93..6a47855b95 100644
index ea2928f531..459bb80636 100644
--- a/apps/mobile/src/features/threads/ThreadComposer.tsx
+++ b/apps/mobile/src/features/threads/ThreadComposer.tsx
@@ -214,6 +214,8 @@ export interface ThreadComposerProps {
Expand All @@ -764,29 +764,29 @@ index 52ef705e93..6a47855b95 100644

<VideoPreviewModal source={previewVideo} onRequestClose={closePreview} />
diff --git a/apps/mobile/src/features/threads/ThreadDetailScreen.tsx b/apps/mobile/src/features/threads/ThreadDetailScreen.tsx
index a71920c199..f1a43ef03f 100644
index d0b08ce405..112c28c3ac 100644
--- a/apps/mobile/src/features/threads/ThreadDetailScreen.tsx
+++ b/apps/mobile/src/features/threads/ThreadDetailScreen.tsx
@@ -191,6 +191,9 @@ import {
@@ -196,6 +196,9 @@ import {
ThreadComposer,
} from "./ThreadComposer";
import { ComposerPopoverHost } from "./ComposerPopoverHost";
+import { composerCompactDisabledReason } from "@t3tools/client-runtime/state/composer-stats";
+import { ComposerStats, COMPOSER_STATS_ROW_HEIGHT } from "./ComposerStats";
+import { useComposerStats } from "../../state/use-composer-stats";
import { ThreadFeed, type ThreadFeedHandle, type ThreadFeedHistoryControls } from "./ThreadFeed";
import { WorkspaceMutationIdProvider } from "./WorkspaceMutationIdProvider";
import { useThreadTurnSubagents } from "./ThreadAgentsSheet";
import { ComposerQueuedEditBanner } from "./ComposerQueuedEdit";
@@ -288,6 +291,8 @@ export interface ThreadDetailScreenProps {
hasAttachmentsOrContext: boolean,
@@ -295,6 +298,8 @@ export interface ThreadDetailScreenProps {
) => Promise<boolean | "responded">,
onWillEnqueue?: () => void,
) => Promise<MessageId | null>;
+ /** Sends "/compact" without touching the draft. */
+ readonly onCompactContext: () => void;
readonly onReconnectEnvironment: () => void;
readonly canSwitchThreadProvider: boolean;
readonly onUpdateThreadInteractionMode?: (interactionMode: ProviderInteractionMode) => void;
@@ -859,10 +864,16 @@ function ThreadDetailBody(props: ThreadDetailScreenProps) {
@@ -901,10 +906,16 @@ function ThreadDetailBody(
) ||
(props.historyControls?.hasMoreHistory === true &&
props.selectedThread.latestUserMessageAt !== null);
Expand All @@ -803,7 +803,7 @@ index a71920c199..f1a43ef03f 100644
composerBottomInset;
// The last collapse toggle; it only applies to the request it was made on.
const [userInputToggle, setUserInputToggle] = useState<{
@@ -1703,6 +1714,32 @@ function ThreadDetailBody(props: ThreadDetailScreenProps) {
@@ -1806,6 +1817,32 @@ function ThreadDetailBody(
hasCompactableConversation={
hasCompactableConversation && !props.isCompacting
}
Expand Down Expand Up @@ -1412,10 +1412,10 @@ index 0000000000..3cc2cb612f
+ }, [enabled, projection, environmentId, serverConfig, instanceId]);
+}
diff --git a/apps/mobile/src/state/use-thread-composer-state.ts b/apps/mobile/src/state/use-thread-composer-state.ts
index 288d37d9f1..7b95614225 100644
index 700d15213f..4916186664 100644
--- a/apps/mobile/src/state/use-thread-composer-state.ts
+++ b/apps/mobile/src/state/use-thread-composer-state.ts
@@ -699,6 +699,45 @@ export function useThreadComposerState() {
@@ -701,6 +701,45 @@ export function useThreadComposerState() {
return messageId;
};

Expand Down Expand Up @@ -1461,7 +1461,7 @@ index 288d37d9f1..7b95614225 100644
const onChangeDraftMessage = (value: string) => {
if (!selectedThreadShell) {
return;
@@ -772,6 +811,7 @@ export function useThreadComposerState() {
@@ -774,6 +813,7 @@ export function useThreadComposerState() {
onNativePasteText,
onRemoveDraftImage,
onSendMessage,
Expand All @@ -1470,10 +1470,10 @@ index 288d37d9f1..7b95614225 100644
};
}
diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx
index e747718875..94a455f0a4 100644
index 735c5cd398..f38a4f05e8 100644
--- a/apps/web/src/components/ChatView.tsx
+++ b/apps/web/src/components/ChatView.tsx
@@ -314,7 +314,7 @@ import { useRightPanelSurfaceClose } from "../hooks/useRightPanelSurfaceClose";
@@ -315,7 +315,7 @@ import { useRightPanelSurfaceClose } from "../hooks/useRightPanelSurfaceClose";
import { ComposerBannerStack, type ComposerBannerStackItem } from "./chat/ComposerBannerStack";
import { modelFallbackBannerItem } from "./chat/ComposerUsageLimits";
import { ComposerStats } from "./chat/ComposerStats";
Expand Down Expand Up @@ -1532,7 +1532,7 @@ index e747718875..94a455f0a4 100644
})();
const pendingBackgroundTasks = deriveThreadPendingBackgroundTasks(serverProjection);
const activeWorkStartedAt =
@@ -3867,15 +3833,12 @@ export default function ChatView(props: ChatViewProps) {
@@ -3880,15 +3846,12 @@ export default function ChatView(props: ChatViewProps) {
{...composerStats}
onCompact={() => composerRef.current?.compactContext()}
compactDisabled={compactDisabled}
Expand All @@ -1555,15 +1555,15 @@ index e747718875..94a455f0a4 100644
subscriptionSwitch={{
providers: providerStatuses,
diff --git a/apps/web/src/components/chat/ChatComposer.tsx b/apps/web/src/components/chat/ChatComposer.tsx
index 82b6b9617c..0c7c910bdb 100644
index 25b7f5ce6f..95fa71d953 100644
--- a/apps/web/src/components/chat/ChatComposer.tsx
+++ b/apps/web/src/components/chat/ChatComposer.tsx
@@ -253,7 +253,7 @@ import {
@@ -252,7 +252,7 @@ import {
resolveComposerDispatchMode,
type ComposerDispatchMode,
} from "@t3tools/client-runtime/state/composer-dispatch";
-import type { ContextWindowSnapshot } from "../../lib/contextWindow";
+import type { ContextWindowSnapshot } from "@t3tools/client-runtime/state/context-window";
-import { deriveLatestContextWindowSnapshot } from "../../lib/contextWindow";
+import { deriveLatestContextWindowSnapshot } from "@t3tools/client-runtime/state/context-window";
import {
resolveProviderSkillsForCwd,
resolveProviderSlashCommandsForCwd,
Expand Down Expand Up @@ -2200,7 +2200,7 @@ index ff9ef9318c..b4e8bb5647 100644
-}
+export * from "@t3tools/client-runtime/state/context-window";
diff --git a/packages/client-runtime/package.json b/packages/client-runtime/package.json
index d1b48e1d76..368eb01716 100644
index 6fd4550d93..9e3e30b447 100644
--- a/packages/client-runtime/package.json
+++ b/packages/client-runtime/package.json
@@ -143,6 +143,14 @@
Expand Down
Loading