Commit graph

156 commits

Author SHA1 Message Date
0b381c001f fix(flake): simplify preConfigure
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 7s
Mirror to GitHub / mirror (push) Failing after 3s
Tests / test (push) Successful in 21s
2026-03-22 13:28:32 +00:00
7969b724de fix(engines): remove unsupported lookahead from Google regex
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 6s
Mirror to GitHub / mirror (push) Failing after 3s
Tests / test (push) Successful in 41s
Go's regexp package doesn't support Perl lookahead (?=...). Removing
the unnecessary lookahead since each MjjYud div is self-contained.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 14:16:04 +01:00
cdfdb16c26 Merge branch 'worktree-brave-search-redesign' 2026-03-22 14:09:29 +01:00
0402d249b8 Merge branch 'main' of https://github.com/metamorphosis-dev/kafka 2026-03-22 14:09:29 +01:00
e18a54a41a fix(frontend): add HTMX filter submission for sidebar radio buttons
Wrap sidebar time/type filters in a form with HTMX attributes so
filter changes trigger partial page updates instead of full reload.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 14:05:26 +01:00
6d7e68ada1 feat(frontend): reduce popover to theme+engines, add preferences page JS 2026-03-22 14:00:53 +01:00
0afcf509c3 fix: use single Preferences handler with method check instead of dead POST route 2026-03-22 13:57:32 +01:00
70818558cd feat: add GET and POST /preferences route
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 13:53:23 +01:00
b4053b7f98 feat(frontend): add preferences page template and styles
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 13:47:30 +01:00
3dbde9fbfd feat(frontend): add category tiles to homepage 2026-03-22 13:42:24 +01:00
bfcbd45c57 fix(frontend): update FromResponse tests and fix disabled categories rendering
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 13:40:16 +01:00
0e79b729fe feat(frontend): add three-column results layout with left sidebar navigation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 13:36:09 +01:00
2e7075adf1 fix(frontend): merge duplicate sidebar sticky rules 2026-03-22 13:33:24 +01:00
0af49f91b7 feat(frontend): add CSS layout framework for three-column results and preferences page
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 13:29:39 +01:00
d071921329 docs: add missing template registration step to plan
- Add tmplPreferences variable to views.go var block
- Initialize tmplPreferences in init() function
- Add RenderPreferences function to views.go
- Fix step numbering for Task 4

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 13:26:22 +01:00
ce92a692f8 docs: fix Go syntax errors in implementation plan
- Move if statement outside struct literal in FromResponse
- Define FilterOption at package level (not inside function)
- Add DisabledCategories to PageData struct
- Add defaults handling before struct literal
- Update Search handler call with filter params

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 13:24:11 +01:00
7bc68db70c chore(deps): update go.sum after go mod tidy
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 13:23:37 +01:00
2fae98a336 fix(go): remove stray parenthesis from go.mod
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 13:23:10 +01:00
d21e9189b8 fix(engines): validate Wikipedia language codes to prevent SSRF
Wikipedia language subdomain was derived from user input without
validation, allowing attackers to redirect requests via malicious
language values like "evil.com.attacker.com". Added a whitelist of
valid Wikipedia language codes to prevent this.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 13:22:52 +01:00
8909654c8f docs: fix implementation plan issues from review
- Move template registration from Phase 2 to Phase 4 (was causing build failure)
- Add filter params (activeCategory, activeTime, activeType) to FromResponse
- Add DisabledCategories to PageData for backend-unsupported categories
- Add disabled class to sidebar for future categories
- Clarify POST handler is a no-op for localStorage-only preferences
- Note CSS must be tested manually in browser

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 13:21:31 +01:00
19f5c89053 fix: upgrade x/net to v0.38.0 (resolves Dependabot XSS alert)
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 6s
Mirror to GitHub / mirror (push) Failing after 3s
Tests / test (push) Failing after 14s
2026-03-22 12:18:43 +00:00
b005e2140e docs: add Brave Search frontend redesign implementation plan
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 13:17:46 +01:00
cb05ac5b8c docs: update Brave Search frontend redesign spec with clarifications
- Clarify localStorage-only preferences (no server persistence)
- Expand category tiles including future ones (weather, sports, crypto)
- Define filter UI options with query params (time range, result type)
- Add mobile breakpoints and collapse behavior
- Reduce quick popover to theme + engines only
- Rename Preferences Sidebar to Preferences Nav
- Add results count format specification
- Add sticky positioning CSS for left sidebar

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 13:12:06 +01:00
e9b5fa1f0b docs: update license to AGPLv3
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 6s
Mirror to GitHub / mirror (push) Failing after 3s
Tests / test (push) Successful in 21s
2026-03-22 12:11:39 +00:00
79c37a086b ci: update actions/checkout to v5 (uses Node 24)
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 6s
Mirror to GitHub / mirror (push) Failing after 3s
Tests / test (push) Successful in 21s
2026-03-22 12:05:21 +00:00
6bbde20f23 docs: add Brave Search frontend redesign specification
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 13:04:34 +01:00
f172da33ef fix(engines): cap Brave API offset to 9 to avoid 422 error
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 6s
Mirror to GitHub / mirror (push) Failing after 3s
Tests / test (push) Successful in 24s
Brave API only supports offset values 0-9. When pageno > 1 with
resultsPerPage=20, offset exceeded this limit causing 422 errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 12:01:25 +00:00
3bc1fad6b5 fix(flake): force remove vendor in preConfigure
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 7s
Mirror to GitHub / mirror (push) Failing after 3s
Tests / test (push) Successful in 21s
The nix store may have stale vendor directories with incorrect
permissions. Force chmod before removing to ensure clean build.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 12:01:18 +00:00
5e125646a7 fix(flake): set correct vendorHash
Some checks failed
Mirror to GitHub / mirror (push) Failing after 3s
Build and Push Docker Image / build-and-push (push) Failing after 6s
Tests / test (push) Successful in 40s
The auto-computed vendorHash for the go modules is:
sha256-PTD4eEEkLGBCZbot6W4U+sMOpIbH2tcFSztQel7hyXI=

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 11:48:08 +00:00
bf5f36e383 chore(deps): add go.sum from go mod tidy
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 6s
Mirror to GitHub / mirror (push) Failing after 3s
Tests / test (push) Has been cancelled
2026-03-22 11:47:32 +00:00
e821470c4d fix(go): run go mod tidy to sync dependencies
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 6s
Mirror to GitHub / mirror (push) Failing after 3s
Tests / test (push) Failing after 24s
This fixes the build by properly synchronizing go.mod and go.sum
using the official Go toolchain.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 11:45:04 +00:00
f1cf23745e test: add HTTP API integration tests
Some checks failed
Mirror to GitHub / mirror (push) Waiting to run
Tests / test (push) Waiting to run
Build and Push Docker Image / build-and-push (push) Has been cancelled
Test GET /healthz, /, /search, /autocompleter endpoints.
Verify response codes, content types, JSON decoding, empty-query
redirect, and source URL presence in footer.

Also fix dead code in Search handler: the redirect for empty q
was unreachable because ParseSearchRequest errors on empty q first.
Move the q/format check before ParseSearchRequest to fix the redirect.
2026-03-22 11:44:48 +00:00
f6128689f1 fix(go.sum): remove stale go.sum to allow rebuild from proxy
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 6s
Mirror to GitHub / mirror (push) Failing after 3s
Tests / test (push) Failing after 25s
The go.sum is out of sync with go.mod causing build failures.
Removing it allows Go to rebuild it from the module proxy.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 11:42:15 +00:00
8c6d056f52 fix(engines): cap Brave API offset to 9 to avoid 422 error
Brave API only supports offset values 0-9. When pageno > 1 with
resultsPerPage=20, offset exceeded this limit causing 422 errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 12:41:42 +01:00
2883ac95e7 fix(go.mod): remove unused golang.org/x/net indirect dep
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 6s
Mirror to GitHub / mirror (push) Failing after 3s
Tests / test (push) Failing after 14s
The golang.org/x/net v0.52.0 was listed as an indirect dependency but
nothing in the codebase imports it, causing go mod tidy to fail.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 11:41:15 +00:00
16266e143e fix(go.mod): add missing x/net v0.52.0 hash to go.sum
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 6s
Mirror to GitHub / mirror (push) Failing after 3s
Tests / test (push) Failing after 14s
The replace directive was removed but go.sum wasn't updated
with the correct hash for golang.org/x/net v0.52.0.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 11:39:41 +00:00
3943539e8a Merge remote-tracking branch 'origin/main' into fix/replace-directive
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 6s
Mirror to GitHub / mirror (push) Failing after 3s
Tests / test (push) Failing after 15s
2026-03-22 11:33:46 +00:00
7d0e2017cd fix(go.mod): remove stale replace directive
The replace directive for golang.org/x/net was causing build
failures when using vendorHash = "" with the Go module proxy.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 11:33:29 +00:00
25757fdb99 ci: add GitHub Actions workflow for pull requests
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 6s
Mirror to GitHub / mirror (push) Failing after 3s
Tests / test (push) Has been cancelled
Runs tests on PRs and pushes to main.
2026-03-22 11:33:22 +00:00
a85d8033c7 fix(flake): remove stale vendorHash; auto-compute on next build
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 6s
Mirror to GitHub / mirror (push) Failing after 3s
Tests / test (push) Successful in 21s
The go.mod changes (goquery downgrade, x/net replace) invalidate the
old vendorHash. Set to empty to auto-recompute, then replace with the
actual hash from the build error.
2026-03-22 11:28:31 +00:00
b2cca0a346 ci: remove stale vendor directory before build
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 6s
Mirror to GitHub / mirror (push) Failing after 3s
Tests / test (push) Successful in 22s
2026-03-22 11:24:43 +00:00
5b942a5fd6 refactor: clean up verbose and redundant comments
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 7s
Mirror to GitHub / mirror (push) Failing after 3s
Tests / test (push) Successful in 25s
Trim or remove comments that:
- State the obvious (function names already convey purpose)
- Repeat what the code clearly shows
- Are excessively long without adding value

Keep comments that explain *why*, not *what*.
2026-03-22 11:10:50 +00:00
805e7ffdc2 feat: add source_url config option for footer source link
Thread source_url through: config.ServerConfig → Handler.sourceURL
→ PageData.SourceURL → template footer. Footer only shows Source
link when source_url is set.
2026-03-22 08:34:20 +00:00
bb0b97820b ui: add source and AGPL license links to footer 2026-03-22 08:29:04 +00:00
7be03b4017 license: change from MIT to AGPLv3
Update LICENSE file and add AGPL header to all source files.

AGPLv3 ensures that if someone runs Kafka as a network service and
modifies it, they must release their source code under the same license.
2026-03-22 08:27:23 +00:00
f7cece9648 feat: complete UI redesign — modern, clean search interface
- New CSS: complete design system with CSS variables, modern color palette
- Homepage: full-viewport hero with centered search, logo, tagline
- Result cards: rounded, shadowed, with favicons via Google Favicon API
- Layout: sidebar + results grid, responsive
- Typography: proper font stack, variable weights
- Settings panel: polished popover with animations
- Autocomplete: modern dropdown with keyboard nav
- Dark mode: full color palette via data-theme attribute
- Favicon: clean search icon SVG
2026-03-22 08:06:31 +00:00
f1436310eb fix: regexp.DotAll flag in google engine and Metadata field removal
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 7s
Mirror to GitHub / mirror (push) Failing after 3s
Tests / test (push) Successful in 21s
- google.go: use inline (?s) flag instead of regexp.DotAll second arg
- youtube.go: remove Metadata field (not in MainResult contract)
- config_test.go: fix expected engine count from 9 to 11 (google+youtube)
2026-03-22 02:54:12 +00:00
b499db68f7 fix: use explicit if/else template dispatch instead of dynamic name
html/template requires template names to be string literals, not field
accesses. Use {{if eq .Template "videos"}} to branch and call the
appropriate template by literal name.
2026-03-22 02:46:28 +00:00
f0a65e2b8c fix: compute TemplateName in ResultView instead of using dynamic template function
Go html/template doesn't support function calls as template names in
{{template (func .Arg) .}}. Instead, precompute TemplateName in
FromResponse and use {{template .TemplateName .}} in the template.
2026-03-22 02:44:50 +00:00
7d3c82214b fix: move replace directive outside require block 2026-03-22 02:40:12 +00:00