Skip to content

Commit ed49c81

Browse files
ci: apply automated fixes
1 parent 8b53a9a commit ed49c81

File tree

6 files changed

+160
-169
lines changed

6 files changed

+160
-169
lines changed

docs/router/framework/react/how-to/drafts/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ When implementing a guide from a draft:
5858
## Content Sources
5959

6060
Most staged content originates from:
61+
6162
- `navigate-with-search-params.md` - Content moved to maintain focus
6263
- Implementation planning sessions
63-
- User feedback and common questions
64+
- User feedback and common questions

docs/router/framework/react/how-to/drafts/build-search-filtering-systems.draft.md

Lines changed: 35 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
**Final Destination:** `docs/router/framework/react/how-to/build-search-filtering-systems.md`
44
**Progressive Series Position:** Specialized Use Cases - Guide #9
55
**Depends On:** `setup-basic-search-params.md`, `navigate-with-search-params.md`, `validate-search-params.md`
6-
**Status:** Ready for implementation - comprehensive UI patterns available
6+
**Status:** Ready for implementation - comprehensive UI patterns available
77

88
---
99

@@ -18,47 +18,41 @@ import { Link, useSearch } from '@tanstack/react-router'
1818

1919
function SearchResults() {
2020
const search = useSearch({ from: '/search' })
21-
21+
2222
return (
2323
<div>
2424
{/* Preserve search query, change view */}
2525
<nav>
26-
<Link search={(prev) => ({ ...prev, view: 'grid' })}>
27-
Grid View
28-
</Link>
29-
<Link search={(prev) => ({ ...prev, view: 'list' })}>
30-
List View
31-
</Link>
26+
<Link search={(prev) => ({ ...prev, view: 'grid' })}>Grid View</Link>
27+
<Link search={(prev) => ({ ...prev, view: 'list' })}>List View</Link>
3228
</nav>
33-
29+
3430
{/* Pagination with query preservation */}
3531
<div>
3632
{search.page > 1 && (
3733
<Link search={(prev) => ({ ...prev, page: prev.page - 1 })}>
3834
Previous
3935
</Link>
4036
)}
41-
37+
4238
<Link search={(prev) => ({ ...prev, page: (prev.page || 1) + 1 })}>
4339
Next
4440
</Link>
4541
</div>
46-
42+
4743
{/* Related searches */}
4844
<div>
4945
Related searches:
50-
{[
51-
'laptops gaming',
52-
'laptops business',
53-
'laptops student'
54-
].map(suggestion => (
55-
<Link
56-
key={suggestion}
57-
search={(prev) => ({ ...prev, query: suggestion, page: 1 })}
58-
>
59-
{suggestion}
60-
</Link>
61-
))}
46+
{['laptops gaming', 'laptops business', 'laptops student'].map(
47+
(suggestion) => (
48+
<Link
49+
key={suggestion}
50+
search={(prev) => ({ ...prev, query: suggestion, page: 1 })}
51+
>
52+
{suggestion}
53+
</Link>
54+
),
55+
)}
6256
</div>
6357
</div>
6458
)
@@ -77,36 +71,36 @@ const sortOptions = [
7771
{ value: 'relevance', label: 'Relevance' },
7872
{ value: 'price-asc', label: 'Price: Low to High' },
7973
{ value: 'price-desc', label: 'Price: High to Low' },
80-
{ value: 'rating', label: 'Customer Rating' }
74+
{ value: 'rating', label: 'Customer Rating' },
8175
]
8276

8377
function FilterNavigation() {
8478
const search = useSearch({ from: '/products' })
85-
79+
8680
return (
8781
<aside>
8882
{/* Category filters */}
8983
<div>
9084
<h3>Categories</h3>
91-
{categories.map(category => (
85+
{categories.map((category) => (
9286
<Link
9387
key={category}
9488
search={(prev) => ({
9589
...prev,
9690
category: prev.category === category ? undefined : category,
97-
page: 1
91+
page: 1,
9892
})}
9993
className={search.category === category ? 'active' : ''}
10094
>
10195
{category}
10296
</Link>
10397
))}
10498
</div>
105-
99+
106100
{/* Sort options */}
107101
<div>
108102
<h3>Sort By</h3>
109-
{sortOptions.map(option => (
103+
{sortOptions.map((option) => (
110104
<Link
111105
key={option.value}
112106
search={(prev) => ({ ...prev, sort: option.value, page: 1 })}
@@ -116,7 +110,7 @@ function FilterNavigation() {
116110
</Link>
117111
))}
118112
</div>
119-
113+
120114
{/* Clear all filters */}
121115
<Link
122116
search={(prev) => {
@@ -140,33 +134,31 @@ import { useNavigate } from '@tanstack/react-router'
140134

141135
function SearchControls() {
142136
const navigate = useNavigate()
143-
137+
144138
const handleSortChange = (sortBy: string) => {
145139
navigate({
146-
search: (prev) => ({ ...prev, sort: sortBy, page: 1 })
140+
search: (prev) => ({ ...prev, sort: sortBy, page: 1 }),
147141
})
148142
}
149-
143+
150144
const handleClearFilters = () => {
151145
navigate({
152146
search: (prev) => {
153147
const { category, minPrice, maxPrice, ...rest } = prev
154148
return rest
155-
}
149+
},
156150
})
157151
}
158-
152+
159153
return (
160154
<div>
161155
<select onChange={(e) => handleSortChange(e.target.value)}>
162156
<option value="relevance">Sort by Relevance</option>
163157
<option value="price-asc">Price: Low to High</option>
164158
<option value="price-desc">Price: High to Low</option>
165159
</select>
166-
167-
<button onClick={handleClearFilters}>
168-
Clear Filters
169-
</button>
160+
161+
<button onClick={handleClearFilters}>Clear Filters</button>
170162
</div>
171163
)
172164
}
@@ -177,6 +169,7 @@ function SearchControls() {
177169
## Implementation Notes
178170

179171
### Additional Content Needed:
172+
180173
- [ ] Complete e-commerce filtering example
181174
- [ ] Advanced filter combinations (price ranges, multi-select)
182175
- [ ] Filter state persistence and sharing
@@ -187,11 +180,13 @@ function SearchControls() {
187180
- [ ] Mobile-responsive filter patterns
188181

189182
### Cross-References to Add:
183+
190184
- Link to `setup-basic-search-params.md` for foundation
191185
- Link to `navigate-with-search-params.md` for navigation patterns
192186
- Link to `validate-search-params.md` for filter validation
193187
- Forward link to `search-params-with-data-loading.md` for data integration
194188

195189
### README Update Required:
190+
196191
- [ ] Mark guide as completed in progressive series
197-
- [ ] Uncomment "Common Next Steps" in related guides
192+
- [ ] Uncomment "Common Next Steps" in related guides

docs/router/framework/react/how-to/drafts/optimize-search-param-performance.draft.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
**Final Destination:** `docs/router/framework/react/how-to/optimize-search-param-performance.md`
44
**Progressive Series Position:** Advanced Level (Power User Patterns) - Guide #7
55
**Depends On:** `setup-basic-search-params.md`, `navigate-with-search-params.md`
6-
**Status:** Ready for implementation - performance patterns available
6+
**Status:** Ready for implementation - performance patterns available
77

88
---
99

@@ -39,25 +39,25 @@ const updateSearch = useCallback((prev) => {
3939
```tsx
4040
function ProblematicComponent() {
4141
const navigate = useNavigate()
42-
42+
4343
// ❌ Wrong - navigate during render
4444
if (someCondition) {
4545
navigate({ search: { redirect: true } })
4646
}
47-
47+
4848
return <div>Content</div>
4949
}
5050

5151
function FixedComponent() {
5252
const navigate = useNavigate()
53-
53+
5454
// ✅ Correct - navigate in effect
5555
useEffect(() => {
5656
if (someCondition) {
5757
navigate({ search: { redirect: true } })
5858
}
5959
}, [someCondition, navigate])
60-
60+
6161
return <div>Content</div>
6262
}
6363
```
@@ -67,6 +67,7 @@ function FixedComponent() {
6767
## Implementation Notes
6868

6969
### Additional Content Needed:
70+
7071
- [ ] Search parameter selectors to prevent unnecessary re-renders
7172
- [ ] Debouncing search input updates
7273
- [ ] Memoization strategies for expensive search computations
@@ -77,11 +78,13 @@ function FixedComponent() {
7778
- [ ] Bundle size optimization strategies
7879

7980
### Cross-References to Add:
81+
8082
- Link to `setup-basic-search-params.md` for foundation
8183
- Link to `navigate-with-search-params.md` for navigation patterns
8284
- Link to `search-params-in-forms.md` for debouncing forms
8385
- Forward link to `debug-search-param-issues.md` for debugging performance
8486

8587
### README Update Required:
88+
8689
- [ ] Mark guide as completed in progressive series
87-
- [ ] Uncomment "Common Next Steps" in related guides
90+
- [ ] Uncomment "Common Next Steps" in related guides

0 commit comments

Comments
 (0)