Skip to content

Commit 03f6f9b

Browse files
committed
add small tweaks
1 parent 40ce3eb commit 03f6f9b

File tree

1 file changed

+28
-26
lines changed

1 file changed

+28
-26
lines changed

docs/code-search/compare-file-filtering.mdx

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
The repository comparison page provides powerful file filtering capabilities that allow you to focus on specific files in a comparison. The system supports multiple ways to specify which files you want to view when comparing branches, tags, or commits.
44

5-
## Query Parameter-Based File Filtering
5+
## Query parameter-based file filtering
66

77
The comparison page supports three different query parameters to specify which files to include in the comparison:
88

9-
### 1. Individual File Paths
9+
### 1. Individual file paths
1010

1111
You can specify individual files using either of these parameters:
1212

@@ -15,17 +15,17 @@ You can specify individual files using either of these parameters:
1515

1616
Multiple files can be included by repeating the parameter:
1717

18-
```
18+
```shell
1919
?filePath=src/index.ts&filePath=src/components/Button.tsx
2020
```
2121

22-
### 2. Compressed File Lists
22+
### 2. Compressed file lists
2323

2424
For comparisons with a large number of files, the system supports compressed file lists (newline-separated):
2525

2626
- `compressedFileList=base64EncodedCompressedData` - Efficiently packs many file paths
2727

28-
This parameter uses base64-encoded, gzip-compressed data to efficiently transmit large sets of file paths. The compression makes it possible to include hundreds or thousands of files in a URL without exceeding length limits. The length limits vary depending on the browser, HTTP server, and other services involved like Cloudflare.
28+
This parameter efficiently transmits large file paths using base64-encoded, gzip-compressed data. The compression allows hundreds or thousands of files to be included in a URL without exceeding length limits, which vary depending on the browser, HTTP server, and other services involved, like Cloudflare.
2929

3030
```typescript
3131
// Behind the scenes, the code decompresses file lists using:
@@ -34,18 +34,19 @@ const compressedData = Uint8Array.from([...decodedData].map(char => char.charCod
3434
const decompressedData = pako.inflate(compressedData, { to: 'string' })
3535
```
3636

37-
One way to create a list of files for the `compressedFileList` parameter is to use Python's built-in libraries to compress and encode using url-safe base64 encoding (which is smaller than base64-encoding, then url-encoding).
37+
One way to create a list of files for the `compressedFileList` parameter is to use Python's built-in libraries to compress and encode using url-safe base64 encoding (smaller than base64-encoding, then url-encoding).
38+
3839
```shell
3940
python3 -c "import sys, zlib, base64; sys.stdout.write(base64.urlsafe_b64encode(zlib.compress(sys.stdin.buffer.read())).decode().rstrip('='))" < list.of.files > list.of.files.deflated.b64url
4041
```
4142

42-
### 3. Special Focus Mode
43+
### 3. Special focus mode
4344

4445
You can focus on a single file using:
4546

4647
- `focus=true&filePath=path/to/specific/file.js` - Show only this file in detail view
4748

48-
## File Filtering UI Components
49+
## File filtering UI components
4950

5051
The comparison view provides several UI components to help you filter and navigate files:
5152

@@ -58,26 +59,26 @@ The FileDiffPicker component allows you to:
5859
- Toggle between showing all files or only modified files
5960
- Sort files by different criteria (path, size of change, etc.)
6061

61-
This component uses a dedicated file metadata query optimized for quick filtering, with results displayed instantly as you type. The component can efficiently handle repositories with thousands of files through client-side filtering.
62+
This component uses a dedicated file metadata query optimized for quick filtering. Results are displayed as you type. Through client-side filtering, the component can efficiently handle repositories with thousands of files.
6263

63-
### File Navigation
64+
### File navigation
6465

6566
When viewing diffs, you can:
6667

6768
- Click on any file in the sidebar to switch to that file
6869
- Use keyboard shortcuts to navigate between files
6970
- Toggle between expanded and collapsed views of files
70-
- Show or hide certain types of changes (additions, deletions, etc.)
71+
- Show or hide specific changes (additions, deletions, etc.)
7172

72-
### URL-Based Filtering
73+
### URL-based filtering
7374

7475
Any filters you apply through the UI will update the URL with the appropriate query parameters. This means you can:
7576

7677
1. Share specific filtered views with others
7778
2. Bookmark comparisons with specific file filters
7879
3. Navigate back and forth between different filter states using browser history
7980

80-
## Implementation Details
81+
## Implementation details
8182

8283
The system makes strategic performance trade-offs to provide a smooth user experience:
8384

@@ -92,25 +93,26 @@ The system makes strategic performance trade-offs to provide a smooth user exper
9293
*/
9394
```
9495

95-
The file filtering system uses a specialized file metadata query that is faster and more lightweight than the comprehensive file diffs query used for displaying actual code changes.
96+
The file filtering system uses a specialized file metadata query that is faster and lighter than the comprehensive file diffs query used to display actual code changes.
9697

97-
## Usage Examples
98+
## Usage examples
9899

99100
1. View only JavaScript files:
100101

101-
```
102-
?filePath=src/utils.js&filePath=src/components/App.js
103-
```
102+
```bash
103+
?filePath=src/utils.js&filePath=src/components/App.js
104+
```
104105

105106
2. Focus on a single file:
106107

107-
```
108-
?focus=true&filePath=src/components/Button.tsx
109-
```
108+
```bash
109+
?focus=true&filePath=src/components/Button.tsx
110+
```
111+
112+
3. Use a compressed file list for many files:
110113

111-
3. Use compressed file list for many files:
112-
```
113-
?compressedFileList=H4sIAAAAAAAAA2NgYGBg...
114-
```
114+
```bash
115+
?compressedFileList=H4sIAAAAAAAAA2NgYGBg...
116+
```
115117

116-
This flexible filtering system allows you to create customized views of repository comparisons, making it easier to review changes in large projects.
118+
This flexible filtering system allows you to create customized views of repository comparisons, making reviewing changes in large projects easier.

0 commit comments

Comments
 (0)