Files
project-work/sources/view-mockup-generation.md
Eric Bell 7bde8c3b85 updates to the questions
Answers:

 1. Checked against code:
     - Project dropdown: project_id / project_name ✓ (Project model)
     - "+ New Task" URL: /new_task/ ✓ (urls.py name=new_task)
     - View URL: /task_information/{task_id}/ ✓ (urls.py
       name=task_information)

 2. Updated sources/view-mockup-generation.md — now matches all decisions
    (6 statuses, higher-order badges, 3 priority color groups, real sort
    fields, numeric filter IDs, elided pagination).

 3. Unassigned filter value: 0 (numeric), not "unassigned". View treats
    assignee=0 as task_assigned_to__isnull=True.

 4. Mobile check: Can't render here — you'll need to open the generated
    wireframe in a browser and narrow to <1024px.

 5. Commit: Noted — I haven't committed anything.
2026-11-01 16:17:35 -05:00

125 lines
5.6 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Task List View Mockup - Design
**Purpose**: Centralized, cross-project task list with filtering, sorting, pagination
## Page Layout
Two-column responsive layout (sidebar left, table right on desktop; stacked on mobile <1024px).
**Header bar**: "All Tasks" title on left; "+ New Task" button on right (visible only to users with create permission, `user_level >= 3`). Links to `/new_task/`.
---
## Sidebar Filters (Fixed Width ~280px)
All filters in a single GET form. Five filter sections, each with a label and control:
1. `Status` - six checkboxes (New, Backlog, Blocked, In Progress, Test/Review, Closed). Multi-select. Values come from `ListOfTaskStatus` model (user-configurable; defaults shown). Form values are numeric `task_status_id`.
2. `Assignee` - a dropdown: "All Assignees" + all users who have task access in the current user's accessible projects + "Unassigned" (value `0`). Form values are numeric user `id`.
3. `Project` - a dropdown: "All Projects" + projects the user has `ObjectAssignment` access to (via their groups). Form values are numeric `project_id`, labels are `project_name`.
4. `Date Range` - two HTML5 date inputs: "Start Date" (filters `task_start_date__gte`) and "End Date" (filters `task_end_date__lte`). Each optional independently.
5. `Actions` - two buttons: "Clear Filters" (secondary style, links to base `/tasks/` URL) and "Apply" (primary style, submits form).
---
## Main Table Area
### Results Header
- Left: "Showing X–Y of Z tasks" (uses paginator `start_index`, `end_index`, `count`)
- Right: Page size dropdown (10, 25, 50, 100; default 25). Auto-submits on change.
### Data Table (9 Columns)
| Column | Sortable | Sort Field | Content |
|--------|----------|------------|---------|
| Title | Yes | `task_short_description` | Bold task short description + small gray task ID (`#T-{id}`) |
| Status | Yes | `task_status__task_status_sort_order` | Colored badge by higher-order status |
| Priority | Yes | `task_priority` | Colored dot (8px) + label: Highest/High (red), Normal (orange), Low/Lowest (blue) |
| Assignee | Yes | `task_assigned_to__username` | Username or hyphen if unassigned |
| Project | Yes | `first_project_name` (annotated) | First project name via ObjectAssignment |
| Start Date | Yes | `task_start_date` | YYYY-MM-DD |
| End Date | Yes | `task_end_date` | YYYY-MM-DD |
| Created | Yes | `date_created` | YYYY-MM-DD |
| Actions | No | — | "View" button linking to `/task_information/{id}/` |
### Sorting
- Click any sortable header → toggles ASC/DESC.
- URL param: `?sort=field` (asc) or `?sort=-field` (desc).
- Header shows ▲ (asc) or ▼ (desc) next to column name.
- Default sort: `-date_created` (newest first).
- Clicking a different column starts ascending; re-clicking active column toggles.
### Status Badges (By Higher-Order Status)
| Higher-Order Status | Example Statuses | Background | Text | CSS Class |
|---------------------|------------------|------------|------|-----------|
| Backlog | New, Backlog | `#fff3cd` | `#856404` | `badge badge-backlog` |
| Normal | In Progress, Test/Review | `#cce5ff` | `#004085` | `badge badge-normal` |
| Blocked | Blocked | `#f8d7da` | `#721c24` | `badge badge-blocked` |
| Closed | Closed | `#d4edda` | `#155724` | `badge badge-closed` |
Template: `badge badge-{{ task.task_status.task_higher_order_status|lower }}` with label `{{ task.task_status.task_status }}`.
### Priority Indicators (Three Color Groups)
| Priority Values | Labels | Color | CSS Class |
|-----------------|--------|-------|-----------|
| 0, 1 (Highest, High) | Highest, High | Red `#cb2431` | `priority-high` |
| 2 (Normal) | Normal | Orange `#e67e22` | `priority-normal` |
| 3, 4 (Low, Lowest) | Low, Lowest | Blue `#3498db` | `priority-low` |
Template maps value: `<=1 → high`, `2 → normal`, `>=3 → low`. Label via `{{ task.get_task_priority_display }}`. Sort ascending on `task_priority` puts Highest (0) first.
### Empty State
When queryset empty: single row spanning all columns, centered "No tasks found" text.
### Pagination Footer
- "◀ Prev" (disabled on page 1)
- Page numbers: Django's `paginator.get_elided_page_range()` — e.g., 1 2 3 4 5 … 6
- "Next ▶" (disabled on last page)
- All links preserve every active filter, sort, and page_size query parameter.
---
## Permission Awareness
| Element | Condition |
|---------|-----------|
| "+ New Task" button | `user_level >= 3` |
| "View" action links | `user_level >= 1` |
| Filter sidebar | Always visible (read-only users can filter) |
`user_level` = max `permission_set__task` across user's groups for accessible projects. Superusers see all tasks and all UI elements.
---
## Design System Conformance
- Buttons: `btn btn-primary` / `btn btn-secondary`
- Form controls: `form-control` class on all inputs/selects
- Table: standard HTML table with 12px 16px cell padding
- Badges: `badge` base + status modifier
- Colors: Primary `#0366d6`, text `#24292e`, borders `#e1e4e8`
- Spacing: 8px base unit, 16px section gaps
---
## What Is Explicitly Excluded
No bulk actions, no column visibility toggle, no saved filter presets, no real-time updates, no drag-and-drop, no live collaboration indicators. This is a read/list view only.
---
## Deliverable Expectation
A single self-contained HTML file with embedded CSS/JS that:
- Renders correctly standalone in a browser
- Uses realistic sample data (8–10 rows covering all 6 default statuses and 5 priority levels in 3 color groups)
- Contains Django template syntax (`{% for %}`, `{% if %}`, form field rendering)
- Matches every component, color, and behavior described above
- Serves as the exact visual and structural target for implementation