[optimize] Mobile responsive design for Dashboard routes#92
Conversation
Co-authored-by: TechQuery <19969570+TechQuery@users.noreply.github.com>
Co-authored-by: TechQuery <19969570+TechQuery@users.noreply.github.com>
Co-authored-by: TechQuery <19969570+TechQuery@users.noreply.github.com>
Co-authored-by: TechQuery <19969570+TechQuery@users.noreply.github.com>
components/User/SessionBox.tsx
Outdated
| sx={{ | ||
| display: { xs: 'flex', md: 'none' }, | ||
| position: 'sticky', | ||
| top: 0, | ||
| zIndex: 1100, | ||
| bgcolor: 'background.paper', | ||
| borderBottom: 1, | ||
| borderColor: 'divider', | ||
| p: 1, | ||
| }} |
There was a problem hiding this comment.
全局都优先使用 Tailwind CSS 类名,除非是过于动态或只有内部 API 才能实现的样式修改。
There was a problem hiding this comment.
Migrated SessionBox to use Tailwind CSS classes (flex, flex-col, md:flex-row, sticky, top-0, z-[1100], border-b, p-1, md:hidden, bg-background-paper, border-divider, w-[250px], flex-1, px-2, pb-3, sm:px-3, etc.). Only kept MUI sx for boxShadow and Drawer paper customization which are MUI-specific internal APIs. (commit 61e7041)
There was a problem hiding this comment.
全局都优先使用 Tailwind CSS 类名
@copilot 我说的“全局”指的是整个项目,至少也是本 PR 所有文件。
There was a problem hiding this comment.
Migrated all files in this PR to use Tailwind CSS classes globally:
- SessionBox: List padding, ListItemButton borderRadius
- Dashboard index: Container, Typography, Form, Button (removed 33 lines of sx)
- Project evaluation: Container, Typography, all chat message layout, Avatar, Paper, form inputs (removed 82 lines of sx)
Only kept MUI sx for:
- Drawer paper customization (MUI internal selector)
- Modal boxShadow (MUI's 0-24 scale)
- Theme color values (
primary.light,primary.contrastText) - Grid spacing (component-specific prop)
Total: 115 lines of sx code removed across all PR files. (commit f4a94e4)
…ildren, Tailwind CSS Co-authored-by: TechQuery <19969570+TechQuery@users.noreply.github.com>
Co-authored-by: TechQuery <19969570+TechQuery@users.noreply.github.com>
[optimize] simplify Chat UI layout [optimize] submit Chat messages with Ctrl + Enter keys
Mobile Adaptation for Dashboard Routes ✅
All Tasks Completed:
Latest Changes (complete Tailwind CSS migration):
SessionBox Component (
components/User/SessionBox.tsx)sx={{ px: 2 }}→className="px-2"sx={{ borderRadius: 1 }}→className="rounded"sxfor MUI Drawer paper and Modal boxShadow (internal APIs)Dashboard Index Page (
pages/dashboard/index.tsx)sx={{ py: { xs: 3, md: 8 } }}→className="py-3 md:py-8"<form>with Tailwind flex classessx={{ whiteSpace, minWidth }}→className="min-w-full whitespace-nowrap sm:min-w-0"sx={{ textAlign, mt }}→className="mt-4 text-center"Project Evaluation Page (
pages/dashboard/project/[id].tsx)<div>with Tailwindsxfor MUI-specific backgroundColor/color (theme values)Tailwind CSS Coverage:
flex,flex-col,flex-row,flex-1xs:,sm:,md:breakpoint prefixesp-*,px-*,py-*,m-*,mt-*,mb-*,gap-*w-*,h-*,min-w-*,max-w-*text-*, font sizes with bracketstext-[1.5rem]sticky,absolute,top-*,left-*,translate-*border-*,rounded,rounded-[custom]hidden,blockitems-*,justify-*,text-centeropacity-*,shadow-*z-[1100],overflow-*,whitespace-nowrapRemaining MUI sx Usage (necessary for MUI internals):
.MuiDrawer-paperselector)primary.light,primary.contrastText)Code Reduction:
The mobile adaptation is complete with comprehensive Tailwind CSS migration across all modified files!
Original prompt
Fixes #59
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.