diff --git a/src/components/journal/ErrorPopup.tsx b/src/components/journal/ErrorPopup.tsx new file mode 100644 index 0000000..73c2558 --- /dev/null +++ b/src/components/journal/ErrorPopup.tsx @@ -0,0 +1,30 @@ +/** + * ErrorPopup — shows the full error message in a floating panel above + * the journal input area. Toggled by clicking the truncated error text. + */ +import { Component, Show } from "solid-js"; + +interface ErrorPopupProps { + message: string | null; + show: boolean; + onClose: () => void; +} + +export const ErrorPopup: Component = (props) => { + return ( + +
+
+

{props.message}

+ +
+
+
+ ); +}; \ No newline at end of file diff --git a/src/components/journal/JournalInput.tsx b/src/components/journal/JournalInput.tsx index e6304fe..516f49f 100644 --- a/src/components/journal/JournalInput.tsx +++ b/src/components/journal/JournalInput.tsx @@ -26,6 +26,7 @@ import { parseInput } from "./command-parser"; import type { CompletionItem } from "./command-parser"; import { buildCompletions } from "./command-completions"; import { CompletionsDropdown } from "./CompletionsDropdown"; +import { ErrorPopup } from "./ErrorPopup"; // ---- Component ---- @@ -39,6 +40,7 @@ export const JournalInput: Component = () => { const [text, setText] = createSignal(""); const [error, setError] = createSignal(null); + const [showErrorPopup, setShowErrorPopup] = createSignal(false); const [sending, setSending] = createSignal(false); const [showCompletions, setShowCompletions] = createSignal(false); const [selectedIdx, setSelectedIdx] = createSignal(0); @@ -406,7 +408,13 @@ export const JournalInput: Component = () => {
-

{error()}

+
+ + {/* Error popup */} + setShowErrorPopup(false)} + /> ); };