You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/code-search/compare-file-filtering.mdx
+28-26Lines changed: 28 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,11 @@
2
2
3
3
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.
4
4
5
-
## Query Parameter-Based File Filtering
5
+
## Query parameter-based file filtering
6
6
7
7
The comparison page supports three different query parameters to specify which files to include in the comparison:
8
8
9
-
### 1. Individual File Paths
9
+
### 1. Individual file paths
10
10
11
11
You can specify individual files using either of these parameters:
12
12
@@ -15,17 +15,17 @@ You can specify individual files using either of these parameters:
15
15
16
16
Multiple files can be included by repeating the parameter:
For comparisons with a large number of files, the system supports compressed file lists (newline-separated):
25
25
26
26
-`compressedFileList=base64EncodedCompressedData` - Efficiently packs many file paths
27
27
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.
29
29
30
30
```typescript
31
31
// Behind the scenes, the code decompresses file lists using:
const decompressedData =pako.inflate(compressedData, { to: 'string' })
35
35
```
36
36
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).
-`focus=true&filePath=path/to/specific/file.js` - Show only this file in detail view
47
48
48
-
## File Filtering UI Components
49
+
## File filtering UI components
49
50
50
51
The comparison view provides several UI components to help you filter and navigate files:
51
52
@@ -58,26 +59,26 @@ The FileDiffPicker component allows you to:
58
59
- Toggle between showing all files or only modified files
59
60
- Sort files by different criteria (path, size of change, etc.)
60
61
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.
62
63
63
-
### File Navigation
64
+
### File navigation
64
65
65
66
When viewing diffs, you can:
66
67
67
68
- Click on any file in the sidebar to switch to that file
68
69
- Use keyboard shortcuts to navigate between files
69
70
- 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.)
71
72
72
-
### URL-Based Filtering
73
+
### URL-based filtering
73
74
74
75
Any filters you apply through the UI will update the URL with the appropriate query parameters. This means you can:
75
76
76
77
1. Share specific filtered views with others
77
78
2. Bookmark comparisons with specific file filters
78
79
3. Navigate back and forth between different filter states using browser history
79
80
80
-
## Implementation Details
81
+
## Implementation details
81
82
82
83
The system makes strategic performance trade-offs to provide a smooth user experience:
83
84
@@ -92,25 +93,26 @@ The system makes strategic performance trade-offs to provide a smooth user exper
92
93
*/
93
94
```
94
95
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.
0 commit comments