Skip to content

Construction diary list should default to 'Manual' filter instead of 'All' #1781

Description

@steilerDev

Bug Report

The construction diary list currently defaults to showing All entries (both manual and automatic). The desired behavior is that the default filter should be Manual entries only.

Current Behavior

When opening the diary page with no filterMode URL search parameter, the list shows all entries (manual + automatic).

Expected Behavior

When opening the diary page with no filterMode URL search parameter, the list should default to showing Manual entries only. Users can still switch to "All" or "Automatic" via the filter control.

Technical Context

  • File: client/src/pages/DiaryPage/DiaryPage.tsx, line 48
  • Current code: const filterMode = (searchParams.get('filterMode') as FilterMode) || 'all';
  • The filter is controlled via the URL search parameter filterMode
  • FilterMode type: 'all' | 'manual' | 'automatic'
  • Manual entry types: daily_log, site_visit, delivery, issue, general_note
  • Automatic entry types: work_item_status, invoice_status, invoice_created, milestone_delay, budget_breach, auto_reschedule, subsidy_status

Acceptance Criteria

  • Given a user navigates to the construction diary page with no filterMode URL search parameter, When the list loads, Then the active filter is "Manual" and only manual entries (daily_log, site_visit, delivery, issue, general_note) are displayed.
  • Given a user is on the diary page with the default "Manual" filter, When they view the filter control, Then "Manual" is shown as the currently selected/active option.
  • Given a user explicitly selects the "All" filter, When the list refreshes, Then both manual and automatic entries are displayed and the URL reflects filterMode=all.
  • Given a user explicitly selects the "Automatic" filter, When the list refreshes, Then only automatic entries (work_item_status, invoice_status, invoice_created, milestone_delay, budget_breach, auto_reschedule, subsidy_status) are displayed and the URL reflects filterMode=automatic.
  • Given a user navigates to the diary page with an explicit filterMode=all (or automatic) URL search parameter, When the list loads, Then the parameter is honored and the corresponding filter is applied (the default only applies when no parameter is present).

Notes

  • This is a default-value change only; the existing filter UI and URL-parameter handling remain unchanged.
  • Switching the default may affect any E2E tests that assume "All" entries are visible on initial load — verify and update test expectations as needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions