generated from nhcarrigan/template
chore: remove "single connection only" messaging
This commit is contained in:
@@ -192,8 +192,8 @@
|
|||||||
{conversation.name}
|
{conversation.name}
|
||||||
</span>
|
</span>
|
||||||
{#if id !== activeConversationId && id === connectedConversationId}
|
{#if id !== activeConversationId && id === connectedConversationId}
|
||||||
<span class="text-xs text-[var(--text-tertiary)]" title="This tab has the active Claude connection">
|
<span class="text-xs text-[var(--text-tertiary)]" title="This tab has the Claude connection">
|
||||||
(active)
|
(connected)
|
||||||
</span>
|
</span>
|
||||||
{/if}
|
{/if}
|
||||||
{#if hasUnreadMessages(id, conversation)}
|
{#if hasUnreadMessages(id, conversation)}
|
||||||
@@ -233,7 +233,7 @@
|
|||||||
<button
|
<button
|
||||||
onclick={createNewTab}
|
onclick={createNewTab}
|
||||||
class="new-tab-btn flex items-center justify-center w-7 h-7 rounded hover:bg-[var(--bg-tertiary)] text-[var(--text-secondary)] transition-colors"
|
class="new-tab-btn flex items-center justify-center w-7 h-7 rounded hover:bg-[var(--bg-tertiary)] text-[var(--text-secondary)] transition-colors"
|
||||||
title="New conversation (Ctrl+T) Note: Only one tab can be connected at a time"
|
title="New conversation (Ctrl+T)"
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
class="w-4 h-4"
|
class="w-4 h-4"
|
||||||
|
|||||||
@@ -46,8 +46,6 @@
|
|||||||
let messageToSend = formattedMessage;
|
let messageToSend = formattedMessage;
|
||||||
if (getShouldRestoreHistory()) {
|
if (getShouldRestoreHistory()) {
|
||||||
const savedHistory = getSavedHistory();
|
const savedHistory = getSavedHistory();
|
||||||
console.log("Should restore history:", true);
|
|
||||||
console.log("Saved history:", savedHistory);
|
|
||||||
|
|
||||||
if (savedHistory) {
|
if (savedHistory) {
|
||||||
// Prepend the conversation history with a context message
|
// Prepend the conversation history with a context message
|
||||||
@@ -57,13 +55,9 @@ ${savedHistory}
|
|||||||
[Continuing conversation after reconnection:]
|
[Continuing conversation after reconnection:]
|
||||||
User: ${formattedMessage}`;
|
User: ${formattedMessage}`;
|
||||||
|
|
||||||
console.log("Message with history:", messageToSend);
|
|
||||||
|
|
||||||
// Clear the restoration flags
|
// Clear the restoration flags
|
||||||
clearHistoryRestore();
|
clearHistoryRestore();
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
console.log("Should restore history:", false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset notification state for new user message
|
// Reset notification state for new user message
|
||||||
@@ -93,14 +87,10 @@ User: ${formattedMessage}`;
|
|||||||
async function handleInterrupt() {
|
async function handleInterrupt() {
|
||||||
// Save the conversation history FIRST before anything else
|
// Save the conversation history FIRST before anything else
|
||||||
const history = claudeStore.getConversationHistory();
|
const history = claudeStore.getConversationHistory();
|
||||||
console.log("Saving conversation history:", history);
|
|
||||||
|
|
||||||
if (history) {
|
if (history) {
|
||||||
setSavedHistory(history);
|
setSavedHistory(history);
|
||||||
setShouldRestoreHistory(true);
|
setShouldRestoreHistory(true);
|
||||||
console.log("History saved and restoration flag set");
|
|
||||||
} else {
|
|
||||||
console.log("No history to save");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -199,34 +199,6 @@ function createConversationsStore() {
|
|||||||
characterState.setState(targetConv.characterState);
|
characterState.setState(targetConv.characterState);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Auto-reconnect logic
|
|
||||||
if (targetConv && targetConv.connectionStatus === "disconnected") {
|
|
||||||
// Check if another conversation is connected
|
|
||||||
let hasConnectedConv = false;
|
|
||||||
for (const [convId, conv] of convs) {
|
|
||||||
if (convId !== id && (conv.connectionStatus === "connected" || conv.connectionStatus === "connecting")) {
|
|
||||||
hasConnectedConv = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hasConnectedConv) {
|
|
||||||
// Add a note about the limitation
|
|
||||||
const lineId = generateLineId();
|
|
||||||
conversations.update((c) => {
|
|
||||||
const conv = c.get(id);
|
|
||||||
if (conv) {
|
|
||||||
conv.terminalLines.push({
|
|
||||||
id: lineId,
|
|
||||||
type: "system",
|
|
||||||
content: "Another tab is connected. Disconnect it first or use that tab.",
|
|
||||||
timestamp: new Date(),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return c;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -4,26 +4,21 @@ let savedHistory: string | null = null;
|
|||||||
|
|
||||||
export function setShouldRestoreHistory(should: boolean) {
|
export function setShouldRestoreHistory(should: boolean) {
|
||||||
shouldRestore = should;
|
shouldRestore = should;
|
||||||
console.log("Setting shouldRestoreHistory to:", should);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function setSavedHistory(history: string | null) {
|
export function setSavedHistory(history: string | null) {
|
||||||
savedHistory = history;
|
savedHistory = history;
|
||||||
console.log("Setting savedHistory, length:", history?.length || 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getShouldRestoreHistory(): boolean {
|
export function getShouldRestoreHistory(): boolean {
|
||||||
console.log("Getting shouldRestoreHistory:", shouldRestore);
|
|
||||||
return shouldRestore;
|
return shouldRestore;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getSavedHistory(): string | null {
|
export function getSavedHistory(): string | null {
|
||||||
console.log("Getting savedHistory, length:", savedHistory?.length || 0);
|
|
||||||
return savedHistory;
|
return savedHistory;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function clearHistoryRestore() {
|
export function clearHistoryRestore() {
|
||||||
console.log("Clearing history restore flags");
|
|
||||||
shouldRestore = false;
|
shouldRestore = false;
|
||||||
savedHistory = null;
|
savedHistory = null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ const messageModeStore = writable<string>("chat");
|
|||||||
export const messageMode = {
|
export const messageMode = {
|
||||||
subscribe: messageModeStore.subscribe,
|
subscribe: messageModeStore.subscribe,
|
||||||
set: (mode: string) => {
|
set: (mode: string) => {
|
||||||
console.log("Setting message mode to:", mode);
|
|
||||||
messageModeStore.set(mode);
|
messageModeStore.set(mode);
|
||||||
},
|
},
|
||||||
reset: () => messageModeStore.set("chat"),
|
reset: () => messageModeStore.set("chat"),
|
||||||
|
|||||||
@@ -225,14 +225,6 @@ export async function initializeTauriListeners() {
|
|||||||
const outputUnlisten = await listen<OutputPayload>("claude:output", (event) => {
|
const outputUnlisten = await listen<OutputPayload>("claude:output", (event) => {
|
||||||
const { line_type, content, tool_name, conversation_id } = event.payload;
|
const { line_type, content, tool_name, conversation_id } = event.payload;
|
||||||
|
|
||||||
// Debug log
|
|
||||||
const activeId = get(claudeStore.activeConversationId);
|
|
||||||
console.log("claude:output event", {
|
|
||||||
conversation_id,
|
|
||||||
activeConversationId: activeId,
|
|
||||||
line_type,
|
|
||||||
content: content.substring(0, 50) + "...",
|
|
||||||
});
|
|
||||||
|
|
||||||
// Always store the output to the correct conversation
|
// Always store the output to the correct conversation
|
||||||
if (conversation_id) {
|
if (conversation_id) {
|
||||||
@@ -308,8 +300,6 @@ export async function initializeTauriListeners() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
unlisteners.push(permissionUnlisten);
|
unlisteners.push(permissionUnlisten);
|
||||||
|
|
||||||
console.log("Tauri event listeners initialized");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function cleanupTauriListeners() {
|
export function cleanupTauriListeners() {
|
||||||
@@ -319,6 +309,4 @@ export function cleanupTauriListeners() {
|
|||||||
|
|
||||||
// Cleanup notification rules
|
// Cleanup notification rules
|
||||||
cleanupNotificationRules();
|
cleanupNotificationRules();
|
||||||
|
|
||||||
console.log("Tauri event listeners cleaned up");
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user