feat: Removed yellow semantic-search-unavailable banner from search res…
- "frontend/src/pages/SearchResults.tsx" - "frontend/src/App.css" - "frontend/src/components/AppFooter.tsx" - "frontend/package.json" GSD-Task: S02/T02
This commit is contained in:
parent
127919565a
commit
deb060cfa3
7 changed files with 102 additions and 28 deletions
|
|
@ -30,7 +30,7 @@
|
||||||
- Estimate: 20m
|
- Estimate: 20m
|
||||||
- Files: backend/models.py, backend/routers/creators.py, alembic/versions/
|
- Files: backend/models.py, backend/routers/creators.py, alembic/versions/
|
||||||
- Verify: cd backend && python -c "from models import Creator; print('hidden' in [c.key for c in Creator.__table__.columns])" && alembic check 2>&1 | head -5
|
- Verify: cd backend && python -c "from models import Creator; print('hidden' in [c.key for c in Creator.__table__.columns])" && alembic check 2>&1 | head -5
|
||||||
- [ ] **T02: Remove fallback banner, clean up footer, and bump version** — Three independent frontend cleanups:
|
- [x] **T02: Removed yellow semantic-search-unavailable banner from search results, simplified footer to hide commit info in dev builds, and bumped version to 0.8.0** — Three independent frontend cleanups:
|
||||||
1. Remove the yellow 'semantic search unavailable' fallback banner from SearchResults
|
1. Remove the yellow 'semantic search unavailable' fallback banner from SearchResults
|
||||||
2. Clean up the footer to hide commit info when value is 'dev' (already partially done — verify and simplify)
|
2. Clean up the footer to hide commit info when value is 'dev' (already partially done — verify and simplify)
|
||||||
3. Bump package.json version to 0.8.0
|
3. Bump package.json version to 0.8.0
|
||||||
|
|
|
||||||
16
.gsd/milestones/M008/slices/S02/tasks/T01-VERIFY.json
Normal file
16
.gsd/milestones/M008/slices/S02/tasks/T01-VERIFY.json
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
{
|
||||||
|
"schemaVersion": 1,
|
||||||
|
"taskId": "T01",
|
||||||
|
"unitId": "M008/S02/T01",
|
||||||
|
"timestamp": 1774933997939,
|
||||||
|
"passed": true,
|
||||||
|
"discoverySource": "task-plan",
|
||||||
|
"checks": [
|
||||||
|
{
|
||||||
|
"command": "cd backend",
|
||||||
|
"exitCode": 0,
|
||||||
|
"durationMs": 7,
|
||||||
|
"verdict": "pass"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
83
.gsd/milestones/M008/slices/S02/tasks/T02-SUMMARY.md
Normal file
83
.gsd/milestones/M008/slices/S02/tasks/T02-SUMMARY.md
Normal file
|
|
@ -0,0 +1,83 @@
|
||||||
|
---
|
||||||
|
id: T02
|
||||||
|
parent: S02
|
||||||
|
milestone: M008
|
||||||
|
provides: []
|
||||||
|
requires: []
|
||||||
|
affects: []
|
||||||
|
key_files: ["frontend/src/pages/SearchResults.tsx", "frontend/src/App.css", "frontend/src/components/AppFooter.tsx", "frontend/package.json"]
|
||||||
|
key_decisions: ["Removed fallbackUsed state entirely since TS strict mode flags unused variables — keeping dead state would break builds"]
|
||||||
|
patterns_established: []
|
||||||
|
drill_down_paths: []
|
||||||
|
observability_surfaces: []
|
||||||
|
duration: ""
|
||||||
|
verification_result: "All grep checks pass (no banner references remain), version confirmed as 0.8.0, npm run build succeeds with zero errors. Slice-level Creator model check also passes."
|
||||||
|
completed_at: 2026-03-31T05:14:46.779Z
|
||||||
|
blocker_discovered: false
|
||||||
|
---
|
||||||
|
|
||||||
|
# T02: Removed yellow semantic-search-unavailable banner from search results, simplified footer to hide commit info in dev builds, and bumped version to 0.8.0
|
||||||
|
|
||||||
|
> Removed yellow semantic-search-unavailable banner from search results, simplified footer to hide commit info in dev builds, and bumped version to 0.8.0
|
||||||
|
|
||||||
|
## What Happened
|
||||||
|
---
|
||||||
|
id: T02
|
||||||
|
parent: S02
|
||||||
|
milestone: M008
|
||||||
|
key_files:
|
||||||
|
- frontend/src/pages/SearchResults.tsx
|
||||||
|
- frontend/src/App.css
|
||||||
|
- frontend/src/components/AppFooter.tsx
|
||||||
|
- frontend/package.json
|
||||||
|
key_decisions:
|
||||||
|
- Removed fallbackUsed state entirely since TS strict mode flags unused variables — keeping dead state would break builds
|
||||||
|
duration: ""
|
||||||
|
verification_result: passed
|
||||||
|
completed_at: 2026-03-31T05:14:46.780Z
|
||||||
|
blocker_discovered: false
|
||||||
|
---
|
||||||
|
|
||||||
|
# T02: Removed yellow semantic-search-unavailable banner from search results, simplified footer to hide commit info in dev builds, and bumped version to 0.8.0
|
||||||
|
|
||||||
|
**Removed yellow semantic-search-unavailable banner from search results, simplified footer to hide commit info in dev builds, and bumped version to 0.8.0**
|
||||||
|
|
||||||
|
## What Happened
|
||||||
|
|
||||||
|
Three independent frontend cleanups: (1) removed fallback banner JSX and CSS rule plus the now-unused fallbackUsed state variable, (2) simplified AppFooter to conditionally hide commit section when __GIT_COMMIT__ is 'dev' instead of showing plain 'dev' text, (3) bumped package.json version to 0.8.0. Build passes with zero errors.
|
||||||
|
|
||||||
|
## Verification
|
||||||
|
|
||||||
|
All grep checks pass (no banner references remain), version confirmed as 0.8.0, npm run build succeeds with zero errors. Slice-level Creator model check also passes.
|
||||||
|
|
||||||
|
## Verification Evidence
|
||||||
|
|
||||||
|
| # | Command | Exit Code | Verdict | Duration |
|
||||||
|
|---|---------|-----------|---------|----------|
|
||||||
|
| 1 | `grep -q 'search-fallback-banner' frontend/src/pages/SearchResults.tsx` | 1 | ✅ pass (not found) | 100ms |
|
||||||
|
| 2 | `grep -q 'search-fallback-banner' frontend/src/App.css` | 1 | ✅ pass (not found) | 100ms |
|
||||||
|
| 3 | `grep -q '"0.8.0"' frontend/package.json` | 0 | ✅ pass | 100ms |
|
||||||
|
| 4 | `cd frontend && npm run build` | 0 | ✅ pass | 2600ms |
|
||||||
|
|
||||||
|
|
||||||
|
## Deviations
|
||||||
|
|
||||||
|
Removed fallbackUsed state variable entirely — TS strict mode flagged it as unused after banner JSX removal, causing build failure. Plan said to keep it.
|
||||||
|
|
||||||
|
## Known Issues
|
||||||
|
|
||||||
|
None.
|
||||||
|
|
||||||
|
## Files Created/Modified
|
||||||
|
|
||||||
|
- `frontend/src/pages/SearchResults.tsx`
|
||||||
|
- `frontend/src/App.css`
|
||||||
|
- `frontend/src/components/AppFooter.tsx`
|
||||||
|
- `frontend/package.json`
|
||||||
|
|
||||||
|
|
||||||
|
## Deviations
|
||||||
|
Removed fallbackUsed state variable entirely — TS strict mode flagged it as unused after banner JSX removal, causing build failure. Plan said to keep it.
|
||||||
|
|
||||||
|
## Known Issues
|
||||||
|
None.
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "chrysopedia-web",
|
"name": "chrysopedia-web",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.1.0",
|
"version": "0.8.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|
|
||||||
|
|
@ -1116,16 +1116,6 @@ a.app-footer__repo:hover {
|
||||||
max-width: 64rem;
|
max-width: 64rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-fallback-banner {
|
|
||||||
padding: 0.5rem 0.75rem;
|
|
||||||
background: var(--color-banner-amber-bg);
|
|
||||||
border: 1px solid var(--color-banner-amber-border);
|
|
||||||
border-radius: 0.375rem;
|
|
||||||
font-size: 0.8125rem;
|
|
||||||
color: var(--color-banner-amber-text);
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.search-group {
|
.search-group {
|
||||||
margin-bottom: 1.5rem;
|
margin-bottom: 1.5rem;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ export default function AppFooter() {
|
||||||
<span className="app-footer__date">
|
<span className="app-footer__date">
|
||||||
Built {__BUILD_DATE__.slice(0, 10)}
|
Built {__BUILD_DATE__.slice(0, 10)}
|
||||||
</span>
|
</span>
|
||||||
{commitUrl ? (
|
{commitUrl && (
|
||||||
<>
|
<>
|
||||||
<span className="app-footer__sep">·</span>
|
<span className="app-footer__sep">·</span>
|
||||||
<a
|
<a
|
||||||
|
|
@ -27,11 +27,6 @@ export default function AppFooter() {
|
||||||
{__GIT_COMMIT__}
|
{__GIT_COMMIT__}
|
||||||
</a>
|
</a>
|
||||||
</>
|
</>
|
||||||
) : (
|
|
||||||
<>
|
|
||||||
<span className="app-footer__sep">·</span>
|
|
||||||
<span className="app-footer__commit">{__GIT_COMMIT__}</span>
|
|
||||||
</>
|
|
||||||
)}
|
)}
|
||||||
<span className="app-footer__sep">·</span>
|
<span className="app-footer__sep">·</span>
|
||||||
<a
|
<a
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ export default function SearchResults() {
|
||||||
const q = searchParams.get("q") ?? "";
|
const q = searchParams.get("q") ?? "";
|
||||||
|
|
||||||
const [results, setResults] = useState<SearchResultItem[]>([]);
|
const [results, setResults] = useState<SearchResultItem[]>([]);
|
||||||
const [fallbackUsed, setFallbackUsed] = useState(false);
|
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [error, setError] = useState<string | null>(null);
|
const [error, setError] = useState<string | null>(null);
|
||||||
const [localQuery, setLocalQuery] = useState(q);
|
const [localQuery, setLocalQuery] = useState(q);
|
||||||
|
|
@ -25,7 +24,6 @@ export default function SearchResults() {
|
||||||
const doSearch = useCallback(async (query: string) => {
|
const doSearch = useCallback(async (query: string) => {
|
||||||
if (!query.trim()) {
|
if (!query.trim()) {
|
||||||
setResults([]);
|
setResults([]);
|
||||||
setFallbackUsed(false);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -34,7 +32,6 @@ export default function SearchResults() {
|
||||||
try {
|
try {
|
||||||
const res = await searchApi(query.trim());
|
const res = await searchApi(query.trim());
|
||||||
setResults(res.items);
|
setResults(res.items);
|
||||||
setFallbackUsed(res.fallback_used);
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
setError(err instanceof Error ? err.message : "Search failed");
|
setError(err instanceof Error ? err.message : "Search failed");
|
||||||
setResults([]);
|
setResults([]);
|
||||||
|
|
@ -97,13 +94,6 @@ export default function SearchResults() {
|
||||||
{loading && <div className="loading">Searching…</div>}
|
{loading && <div className="loading">Searching…</div>}
|
||||||
{error && <div className="loading error-text">Error: {error}</div>}
|
{error && <div className="loading error-text">Error: {error}</div>}
|
||||||
|
|
||||||
{/* Fallback banner */}
|
|
||||||
{!loading && fallbackUsed && results.length > 0 && (
|
|
||||||
<div className="search-fallback-banner">
|
|
||||||
Showing keyword results — semantic search unavailable
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{/* No results */}
|
{/* No results */}
|
||||||
{!loading && !error && q && results.length === 0 && (
|
{!loading && !error && q && results.length === 0 && (
|
||||||
<div className="empty-state">
|
<div className="empty-state">
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue