feat(client): give more space to the quick search bar

This commit is contained in:
perf3ct 2025-06-16 21:01:02 +00:00
parent 797ed2f306
commit 8a3db3f4f7
No known key found for this signature in database
GPG Key ID: 569C4EEC436F5232
2 changed files with 12 additions and 9 deletions

View File

@ -142,7 +142,7 @@ const GlobalSearchBar: React.FC<GlobalSearchBarProps> = ({ sx, ...props }) => {
query: searchQuery.trim(), query: searchQuery.trim(),
limit: 5, // Show only top 5 results in global search limit: 5, // Show only top 5 results in global search
include_snippets: true, // Include snippets for context include_snippets: true, // Include snippets for context
snippet_length: 100, // Shorter snippets for quick search snippet_length: 200, // Longer snippets for better context in quick search
search_mode: searchQuery.length < 4 ? 'fuzzy' : 'simple', // Use fuzzy for short queries (substring matching) search_mode: searchQuery.length < 4 ? 'fuzzy' : 'simple', // Use fuzzy for short queries (substring matching)
}; };
@ -364,8 +364,9 @@ const GlobalSearchBar: React.FC<GlobalSearchBarProps> = ({ sx, ...props }) => {
), ),
}} }}
sx={{ sx={{
minWidth: 320, width: '100%',
maxWidth: 420, minWidth: 600,
maxWidth: 1200,
'& .MuiOutlinedInput-root': { '& .MuiOutlinedInput-root': {
background: theme.palette.mode === 'light' background: theme.palette.mode === 'light'
? 'linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(248,250,252,0.90) 100%)' ? 'linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(248,250,252,0.90) 100%)'
@ -698,17 +699,18 @@ const GlobalSearchBar: React.FC<GlobalSearchBarProps> = ({ sx, ...props }) => {
variant="caption" variant="caption"
color="text.secondary" color="text.secondary"
sx={{ sx={{
display: 'block', display: '-webkit-box',
overflow: 'hidden', overflow: 'hidden',
textOverflow: 'ellipsis', WebkitBoxOrient: 'vertical',
whiteSpace: 'nowrap', WebkitLineClamp: 2,
fontSize: '0.7rem', fontSize: '0.7rem',
fontStyle: 'italic', fontStyle: 'italic',
maxWidth: '100%', maxWidth: '100%',
flex: 1, flex: 1,
lineHeight: 1.3,
}} }}
> >
{highlightText(doc.snippets[0]?.text?.substring(0, 80) + '...' || '', query)} {highlightText(doc.snippets[0]?.text?.substring(0, 150) + '...' || '', query)}
</Typography> </Typography>
)} )}
</Box> </Box>

View File

@ -363,7 +363,8 @@ const AppLayout: React.FC<AppLayoutProps> = ({ children }) => {
<Typography variant="h6" noWrap component="div" sx={{ <Typography variant="h6" noWrap component="div" sx={{
fontWeight: 700, fontWeight: 700,
mr: 2, mr: 1,
fontSize: '1.1rem',
background: theme.palette.mode === 'light' background: theme.palette.mode === 'light'
? 'linear-gradient(135deg, #1e293b 0%, #6366f1 100%)' ? 'linear-gradient(135deg, #1e293b 0%, #6366f1 100%)'
: 'linear-gradient(135deg, #f8fafc 0%, #a855f7 100%)', : 'linear-gradient(135deg, #f8fafc 0%, #a855f7 100%)',
@ -376,7 +377,7 @@ const AppLayout: React.FC<AppLayoutProps> = ({ children }) => {
</Typography> </Typography>
{/* Global Search Bar */} {/* Global Search Bar */}
<Box sx={{ flexGrow: 1, display: 'flex', justifyContent: 'center', mr: 3 }}> <Box sx={{ flexGrow: 1, display: 'flex', justifyContent: 'center', mx: 2 }}>
<GlobalSearchBar /> <GlobalSearchBar />
</Box> </Box>