diff --git a/README.md b/README.md
index 78fc662..ff29aad 100644
--- a/README.md
+++ b/README.md
@@ -112,9 +112,9 @@ src/
- [x] Create task — the + buttons open a Figma-matched modal (full-screen page on mobile, floating panel on desktop) with custom estimate/assignee/tag menus and per-breakpoint date pickers; createTask + cache invalidation + error handling
- [x] Update task — Edit via the card/list options menu, reusing the shared TaskForm with all six required editable fields (name, due date, position, status, tags, estimate) plus assignee; success/failure notifications
- [x] Delete task — 'Delete Task?' confirmation via the options menu, deleteTask by id, success/failure notifications
-- [x] View toggle & My Task — grid/list layouts on both views (list = the mockup's grouped table with due-date row indicators); My Task filters to tasks assigned to the logged-in user via the profile query
+- [x] View toggle & My Task — grid/list layouts on both views (list = the mockup's grouped table with due-date row indicators), switched by the toolbar icons on desktop and by the Dashboard/Task tabs on mobile; My Task filters to tasks assigned to the logged-in user via the profile query
- [x] Search & filter — the header search and five filter chips (status, estimate, tags, due date, owner) live in URL search params, combine freely, and show a dedicated empty-results state when nothing matches
-- [ ] User settings page
+- [x] User settings page — reached from a Settings sidebar item — rendered with the same NavLink anatomy as Dashboard and My Task; the design system documents its SidebarItem as an abstract component, which is what sanctions adding a third item — and by clicking the header avatar; /settings renders the profile query (full name, email, type chip, created/updated dates) in an invented card design built from the app's own tokens; the requirement's Position field does not exist on the API's User type (verified by introspection), so the row states that instead of fabricating a value
### Bonus points attempted
@@ -124,6 +124,7 @@ src/
- **Generated GraphQL code is committed on purpose.** `src/graphql/generated/` (output of `npm run codegen`) is checked into git so CI can typecheck and build without holding the API token. Regenerate after changing any query/mutation; never edit by hand.
- **Quality gates are CI-enforced, not hook-enforced.** There are deliberately no git hooks (husky/lint-staged): CI runs format check, lint, typecheck, tests, and build on every PR, and the same scripts run locally on demand. Hooks can be added later if commit-time enforcement proves necessary.
+- **The settings Position row says "Not provided by the API."** The requirement lists Position among the user fields, but the User type has no such field (introspection: fullName, email, type, avatar, createdAt, updatedAt). The row is rendered so the requirement's shape is visible, with an honest value instead of an invented one.
- **Filter state lives in the URL.** Search and filters are `?q=…&status=…` search params, not component state: filtered views are shareable/bookmarkable, survive reloads, and search-params changes don't remount the page (the error boundary keys on pathname only). Three observed API behaviors are documented rather than papered over: name matching is a **case-sensitive** substring (verified: `icket` matches `Ticket5`, `ticket` does not); `dueDate` filters by **exact timestamp** equality (this app writes all due dates at noon UTC, so day-level filtering works for tasks it created); and `ownerId` is accepted but **ignored by the server** (a nonexistent id returns the full task list) — the param is still sent as required, and the owner filter additionally applies client-side against the task's `creator.id` so the control does what it says.
- **Tag labels derive from the API enum.** The mockups show sample tag texts that contradict each other across surfaces (the same tag renders "IOS APP" on cards but "IOS" in the tag menu, "ANDROID" on cards but "Android App" in the menu). Since the API's TaskTag enum is the real domain, labels derive from the enum values (IOS, ANDROID, REACT, NODE JS, RAILS) and are identical everywhere.
- **List group-header hover icons are omitted.** One mockup group header shows +/… icons; they have no behavior behind them (non-working UI, same principle as the bell).
diff --git a/src/app/router.test.tsx b/src/app/router.test.tsx
index c5fb316..d4a999a 100644
--- a/src/app/router.test.tsx
+++ b/src/app/router.test.tsx
@@ -11,7 +11,8 @@ import {
makeFixtureUsers,
tasksRequestMock,
} from '@/test/fixtures'
-import { ProfileDocument, UsersDocument } from '@/features/tasks/queries'
+import { UsersDocument } from '@/features/tasks/queries'
+import { ProfileDocument } from '@/lib/profile'
vi.mock('@/lib/graphql-client', () => ({
graphqlClient: { request: vi.fn() },
@@ -73,20 +74,22 @@ describe('app routes', () => {
describe('sidebar navigation', () => {
it('marks only the active item with aria-current', () => {
renderAt('/')
- expect(screen.getByRole('link', { name: /dashboard/i })).toHaveAttribute('aria-current', 'page')
- expect(screen.getByRole('link', { name: /my task/i })).not.toHaveAttribute('aria-current')
+ const nav = within(screen.getByRole('navigation', { name: /main/i }))
+ expect(nav.getByRole('link', { name: /dashboard/i })).toHaveAttribute('aria-current', 'page')
+ expect(nav.getByRole('link', { name: /my task/i })).not.toHaveAttribute('aria-current')
})
it('moves aria-current when the route changes', () => {
renderAt('/my-task')
- expect(screen.getByRole('link', { name: /my task/i })).toHaveAttribute('aria-current', 'page')
- expect(screen.getByRole('link', { name: /dashboard/i })).not.toHaveAttribute('aria-current')
+ const nav = within(screen.getByRole('navigation', { name: /main/i }))
+ expect(nav.getByRole('link', { name: /my task/i })).toHaveAttribute('aria-current', 'page')
+ expect(nav.getByRole('link', { name: /dashboard/i })).not.toHaveAttribute('aria-current')
})
it('marks nothing active on unknown deep paths (renders not-found)', () => {
renderAt('/my-task/anything')
expect(screen.getByRole('heading', { level: 1, name: /not found/i })).toBeInTheDocument()
- const nav = within(screen.getByRole('navigation'))
+ const nav = within(screen.getByRole('navigation', { name: /main/i }))
expect(nav.getByRole('link', { name: /my task/i })).not.toHaveAttribute('aria-current')
expect(nav.getByRole('link', { name: /dashboard/i })).not.toHaveAttribute('aria-current')
})
@@ -125,13 +128,18 @@ describe('dashboard main content', () => {
expect(screen.getAllByRole('button', { name: /add task/i }).length).toBeGreaterThan(0)
})
- it('marks the correct mobile tab active per route', () => {
- renderAt('/my-task')
- const taskTab = screen.getByText('Task')
- const tabs = taskTab.parentElement?.parentElement
- if (!tabs) throw new Error('expected the mobile tabs container to exist')
- expect(taskTab).toHaveClass('text-primary-4')
- expect(within(tabs).getByText('Dashboard')).toHaveClass('text-neutral-2')
+ it('mobile tabs switch the layout and survive navigation', async () => {
+ const user = userEvent.setup()
+ renderAt('/')
+ expect(screen.getByRole('button', { name: 'Dashboard' })).toHaveAttribute(
+ 'aria-pressed',
+ 'true',
+ )
+ await user.click(screen.getByRole('button', { name: 'Task' }))
+ expect(screen.getByRole('button', { name: 'Task' })).toHaveAttribute('aria-pressed', 'true')
+ const nav = within(screen.getByRole('navigation', { name: /main/i }))
+ await user.click(nav.getByRole('link', { name: /my task/i }))
+ expect(screen.getByRole('button', { name: 'Task' })).toHaveAttribute('aria-pressed', 'true')
})
})
@@ -197,7 +205,7 @@ describe('mobile navigation drawer', () => {
const user = userEvent.setup()
renderAt('/')
await user.click(screen.getByRole('button', { name: /open navigation/i }))
- const nav = within(screen.getByRole('navigation'))
+ const nav = within(screen.getByRole('navigation', { name: /main/i }))
await user.click(nav.getByRole('link', { name: /my task/i }))
expect(screen.getByRole('heading', { level: 1, name: /my task/i })).toBeInTheDocument()
expect(screen.getByRole('button', { name: /open navigation/i })).toHaveAttribute(
diff --git a/src/components/layout/Header.tsx b/src/components/layout/Header.tsx
index 5261f1f..94347c6 100644
--- a/src/components/layout/Header.tsx
+++ b/src/components/layout/Header.tsx
@@ -1,5 +1,5 @@
import { useEffect, useRef, useState } from 'react'
-import { useSearchParams } from 'react-router'
+import { Link, useSearchParams } from 'react-router'
import avatarUrl from '@/assets/avatar.png'
import { SearchIcon } from '@/components/ui/icons'
import { NotificationsBell } from '@/components/layout/NotificationsBell'
@@ -70,7 +70,9 @@ export function Header({ sidebarOpen, onOpenSidebar }: HeaderProps) {
-
+
+
+
)
diff --git a/src/components/layout/Layout.tsx b/src/components/layout/Layout.tsx
index 54fbffa..cc72d44 100644
--- a/src/components/layout/Layout.tsx
+++ b/src/components/layout/Layout.tsx
@@ -3,10 +3,12 @@ import { Outlet, useLocation } from 'react-router'
import { ErrorBoundary } from '@/components/ui/ErrorBoundary'
import { Sidebar } from '@/components/layout/Sidebar'
import { Header } from '@/components/layout/Header'
+import type { BoardLayout, ViewLayoutContext } from '@/components/layout/view-layout'
export function Layout() {
const location = useLocation()
const [sidebarOpen, setSidebarOpen] = useState(false)
+ const [layout, setLayout] = useState('grid')
useEffect(() => {
if (!sidebarOpen) return
@@ -38,7 +40,7 @@ export function Layout() {
/>
-
+
diff --git a/src/components/layout/Sidebar.tsx b/src/components/layout/Sidebar.tsx
index 871e5cb..3ff99b3 100644
--- a/src/components/layout/Sidebar.tsx
+++ b/src/components/layout/Sidebar.tsx
@@ -1,10 +1,11 @@
import { NavLink } from 'react-router'
import logoUrl from '@/assets/logos/ravn-logomark-white.svg'
-import { GridIcon, ListIcon } from '@/components/ui/icons'
+import { GridIcon, ListIcon, UserIcon } from '@/components/ui/icons'
const navItems = [
{ to: '/', label: 'Dashboard', Icon: GridIcon },
{ to: '/my-task', label: 'My Task', Icon: ListIcon },
+ { to: '/settings', label: 'Settings', Icon: UserIcon },
]
interface SidebarProps {
diff --git a/src/components/layout/view-layout.ts b/src/components/layout/view-layout.ts
new file mode 100644
index 0000000..544bc7a
--- /dev/null
+++ b/src/components/layout/view-layout.ts
@@ -0,0 +1,16 @@
+import { useOutletContext } from 'react-router'
+
+export type BoardLayout = 'grid' | 'list'
+
+export interface ViewLayoutContext {
+ layout: BoardLayout
+ setLayout: (layout: BoardLayout) => void
+}
+
+export function useViewLayout(): ViewLayoutContext {
+ const context = useOutletContext()
+ if (context === null) {
+ throw new Error('useViewLayout requires a route rendered inside Layout — check the router')
+ }
+ return context
+}
diff --git a/src/features/tasks/QueryErrorAlert.tsx b/src/components/ui/QueryErrorAlert.tsx
similarity index 100%
rename from src/features/tasks/QueryErrorAlert.tsx
rename to src/components/ui/QueryErrorAlert.tsx
diff --git a/src/components/ui/icons.tsx b/src/components/ui/icons.tsx
index dba5173..abe4e3f 100644
--- a/src/components/ui/icons.tsx
+++ b/src/components/ui/icons.tsx
@@ -44,3 +44,15 @@ export function BellIcon(props: IconProps) {
)
}
+
+export function UserIcon(props: IconProps) {
+ return (
+
+ )
+}
diff --git a/src/features/settings/Settings.tsx b/src/features/settings/Settings.tsx
index 0d9463c..d0def38 100644
--- a/src/features/settings/Settings.tsx
+++ b/src/features/settings/Settings.tsx
@@ -1,3 +1,98 @@
+import avatarUrl from '@/assets/avatar.png'
+import { avatarSrc } from '@/lib/avatar'
+import { useProfile } from '@/lib/profile'
+import { QueryErrorAlert } from '@/components/ui/QueryErrorAlert'
+import type { ProfileQuery } from '@/graphql/generated/graphql'
+
+const formatDate = (iso: string) =>
+ new Date(iso).toLocaleDateString('en-US', { month: 'long', day: 'numeric', year: 'numeric' })
+
+const titleCase = (value: string) =>
+ value.toLowerCase().replace(/\b\w/g, (letter) => letter.toUpperCase())
+
+function ProfileSkeleton() {
+ return (
+ <>
+