Skip to content

fix(tasks): persist status & priority from the desktop sidebar#497

Open
Profit-Rocket wants to merge 1 commit into
frappe:developfrom
Profit-Rocket-Ltd:fix/sidebar-task-status-save
Open

fix(tasks): persist status & priority from the desktop sidebar#497
Profit-Rocket wants to merge 1 commit into
frappe:developfrom
Profit-Rocket-Ltd:fix/sidebar-task-status-save

Conversation

@Profit-Rocket

Copy link
Copy Markdown

Problem

On a task detail page (desktop, sm:block sidebar), selecting a Status or Priority appears to change but never persists — no autosave, reverts on reload. Comments and the other sidebar fields (Assignee/Space/Due Date) save fine. The mobile layout (<Dropdown>) is unaffected.

Cause

TaskDetail.vue desktop sidebar uses:

<Select v-model="task.doc.status" :options="statusOptions" …>

where statusOptions entries carry onClick: () => task.setValue.submit({ status }). A native <Select> renders <option> elements and never invokes per-option onClick (that's a <Dropdown> pattern); with only v-model the change mutates the local doc and never calls setValue. Priority has the same issue.

Fix

Switch both to :modelValue + @update:modelValue → task.setValue.submit(), mirroring the working Assignee/Space/Due Date controls in the same component.

The desktop task sidebar rendered Status/Priority as <Select v-model> whose
options carry onClick: task.setValue.submit(...). A native <Select> never fires
per-option onClick (that's a Dropdown pattern), and there was no
@update:modelValue handler, so selecting a value only mutated the local doc and
never persisted — no autosave, reverts on reload. The mobile <Dropdown> layout
was unaffected. Switch both to :modelValue + @update:modelValue ->
task.setValue.submit(), matching the sibling Assignee/Space/Due Date controls.
@greptile-apps

greptile-apps Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

Safe to merge — two-line template change that correctly wires the desktop sidebar controls to the existing save mechanism.

The change is minimal and surgical: it removes v-model and adds the same :modelValue + @update:modelValue pattern already used by Assignee, Space, and Due Date in the same component. The mobile Dropdown path is untouched and continues to work via option onClick handlers. No logic is introduced, no new state, no risk of double-save.

No files require special attention.

Important Files Changed

Filename Overview
frontend/src/components/TaskDetail.vue Switches Status and Priority desktop Select controls from v-model to :modelValue + @update:modelValue, correctly wiring them to task.setValue.submit() and matching the established pattern for other sidebar fields.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant User
    participant Select as Select (desktop)
    participant Dropdown as Dropdown (mobile)
    participant Vue as Vue reactivity
    participant API as task.setValue.submit()

    Note over Select,Dropdown: Before fix
    User->>Select: picks new status
    Select->>Vue: emits update:modelValue
    Vue->>Vue: v-model mutates task.doc.status locally
    Note right of API: setValue never called — change lost on reload

    Note over Select,Dropdown: After fix
    User->>Select: picks new status
    Select->>Vue: emits update:modelValue
    Vue->>API: "(status) => task.setValue.submit({ status })"
    API-->>Vue: backend persists, task.doc refreshed ✓

    User->>Dropdown: picks new status (mobile)
    Dropdown->>API: "option.onClick → task.setValue.submit({ status })"
    API-->>Vue: backend persists ✓
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant User
    participant Select as Select (desktop)
    participant Dropdown as Dropdown (mobile)
    participant Vue as Vue reactivity
    participant API as task.setValue.submit()

    Note over Select,Dropdown: Before fix
    User->>Select: picks new status
    Select->>Vue: emits update:modelValue
    Vue->>Vue: v-model mutates task.doc.status locally
    Note right of API: setValue never called — change lost on reload

    Note over Select,Dropdown: After fix
    User->>Select: picks new status
    Select->>Vue: emits update:modelValue
    Vue->>API: "(status) => task.setValue.submit({ status })"
    API-->>Vue: backend persists, task.doc refreshed ✓

    User->>Dropdown: picks new status (mobile)
    Dropdown->>API: "option.onClick → task.setValue.submit({ status })"
    API-->>Vue: backend persists ✓
Loading

Reviews (1): Last reviewed commit: "fix(tasks): persist status & priority fr..." | Re-trigger Greptile

@github-actions

Copy link
Copy Markdown

UI Test Results

❌ 4 failed — 31/35 tests passed in 2m 2s.

Spec Tests
comment.cy.js 1 1 0 0 11s
community-composer.cy.ts 3 3 0 0 5s
community-mobile-home.cy.ts 1 1 0 0 2s
community-naming.cy.ts 3 1 2 0 28s
community-scoped-links.cy.ts 3 3 0 0 2s
community-shell.cy.ts 3 2 1 0 15s
community-smoke.cy.ts 3 3 0 0 2s
community-spaces-guardrails.cy.ts 2 2 0 0 2s
discussion.cy.js 1 0 1 0 27s
member-management.cy.ts 4 4 0 0 7s
mobile-more-pages.cy.ts 4 4 0 0 5s
new-discussion.cy.ts 2 2 0 0 5s
onboarding.cy.js 1 1 0 0 1s
page.cy.js 1 1 0 0 1s
project.cy.js 1 1 0 0 4s
search-privacy.cy.ts 1 1 0 0 2s
task.cy.js 1 1 0 0 4s
Total 35 31 4 0 2m 2s

Results for commit d066b0f.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant