Commit 589baa1
authored
Add exact title match search, newsletter dark theme, and background job safe defaults (#456)
* Add exact title match search and newsletter fixes
Summary: Adds exact title match search used by newsletter links, restyle
newsletter emails to the site's dark theme, and make all background job
enabled flags default to false with only production explicitly enabling them.
Implementation:
• Add ExactTitleMatch to SearchRequest with cache key support
• Add exact ILIKE query path in ContentRepository
• Expose exact=true query param on content search API endpoint
• Propagate exact param through ITechHubApiClient and TechHubApiClient
• Add ExactMatch mode to ContentItemsGrid and SectionCollection page
• Restyle newsletter email templates (daily + weekly) to dark purple theme
• Default ContentProcessorOptions.Enabled, RoundupGeneratorOptions.Enabled,
and NewsletterOptions.ScheduledSendEnabled to false (C# bool default)
• Enable all three background jobs explicitly in appsettings.Production.json
• Update bicep backgroundJobEnvVars comment for new config layout
• Delete obsolete appsettings.Staging.json from both Api and Web projects
• Update Web component tests for new ContentItemsGrid/Section signatures
* Clarify daily email behavior on subscribe page
* Address PR review comments: fix exact-match bugs, staging config, and add tests
- Fix ILIKE substring match: use bare query (no %wildcards%) in exact mode
- Fix exact=false treated as exact: use string.Equals(..., 'true') instead of IsNullOrWhiteSpace
- Fix tags not cleared in exact mode: pass Array.Empty<string>() when exactMode
- Add exactMode guard: exact=true without query behaves as normal request
- Replace bicep enableBackgroundJobs env var with appsettings.Staging.json for PR preview environments
- Add 5 integration tests for exact title matching behaviour
- Fix pre-existing test bug: TriggerImmediateRun_WhenEnabled_ExecutesManualRun missing Enabled=true
* Add exact phrase match checkbox to sidebar; fix exact mode to use phrase containment
- SidebarSearch: add 'Exact title match' checkbox below search input (visible only when query is non-empty)
- SidebarSearch: new ExactMatch parameter and OnExactMatchChanged callback
- SidebarSearch.css: checkbox label styled with design tokens
- SectionCollection: wire checkbox to isExactMatch state and HandleExactMatchChanged
- ContentRepository: fix exact mode ILIKE to use %query% (phrase containment) instead of bare equality
- 'vscode update' now matches titles containing 'vscode update', not just titles equal to it
- newsletter links (exact=true + full title) continue to work correctly
- ContentEndpointsTests: update tests to match phrase-containment semantics; rename DoesNotMatchSubstrings to MatchesByPhrase
- SidebarSearchTests: add 4 bUnit tests for checkbox visibility, checked state, and change event
- docs/filtering.md: document exact phrase match mode, URL parameter, and checkbox interaction
* Fix ContentItemsGrid double-load when exact=true on first render
Initialize previousExactMatch from ExactMatch in OnInitializedAsync alongside all other previous* fields. Without this, navigating to a URL with ?exact=true caused OnParametersSetAsync to immediately detect a mismatch (false vs true) and fire a redundant LoadInitialBatch.1 parent 9dd3eaa commit 589baa1
31 files changed
Lines changed: 505 additions & 157 deletions
File tree
- docs
- infra
- modules
- src
- TechHub.Api
- Endpoints
- TechHub.Core
- Configuration
- Models/Search
- TechHub.Infrastructure
- Data/Resources
- Repositories
- Services/Newsletter
- TechHub.Web
- Components
- Pages
- Services
- tests
- TechHub.Api.Tests
- Endpoints
- Services
- TechHub.Web.Tests/Components
- Pages
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| 66 | + | |
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
| |||
71 | 73 | | |
72 | 74 | | |
73 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
74 | 102 | | |
75 | 103 | | |
76 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | 53 | | |
57 | 54 | | |
58 | 55 | | |
| |||
73 | 70 | | |
74 | 71 | | |
75 | 72 | | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | 73 | | |
87 | 74 | | |
88 | 75 | | |
| |||
253 | 240 | | |
254 | 241 | | |
255 | 242 | | |
256 | | - | |
| 243 | + | |
257 | 244 | | |
258 | 245 | | |
259 | 246 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | 93 | | |
95 | 94 | | |
96 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
| 267 | + | |
267 | 268 | | |
268 | 269 | | |
269 | 270 | | |
| |||
360 | 361 | | |
361 | 362 | | |
362 | 363 | | |
363 | | - | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
364 | 368 | | |
365 | | - | |
| 369 | + | |
366 | 370 | | |
367 | 371 | | |
368 | 372 | | |
| |||
384 | 388 | | |
385 | 389 | | |
386 | 390 | | |
387 | | - | |
| 391 | + | |
| 392 | + | |
388 | 393 | | |
389 | 394 | | |
390 | 395 | | |
391 | 396 | | |
392 | 397 | | |
393 | 398 | | |
394 | | - | |
395 | | - | |
396 | | - | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
397 | 403 | | |
398 | 404 | | |
399 | 405 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
15 | 24 | | |
16 | 25 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
| 5 | + | |
| 6 | + | |
8 | 7 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
| 8 | + | |
| 9 | + | |
13 | 10 | | |
14 | 11 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
421 | 421 | | |
422 | 422 | | |
423 | 423 | | |
424 | | - | |
425 | 424 | | |
426 | 425 | | |
427 | 426 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
| 12 | + | |
| 13 | + | |
15 | 14 | | |
16 | 15 | | |
17 | | - | |
| 16 | + | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
7 | 11 | | |
8 | 12 | | |
9 | 13 | | |
| |||
0 commit comments