Fix [object Object] bugs in note page + add favicon #13

Merged
forgejo_admin merged 2 commits from 12-fix-object-object-bugs-add-favicon into main 2026-03-14 13:43:01 +00:00

Summary

Fix three bugs: breadcrumb rendered note.project as [object Object] instead of the project name, tag badges rendered tag objects as [object Object] instead of tag names, and the app had no favicon.

Changes

  • src/lib/api.ts -- Added NoteProject and NoteTag interfaces; updated Note.project from string | null to NoteProject | null and Note.tags from string[] to NoteTag[] to match actual API response shape
  • src/lib/components/NoteLayout.svelte -- Fixed breadcrumb to use note.project.slug for URL and note.project.name for display; fixed tag badges to use tag.name for URLs and display
  • src/routes/notes/+page.svelte -- Fixed notes list to use note.project.name for display
  • static/favicon.png -- Added a simple 32x32 favicon with the app accent color

Test Plan

  • Visit a note that belongs to a project -- breadcrumb should show the project name (not [object Object])
  • Visit a note with tags -- tag badges should show tag names (not [object Object])
  • Clicking a project breadcrumb should navigate to /projects/{slug}
  • Clicking a tag badge should navigate to /tags/{name}
  • Notes list page should show project names under note cards
  • Favicon should appear in browser tab
  • npm run check passes with 0 errors
  • npm run build succeeds

Review Checklist

  • TypeScript types match actual API response shape
  • All template references use object properties, not raw objects
  • npm run check -- 0 errors, 0 warnings
  • npm run build -- success
  • No breaking changes to other pages (only Note interface changed)
  • Forgejo issue: #12

Closes #12

## Summary Fix three bugs: breadcrumb rendered `note.project` as `[object Object]` instead of the project name, tag badges rendered tag objects as `[object Object]` instead of tag names, and the app had no favicon. ## Changes - `src/lib/api.ts` -- Added `NoteProject` and `NoteTag` interfaces; updated `Note.project` from `string | null` to `NoteProject | null` and `Note.tags` from `string[]` to `NoteTag[]` to match actual API response shape - `src/lib/components/NoteLayout.svelte` -- Fixed breadcrumb to use `note.project.slug` for URL and `note.project.name` for display; fixed tag badges to use `tag.name` for URLs and display - `src/routes/notes/+page.svelte` -- Fixed notes list to use `note.project.name` for display - `static/favicon.png` -- Added a simple 32x32 favicon with the app accent color ## Test Plan - Visit a note that belongs to a project -- breadcrumb should show the project name (not `[object Object]`) - Visit a note with tags -- tag badges should show tag names (not `[object Object]`) - Clicking a project breadcrumb should navigate to `/projects/{slug}` - Clicking a tag badge should navigate to `/tags/{name}` - Notes list page should show project names under note cards - Favicon should appear in browser tab - `npm run check` passes with 0 errors - `npm run build` succeeds ## Review Checklist - [x] TypeScript types match actual API response shape - [x] All template references use object properties, not raw objects - [x] `npm run check` -- 0 errors, 0 warnings - [x] `npm run build` -- success - [x] No breaking changes to other pages (only `Note` interface changed) ## Related - Forgejo issue: #12 Closes #12
Fix [object Object] rendering for project and tag fields, add favicon
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed
15bb1487bf
The API returns project as {slug, name} and tags as [{name}] objects,
but the Note interface typed them as string/string[]. Updated the
TypeScript types to match reality and fixed all template references
to use .slug/.name properties. Added a simple favicon to static/.

Closes #12

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fix missed [object Object] bug in tags/[name] page
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed
8cfd7f8a53
Review caught one more instance of note.project being rendered as a raw
object instead of note.project.name in the tag detail page.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
forgejo_admin deleted branch 12-fix-object-object-bugs-add-favicon 2026-03-14 13:43:01 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forgejo_admin/pal-e-docs-app!13
No description provided.