-
-
Notifications
You must be signed in to change notification settings - Fork 116
Description
Mobile & Desktop Layout Issues
Multiple persistent layout and UX issues, primarily affecting mobile views. Issues span across DocumentKnowledgeBase, Corpuses view, and their child components.
Issue #1: Bottom tray menu covers chat input for doc chat (Mobile)
Location: frontend/src/components/knowledge_base/document/DocumentKnowledgeBase.tsx
Analysis:
FloatingInputWrapper(line 248) hasz-index: 850on mobile- Mobile tab bar/tray menu likely has higher z-index causing overlap
- Mobile positioning uses
top: 80pxinstead of bottom positioning (lines 258-270) - Root Cause: Z-index stacking context issue - need proper z-index hierarchy for mobile UI elements
Components Involved:
FloatingInputWrapper(DocumentKnowledgeBase.tsx:248)MobileTabBar(DocumentKnowledgeBase.tsx:106)ChatTray(needs verification)
Issue #2: Chat bar not locked to bottom, disappears as conversation grows (Mobile)
Location: frontend/src/components/knowledge_base/document/right_tray/ChatTray.tsx (referenced but file not fully analyzed)
Expected Structure (from CorpusChat.tsx as reference):
MessagesArea:flex: 1,overflow-y: auto(scrollable)ChatInputWrapper:flex-shrink: 0(sticky to bottom)
Root Cause: ChatTray component likely missing flex-shrink: 0 on input container, or parent container not using flexbox properly.
Reference Implementation:
See CorpusChat.tsx:1501-1675 for correct pattern.
Issue #3: Cursor not auto-focused in input on corpus page load (Mobile)
Location: frontend/src/views/Corpuses.tsx:446-451 (CorpusQueryView component)
Current Code:
useEffect(() => {
if (isSearchMode && inputRef.current) {
setTimeout(() => inputRef.current?.focus(), 100);
}
}, [isSearchMode]);Root Causes:
- Timing issue: FloatingSearchContainer may not be visible when focus is called
- Mobile browser restriction: iOS Safari blocks programmatic focus unless triggered by user gesture
- Component lifecycle: Effect may fire before input element is rendered
- Missing initial mount focus: Only focuses when
isSearchModechanges, not on initial load
Fix Strategy:
- Add
autoFocusattribute to input element - Focus on initial mount AND mode changes
- May need user gesture workaround for iOS
Issue #4: Corpus chat back and home buttons don't work (Mobile)
Locations:
frontend/src/views/Corpuses.tsx:483-527(ChatNavigationHeader)frontend/src/components/corpuses/CorpusChat.tsx:1448-1477(ChatNavigationHeader)
Analysis:
CRITICAL: Two separate navigation headers competing for control, violating routing mantra.
Header 1: Corpuses.tsx (lines 483-527)
<BackButton onClick={show_query_view_state === "VIEW"
? () => showQueryViewState("ASK")
: resetToSearch
}>- Back: calls
showQueryViewState("VIEW")orresetToSearch - Home: calls
showQueryViewState("ASK")
Header 2: CorpusChat.tsx (lines 1448-1477)
{use_mobile_layout && isConversation && (
<ChatNavigationHeader>
<BackButton onClick={() => {
if (selectedConversationId || !isNewChat) {
setSelectedConversationId(undefined);
setIsNewChat(false);
setChat([]);
setServerMessages([]);
} else {
showQueryViewState("ASK");
}
}}>Root Cause: On mobile, both headers may be rendered, causing state conflicts. CorpusChat's internal navigation doesn't properly communicate with parent CorpusQueryView state.
Routing System Violations:
Per docs/frontend/routing_system.md:
- ❌ Components manually managing state instead of using navigation utilities
- ❌ Multiple components trying to control same state (showQueryViewState)
- ✅ Should: Use callback props for parent-child communication
- ✅ Should: Centralize navigation logic via URL navigation
- ✅ Should: Call
navigate()and let routing system handle state
Fix Strategy:
- Remove duplicate headers
- Use callback props (
onBack,onHome) to communicate between CorpusChat and parent - Centralize navigation logic in one place
- Consider moving
showQueryViewStateto URL-driven state if it needs to be bookmarkable
Reference: See routing docs sections on "Navigation Components" and "Best Practices - Navigation"
Issue #5: Edit LabelSet modal is atrocity on mobile
Location: frontend/src/components/widgets/CRUD/LabelSetSelector.tsx (component not analyzed)
Analysis:
Used in three CRUD modals in Corpuses.tsx:
- Lines 2340, 2374, 2398
Root Cause: LabelSetSelector component lacks mobile-responsive styling.
Components to Check:
LabelSetSelectorcomponentCRUDModalparent component- Form layout/grid system
Issue #6: Ensure we can see and edit corpus and doc agent prompts
Type: Feature Request (not a bug)
Locations to Add:
- Corpus prompts: Add to
frontend/src/components/corpuses/CorpusSettings.tsx - Document prompts: Need to check if DocumentSettings panel exists
Implementation Needed:
- Add prompt editor fields to settings panels
- Wire up GraphQL mutations for saving prompts
- Add validation and preview functionality
Issue #7: Corpus settings mobile layout is bad, especially metadata controls
Location: frontend/src/components/corpuses/CorpusSettings.tsx (imported at Corpuses.tsx:116, used at line 2005)
Analysis:
Specific problem area: "metadata controls" - form inputs for corpus metadata
Root Cause: CorpusSettings component lacks mobile-responsive styling for form controls.
Areas to Fix:
- Form field layout/stacking
- Input field sizing
- Button positioning/sizing
- Modal/panel width constraints
- Metadata control grid/flex layout
Summary by File
DocumentKnowledgeBase.tsx
- Issue Bump postgres from 14.5 to 15.0 in /compose/production/postgres #1: Z-index conflicts
- Issue Bump traefik from v2.8.7 to v2.9.1 in /compose/production/traefik #2: Verify ChatTray structure (file truncated in analysis)
Corpuses.tsx
- Issue Bump actions/setup-node from 3.4.1 to 3.5.1 #3: Focus timing and mobile restrictions (lines 446-451)
- Issue Bump responses from 0.21.0 to 0.22.0 #4: Duplicate navigation headers (lines 483-527) - Routing violation
CorpusChat.tsx
- Issue Bump responses from 0.21.0 to 0.22.0 #4: Mobile navigation conflicts with parent (lines 1448-1477) - Routing violation
Components Not Yet Analyzed
- ChatTray.tsx (Issue Bump traefik from v2.8.7 to v2.9.1 in /compose/production/traefik #2)
- LabelSetSelector.tsx (Issue Bump actions/checkout from 3.0.2 to 3.1.0 #5)
- CorpusSettings.tsx (Issue Bump mypy from 0.971 to 0.982 #7)
- Missing feature (Issue Bump flake8-isort from 4.1.1 to 5.0.0 #6)
Routing System References
Relevant Documentation: docs/frontend/routing_system.md
Issue #4 Specific Guidance:
From Best Practices - Navigation section:
// ✅ CORRECT - Let routing system handle state
const handleNavigate = () => {
navigate("/corpuses");
// DON'T manually manage state - routing system handles this
};From Component Ecosystem - Navigation Components section:
- NavMenu/MobileNavMenu pattern: Just call
navigate(), no manual state clearing - Use callback props for parent-child communication
- Avoid multiple components competing for same state control
Key Rules for Issue #4 Fix:
- Remove duplicate navigation headers - only one source of truth
- Use callback props - CorpusChat should accept
onBackandonHomecallbacks from parent - Parent controls navigation - CorpusQueryView (in Corpuses.tsx) should own the navigation decisions
- Child reports intent - CorpusChat just calls
onBack()oronHome()and parent decides what that means - URL-driven state - Consider if
showQueryViewStateshould be in URL for bookmarking/sharing
Next Steps
- Fix z-index hierarchy for mobile UI elements (Bump postgres from 14.5 to 15.0 in /compose/production/postgres #1)
- Verify and fix ChatTray flexbox layout (Bump traefik from v2.8.7 to v2.9.1 in /compose/production/traefik #2)
- Add autoFocus and improve focus handling (Bump actions/setup-node from 3.4.1 to 3.5.1 #3)
- Consolidate navigation headers following routing mantra (Bump responses from 0.21.0 to 0.22.0 #4)
- Add mobile responsive styles to LabelSetSelector (Bump actions/checkout from 3.0.2 to 3.1.0 #5)
- Implement agent prompt editing UI (Bump flake8-isort from 4.1.1 to 5.0.0 #6)
- Add mobile responsive styles to CorpusSettings (Bump mypy from 0.971 to 0.982 #7)