mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 04:44:21 +01:00
Simplify question prompt UI with space-saving design (#166)
* ralph: ralph-question-minimizerestore-feature completed after 2 iterations * Simplify question prompt UI with space-saving design - Remove redundant navigation chevrons, keep only title click to toggle - Add drag-down gesture support to minimize question prompt - Show minimize button and chevron icons to indicate toggle capability - Update minimized indicator with orange theme matching app accent - Add Question: prefix to minimized state for clarity - Hide dismiss button on mobile minimized state - Increase title bar padding for better touch targets
This commit is contained in:
1 parent
72a2356f2f
commit
ba15fb31e4
3 files changed
+149
-88
No files matched your search
@@ -42,6 +42,7 @@ import { createOpenCodeClient } from "@/api/opencode";
|
||||
import { useSessionStatus, useSessionStatusForSession } from "@/stores/sessionStatusStore";
|
||||
import { useQuestions } from "@/contexts/EventContext";
|
||||
import { QuestionPrompt } from "@/components/session/QuestionPrompt";
|
||||
import { MinimizedQuestionIndicator } from "@/components/session/MinimizedQuestionIndicator";
|
||||
import { PendingActionsGroup } from "@/components/notifications/PendingActionsGroup";
|
||||
import { SourceControlPanel } from "@/components/source-control";
|
||||
import { SessionTodoDisplay } from "@/components/message/SessionTodoDisplay";
|
||||
@@ -73,6 +74,7 @@ export function SessionDetail() {
|
||||
const [selectedFilePath, setSelectedFilePath] = useState<string | undefined>();
|
||||
const [showScrollButton, setShowScrollButton] = useState(false);
|
||||
const [hasPromptContent, setHasPromptContent] = useState(false);
|
||||
const [minimizedQuestion, setMinimizedQuestion] = useState<QuestionRequest | null>(null);
|
||||
|
||||
const handleSwipeBack = useCallback(() => {
|
||||
navigate(`/repos/${repoId}`);
|
||||
@@ -148,6 +150,20 @@ export function SessionDetail() {
|
||||
const handleShowSessionsDialog = useCallback(() => setSessionsDialogOpen(true), []);
|
||||
const handleShowHelpDialog = useCallback(() => openSettings(), [openSettings]);
|
||||
|
||||
const handleMinimizeQuestion = useCallback((question: QuestionRequest) => {
|
||||
setMinimizedQuestion(question)
|
||||
}, [])
|
||||
|
||||
const handleRestoreQuestion = useCallback(() => {
|
||||
setMinimizedQuestion(null)
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
if (minimizedQuestion && minimizedQuestion.sessionID !== sessionId) {
|
||||
setMinimizedQuestion(null)
|
||||
}
|
||||
}, [sessionId, minimizedQuestion])
|
||||
|
||||
const handleNewSession = useCallback(async () => {
|
||||
try {
|
||||
const newSession = await createSession.mutateAsync({ agent: undefined });
|
||||
@@ -517,12 +533,20 @@ export function SessionDetail() {
|
||||
{ttsEnabled && lastAssistantText && !hasPromptContent && !hasActiveStream && (
|
||||
<FloatingTTSButton content={lastAssistantText} />
|
||||
)}
|
||||
{currentQuestion && currentQuestion.sessionID === sessionId && (
|
||||
{minimizedQuestion && minimizedQuestion.sessionID === sessionId && (
|
||||
<MinimizedQuestionIndicator
|
||||
question={minimizedQuestion}
|
||||
onRestore={handleRestoreQuestion}
|
||||
onDismiss={() => rejectQuestion(minimizedQuestion.id)}
|
||||
/>
|
||||
)}
|
||||
{!minimizedQuestion && currentQuestion && currentQuestion.sessionID === sessionId && (
|
||||
<QuestionPrompt
|
||||
key={currentQuestion.id}
|
||||
question={currentQuestion}
|
||||
onReply={replyToQuestion}
|
||||
onReject={rejectQuestion}
|
||||
onMinimize={() => handleMinimizeQuestion(currentQuestion)}
|
||||
/>
|
||||
)}
|
||||
<PromptInput
|
||||
|
||||
Reference in new issue
Block a user