Skip to content

fix(web): show mobile doc selector when no KB doc is selected#84

Merged
mhersson merged 1 commit into
mainfrom
ctxmax-480/the-kb-on-mobile-doesn-t-show-docs
May 11, 2026
Merged

fix(web): show mobile doc selector when no KB doc is selected#84
mhersson merged 1 commit into
mainfrom
ctxmax-480/the-kb-on-mobile-doesn-t-show-docs

Conversation

@contextmatrix-runner
Copy link
Copy Markdown
Contributor

Summary

After CTXMAX-476 made the Knowledge Base tab mobile-responsive, mobile users opening the KB tab with no doc selected saw "Select a doc" with no way to open the doc selector — the desktop sidebar is hidden on mobile (hidden md:flex) and the only sheet trigger lived inside KnowledgeDocViewer / KnowledgeDocEditor, which only render when a doc IS selected. Same dead-end for the "No knowledge base docs yet." fallback when the project has no built KB — the Refresh button is in the unreachable sidebar.

Changes

  • New MobileDocTrigger component (open-book icon + label + chevron, md:hidden).
  • Render the trigger in both no-doc-selected fallback branches in KnowledgeBase.tsx so mobile users can always reach the MobileDocSheet.
  • Refactor KnowledgeDocViewer and KnowledgeDocEditor to consume the shared component (dedupes ~20 lines of SVG markup per call site, drops both files in line with the ~150-line guideline).
  • Update web/CLAUDE.md Mobile Knowledge Base architecture table and Behaviour subsection.

Test plan

  • cd web && npm run lint clean
  • cd web && npm run build clean
  • Manual smoke on a mobile-width viewport (Chrome devtools, iPhone 15 preset, 393×852):
    • KB tab on a project with built docs and no doc selected → "Choose a document" trigger → tap → sheet opens → tap a doc → sheet closes → trigger now shows the doc name
    • KB tab on a project with no built KB → trigger above "No knowledge base docs yet." → tap → sheet opens with Refresh button reachable
    • Resize ≥768px → trigger hidden, desktop two-column layout unchanged

- Add MobileDocTrigger component reused by viewer/editor
- Render trigger in KnowledgeBase fallback branches so mobile users can
  reach the sheet from "Select a doc" and "No KB yet" states
- Refactor KnowledgeDocViewer/Editor to consume the shared component
- Update web/CLAUDE.md Mobile Knowledge Base architecture
@mhersson mhersson merged commit dcc74cd into main May 11, 2026
3 checks passed
@mhersson mhersson deleted the ctxmax-480/the-kb-on-mobile-doesn-t-show-docs branch May 11, 2026 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant