Sidebar (web/components/sidebar.tsx) reorganized to the requested structure:
Quick find at the top; a Pages group (All Pages tree with the existing
rename/reorder/pin/subpage/delete interactions, Pinned Pages, Untagged
Pages); a Bookmarks group (All Bookmarks, Calendar, and expandable carets
for Tags / Kanban / Collections / Contacts listing their entities with
deep-links /tags?tag=, /kanban?column=, /collections?id=, /contacts?open=);
Trash at the bottom. Collapsed desktop rail is a flat icon list; the mobile
drawer shows the full grouped nav.
Page tagging (new): PageTag join (migration 023 + schema.sql, db-converge
proven), POST/DELETE /api/pages/{id}/tags with owner-or-TagShare validation
(same rule as bookmark tags), tags exposed in the page list/detail
projections so the sidebar can compute the untagged subset. Tagging is
metadata (no content-version bump) and cascades on page/tag delete.
Dragging a page from Untagged Pages onto a tag assigns it (custom drag MIME
keeps it distinct from page reorder).
Kanban: only explicitly-placed cards render (no auto-populate of unassigned
bookmarks); the sidebar caret lists the existing columns and ?column=
scrolls/rings the target. e2e updated to assert no-auto-populate then place
the card explicitly.
All Bookmarks: a Group by selector (None/Calendar/Tags/Kanban/Collections/
Contacts) rendering grouped sections via shared row/card renderers; the
default None path is byte-identical to before (205-row table, same keys).
Collections grouping fetches membership once, sequence-guarded.
Calendar: Day/Week/Month/Year/List views (Month default), adaptive
prev/next + Today, date-sorted list; SSR-safe (date-fns only, post-mount
today), internal overflow containers so no page-level horizontal scroll.
Deep-link page wrappers for kanban/collections/contacts pass searchParams
into the clients' initial selection.
Test gate: the -race internal/http suite now exceeds the default 10m go
test timeout (~14m cold-cache), so the tests service and Makefile test
target use -timeout 30m; the suite passes in full.
Verified: regressions 20/20, real-stack e2e all pass, lint/SSR-lint/build
0 errors, db-converge green, full Go integration suite green; browser
checks of the grouped sidebar, drag-to-tag, bookmark group-by and every
calendar view show correct rendering with no horizontal overflow.
67 lines
2.8 KiB
Makefile
67 lines
2.8 KiB
Makefile
.PHONY: run docker stop docker-down db-up db-shell build vet test integration db-converge check audit e2e logs migrate seed deploy
|
|
run docker:
|
|
docker compose up -d --build
|
|
stop docker-down:
|
|
docker compose down
|
|
db-up:
|
|
docker compose up -d db
|
|
db-shell:
|
|
docker compose exec db psql -U superbrain -d superbrain
|
|
build:
|
|
go build ./internal/... .
|
|
vet:
|
|
go vet ./internal/... .
|
|
test:
|
|
@if [ -z "$$TEST_DATABASE_URL" ]; then \
|
|
echo "warning: TEST_DATABASE_URL is unset - PostgreSQL integration tests will SKIP."; \
|
|
echo " run 'make integration' for full coverage."; \
|
|
fi
|
|
go test -race -timeout 30m ./internal/...
|
|
integration:
|
|
docker compose run --rm tests
|
|
# schema.sql <-> migration-chain convergence + runner atomicity proofs
|
|
# (review MIG-03): fails when the two paths to the same schema drift apart
|
|
# or when apply/record atomicity regresses. Scratch databases only.
|
|
db-converge:
|
|
docker compose run --rm converge
|
|
docker compose run --rm converge sh /db/migrate-atomicity.sh
|
|
# Web toolchain command; override when yarn comes through corepack:
|
|
# make check YARN="corepack yarn"
|
|
YARN ?= yarn
|
|
# Release validation (review TEST-02): the database-backed suite is
|
|
# mandatory here — unlike `make test`, this target fails when Docker (and
|
|
# therefore the PostgreSQL integration coverage) is unavailable instead of
|
|
# quietly accepting skipped tests.
|
|
check:
|
|
@docker compose ps >/dev/null 2>&1 || { echo "error: release checks require docker; database-backed coverage is mandatory" >&2; exit 1; }
|
|
$(MAKE) build
|
|
$(MAKE) vet
|
|
$(MAKE) integration
|
|
$(MAKE) db-converge
|
|
cd web && $(YARN) lint && $(YARN) eslint -c eslint.ssr.config.mjs . && $(YARN) build
|
|
@[ -d scripts/node_modules ] || npm --prefix scripts ci
|
|
npm --prefix scripts run test:regressions
|
|
@echo "release check complete: vet + database integration + schema convergence + web lint/build + browser regressions"
|
|
@echo "note: 'make e2e' (real-stack browser smoke tests) is a separate step; run it against the composed stack before release."
|
|
# Dependency advisory scanning (review "Dependency assessment boundary"):
|
|
# opt-in because it needs network access and the Go vuln tool installed
|
|
# (go install golang.org/x/vuln/cmd/govulncheck@latest).
|
|
audit:
|
|
@command -v govulncheck >/dev/null 2>&1 || { echo "error: govulncheck not installed: go install golang.org/x/vuln/cmd/govulncheck@latest" >&2; exit 1; }
|
|
govulncheck ./internal/... .
|
|
cd web && $(YARN) audit
|
|
npm --prefix scripts audit
|
|
e2e:
|
|
@[ -d scripts/node_modules ] || npm --prefix scripts ci
|
|
npm --prefix scripts test
|
|
logs:
|
|
docker compose logs -f app web
|
|
migrate:
|
|
docker compose run --rm migrate
|
|
seed:
|
|
docker compose exec -e SEED_EMAIL -e SEED_PASSWORD -e SEED_NAME app /superbrain --seed
|
|
# Target-agnostic server deploy; requires HOST, DOMAIN and CERTBOT_EMAIL
|
|
# (no defaults). See README "Deploying to a server".
|
|
deploy:
|
|
./scripts/deploy.sh
|