···11+## Context
22+33+The creator dashboard currently renders forms in one card-based grid. That layout works well for visual browsing, but it is less efficient for creators with many forms who want denser scanning and quick comparison of status, response counts, and recency.
44+55+The requested change is purely within the creator dashboard surface. The dashboard already receives the full form list needed for the table columns, so the change can be implemented without new backend endpoints if sorting and view switching are handled in the dashboard UI layer.
66+77+## Goals / Non-Goals
88+99+**Goals:**
1010+- Support two dashboard list presentations: grid and table.
1111+- Make the existing card layout explicitly the grid view.
1212+- Allow creators to switch between grid and table views from the dashboard.
1313+- Allow sorting in table view by title, status, response count, and updated date.
1414+- Preserve existing core actions such as creating a form, opening the builder, and reviewing responses.
1515+1616+**Non-Goals:**
1717+- Persisting the selected view across devices or sessions.
1818+- Server-side sorting or pagination.
1919+- Bulk actions across forms.
2020+- Replacing the existing grid layout.
2121+2222+## Decisions
2323+2424+### Implement view switching in the dashboard UI
2525+The dashboard should offer a simple grid/table toggle in the existing management header area.
2626+2727+**Why this approach:**
2828+- Keeps the interaction local to the dashboard where it is used.
2929+- Avoids introducing unnecessary routing complexity for a presentational preference.
3030+- Makes it easy to preserve the existing grid view as the default.
3131+3232+**Alternatives considered:**
3333+- Separate routes for grid and table views: adds URL complexity for a lightweight display preference.
3434+- Replace grid with table entirely: does not satisfy the request to keep both views.
3535+3636+### Use client-side sorting for table mode
3737+Sorting should be handled in the dashboard presentation layer using the already loaded form list.
3838+3939+**Why this approach:**
4040+- Existing dashboard data already includes the needed fields.
4141+- Sorting is a view concern rather than a data-ownership concern.
4242+- Avoids new API parameters or server coordination for the initial feature.
4343+4444+**Alternatives considered:**
4545+- Server-side sorting via query params: more scalable for very large datasets, but unnecessary for the current scope.
4646+4747+### Keep grid as the initial/default view
4848+The current dashboard experience should remain the starting point and simply be named grid.
4949+5050+**Why this approach:**
5151+- Preserves familiarity for existing users.
5252+- Minimizes product surprise while still enabling the denser table workflow.
5353+5454+**Alternatives considered:**
5555+- Default to table for everyone: improves density but changes the current experience abruptly.
5656+5757+### Reuse existing form actions in both views
5858+The table view should still let creators move directly into common workflows, especially opening the builder and viewing responses.
5959+6060+**Why this approach:**
6161+- Prevents the table from becoming a read-only report.
6262+- Maintains parity between views so changing the layout does not hide essential actions.
6363+6464+**Alternatives considered:**
6565+- Make the table informational only: reduces usefulness and forces creators back to grid for actions.
6666+6767+## Risks / Trade-offs
6868+6969+- **Client-side sorting may be less scalable for very large form lists** → Mitigation: acceptable for current scope; revisit with server-side sorting if dataset size grows.
7070+- **Adding toggle and sorting controls can clutter the dashboard header** → Mitigation: keep controls compact and aligned with the current management-focused design.
7171+- **Two views can drift visually or functionally over time** → Mitigation: ensure both use the same underlying form data and expose the same critical actions.
7272+7373+## Migration Plan
7474+7575+1. Introduce dashboard view and sorting state in the dashboard UI.
7676+2. Extract or add grid and table presentations over the same form list data.
7777+3. Add sortable table headers for title, status, response count, and updated date.
7878+4. Verify creators can switch views and still reach builder/response actions.
7979+5. Confirm the default dashboard experience remains the current grid layout.
8080+8181+## Open Questions
8282+8383+- Should the selected view be remembered in local storage or left as a per-page-session preference for now?
8484+- Should clicking a table row open the builder, or should actions remain button/link-based only?
8585+- Should status sorting use raw enum order or a product-specific order such as published before draft?
···11+## Why
22+33+The dashboard currently presents forms in a single card grid view. That works for browsing a small set of forms, but it becomes less efficient when creators want to scan many forms quickly, compare status and response counts, or sort by updated date.
44+55+## What Changes
66+77+- Rename the existing dashboard layout to the "grid" view.
88+- Add a second dashboard layout called "table".
99+- Allow creators to switch between grid and table views from the dashboard.
1010+- Show table columns for form title, status, response count, and updated date.
1111+- Allow sorting in the table view by the available columns.
1212+- Preserve the existing management actions for opening the builder and reviewing responses.
1313+1414+## Capabilities
1515+1616+### New Capabilities
1717+- `dashboard-form-views`: creator dashboard supports switchable grid and table views for forms, with sortable columns in table mode.
1818+1919+### Modified Capabilities
2020+- None.
2121+2222+## Impact
2323+2424+- Affected specs: `dashboard-form-views`
2525+- Affected code: creator dashboard page, form list presentation components, dashboard sorting/view state handling
2626+- Affected APIs: none required if sorting is implemented from existing server data in the dashboard page
···11+## ADDED Requirements
22+33+### Requirement: Creator can switch between dashboard form views
44+The system SHALL allow an authenticated creator to switch the dashboard form list between a grid view and a table view.
55+66+#### Scenario: Creator opens the dashboard
77+- **WHEN** an authenticated creator opens the dashboard with existing forms
88+- **THEN** the system shows the forms in the default grid view and offers a control to switch to table view
99+1010+#### Scenario: Creator switches to table view
1111+- **WHEN** an authenticated creator selects the table view option on the dashboard
1212+- **THEN** the system displays the same forms in a table layout
1313+1414+#### Scenario: Creator switches back to grid view
1515+- **WHEN** an authenticated creator selects the grid view option on the dashboard after using table view
1616+- **THEN** the system displays the forms in the grid layout again
1717+1818+### Requirement: Table view shows sortable form management columns
1919+The system SHALL present table columns for form title, status, response count, and updated date, and SHALL allow the creator to sort the table by each of those columns.
2020+2121+#### Scenario: Creator views form data in table mode
2222+- **WHEN** an authenticated creator opens the dashboard table view
2323+- **THEN** the system shows each form with title, status, response count, and updated date columns
2424+2525+#### Scenario: Creator sorts by updated date
2626+- **WHEN** an authenticated creator selects the updated date column in table view
2727+- **THEN** the system reorders the visible forms by updated date
2828+2929+#### Scenario: Creator sorts by responses
3030+- **WHEN** an authenticated creator selects the response count column in table view
3131+- **THEN** the system reorders the visible forms by response count
3232+3333+#### Scenario: Creator sorts by title or status
3434+- **WHEN** an authenticated creator selects the title or status column in table view
3535+- **THEN** the system reorders the visible forms by the selected column
3636+3737+### Requirement: Dashboard actions remain available in each view
3838+The system SHALL keep core dashboard management actions available in both grid and table views.
3939+4040+#### Scenario: Creator opens a form from grid view
4141+- **WHEN** an authenticated creator uses a dashboard action in grid view
4242+- **THEN** the system allows direct navigation to the builder or responses for that form
4343+4444+#### Scenario: Creator opens a form from table view
4545+- **WHEN** an authenticated creator uses a dashboard action in table view
4646+- **THEN** the system allows direct navigation to the builder or responses for that form
···11+## 1. Dashboard view state and data preparation
22+33+- [x] 1.1 Add dashboard UI state for switching between grid and table views
44+- [x] 1.2 Add dashboard sorting state and derived sorted form data for title, status, response count, and updated date
55+- [x] 1.3 Keep the current card layout as the default grid view over the shared form data
66+77+## 2. Table view implementation
88+99+- [x] 2.1 Implement a dashboard table layout with columns for title, status, response count, and updated date
1010+- [x] 2.2 Add sortable controls to each supported table column
1111+- [x] 2.3 Expose core form actions in the table view so creators can open the builder and responses from each row
1212+1313+## 3. Dashboard polish and verification
1414+1515+- [x] 3.1 Add compact view-switching controls that fit the existing dashboard management header
1616+- [x] 3.2 Verify empty-state and existing grid behavior remain intact while table view works for populated dashboards
1717+- [x] 3.3 Run build and relevant checks to confirm the dashboard view toggle and sorting work correctly
+46
openspec/specs/dashboard-form-views/spec.md
···11+## ADDED Requirements
22+33+### Requirement: Creator can switch between dashboard form views
44+The system SHALL allow an authenticated creator to switch the dashboard form list between a grid view and a table view.
55+66+#### Scenario: Creator opens the dashboard
77+- **WHEN** an authenticated creator opens the dashboard with existing forms
88+- **THEN** the system shows the forms in the default grid view and offers a control to switch to table view
99+1010+#### Scenario: Creator switches to table view
1111+- **WHEN** an authenticated creator selects the table view option on the dashboard
1212+- **THEN** the system displays the same forms in a table layout
1313+1414+#### Scenario: Creator switches back to grid view
1515+- **WHEN** an authenticated creator selects the grid view option on the dashboard after using table view
1616+- **THEN** the system displays the forms in the grid layout again
1717+1818+### Requirement: Table view shows sortable form management columns
1919+The system SHALL present table columns for form title, status, response count, and updated date, and SHALL allow the creator to sort the table by each of those columns.
2020+2121+#### Scenario: Creator views form data in table mode
2222+- **WHEN** an authenticated creator opens the dashboard table view
2323+- **THEN** the system shows each form with title, status, response count, and updated date columns
2424+2525+#### Scenario: Creator sorts by updated date
2626+- **WHEN** an authenticated creator selects the updated date column in table view
2727+- **THEN** the system reorders the visible forms by updated date
2828+2929+#### Scenario: Creator sorts by responses
3030+- **WHEN** an authenticated creator selects the response count column in table view
3131+- **THEN** the system reorders the visible forms by response count
3232+3333+#### Scenario: Creator sorts by title or status
3434+- **WHEN** an authenticated creator selects the title or status column in table view
3535+- **THEN** the system reorders the visible forms by the selected column
3636+3737+### Requirement: Dashboard actions remain available in each view
3838+The system SHALL keep core dashboard management actions available in both grid and table views.
3939+4040+#### Scenario: Creator opens a form from grid view
4141+- **WHEN** an authenticated creator uses a dashboard action in grid view
4242+- **THEN** the system allows direct navigation to the builder or responses for that form
4343+4444+#### Scenario: Creator opens a form from table view
4545+- **WHEN** an authenticated creator uses a dashboard action in table view
4646+- **THEN** the system allows direct navigation to the builder or responses for that form