Skip to content

Commit 9a1608a

Browse files
feat: Make search input/search result fixed on the top of sidebar
fix #176
1 parent 0dc964b commit 9a1608a

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

media/vscode.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ body,
3131
margin-block-start: 0;
3232
height: 100%;
3333
}
34+
#root {
35+
display: flex;
36+
flex-direction: column;
37+
}
3438

3539
a {
3640
color: var(--vscode-textLink-foreground);

src/webview/SearchSidebar/SearchResultList/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ interface SearchResultListProps {
88

99
const SearchResultList = ({ matches }: SearchResultListProps) => {
1010
return (
11-
<div>
11+
<div style={{ flexGrow: '1', overflowY: 'scroll' }}>
1212
{matches.map(([filePath, match]) => {
1313
return <TreeItem filePath={filePath} matches={match} key={filePath} />
1414
})}

src/webview/SearchSidebar/SearchWidgetContainer/comps/SearchOptions.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const buttonStyle: CSSProperties = {
1717
flex: '0 0 auto',
1818
position: 'absolute',
1919
top: '0',
20-
right: '0'
20+
right: '-2px'
2121
}
2222
const optionsStyle: CSSProperties = {
2323
minHeight: '16px',
@@ -43,7 +43,7 @@ export default function SearchOptions({
4343
<VscEllipsis />
4444
</button>
4545
{showOptions && (
46-
<div style={{ paddingBottom: '4px' }}>
46+
<div style={{ paddingBottom: '6px' }}>
4747
<IncludeFile
4848
includeFile={includeFile}
4949
setIncludeFile={setIncludeFile}

src/webview/SearchSidebar/SearchWidgetContainer/comps/SearchWidget.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import * as stylex from '@stylexjs/stylex'
55

66
const styles = stylex.create({
77
container: {
8-
position: 'relative',
9-
margin: '0 12px 0 2px'
8+
position: 'relative'
109
},
1110
replaceToggle: {
1211
width: 16,

src/webview/SearchSidebar/SearchWidgetContainer/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const SearchWidgetContainer = ({ onQueryChange }: Props) => {
1616
} = useSearchQuery(onQueryChange)
1717

1818
return (
19-
<div>
19+
<div style={{ margin: '0 12px 0 2px' }}>
2020
<SearchWidget
2121
inputValue={inputValue}
2222
setInputValue={setInputValue}

0 commit comments

Comments
 (0)