Skip to content

Task edit UX: render edit form as a centered modal#546

Open
bborn wants to merge 1 commit into
mainfrom
task/3805-task-edit-ux
Open

Task edit UX: render edit form as a centered modal#546
bborn wants to merge 1 commit into
mainfrom
task/3805-task-edit-ux

Conversation

@bborn
Copy link
Copy Markdown
Owner

@bborn bborn commented May 31, 2026

What

When editing a task from detail view (e), the edit form now renders as a centered modal sized to its content, instead of a full-screen form whose body textarea sprawled to fill the entire screen.

This makes all fields — project, title, details, attachments, type, executor — visible at once, which was the main pain point.

The "Discard changes?" confirmation (shown when pressing esc with unsaved edits) now appears at the top of the modal, right under the header, so it's immediately visible.

How

  • Added a modal flag on FormModel, set only by NewEditFormModel (the new-task form keeps its full-screen layout).
  • In modal mode, View() wraps the form in a content-sized box (min(90, width-8), capped) and centers it on screen via lipgloss — consistent with the existing delete/quit confirm modals.
  • calculateBodyHeight autogrows the body to its content within bounds (6–14 lines) and caps it to fit the screen, so short tasks get a compact modal and long ones get a scrollable editing area.
  • SetSize sizes inputs to the modal width; applied at construction so the modal renders correctly before any resize.
  • The discard warning moved to the top in modal mode (kept at the bottom for the full-screen new-task form).

Before / After

Before: full-screen box, body stretched to fill all vertical space, discard prompt at the bottom near the help line.

After (120x40):

              ╭──────────────────────────────────────────────────╮
              │  Edit Task                                        │
              │    Discard changes? (y/n)                         │
              │  ▸ Project        workflow ...                    │
              │    Title         Improve the task edit experience │
              │    Details                                        │
              │     ...                                           │
              │    Attachments                                    │
              │    Type          none  code  writing  thinking    │
              │    Executor      claude  codex                    │
              │    tab accept/navigate • ... • esc cancel         │
              ╰──────────────────────────────────────────────────╯

Tests

Added TestEditFormIsModal, TestEditFormDiscardWarningAtTop, and TestEditFormModalBodyHeightBounded. Full internal/ui suite passes.

🤖 Generated with Claude Code

When editing a task from detail view (press e), the form now renders as a
compact, centered modal sized to its content instead of a full-screen form
whose body sprawled to fill the whole screen. All fields (project, title,
details, attachments, type, executor) are visible at once.

The body textarea autogrows within bounds (6–14 lines) and is capped to fit
the screen, so short tasks get a tight modal and long ones get a scrollable
editing area.

The "Discard changes?" confirmation now appears at the top of the modal
(right under the header) when escaping with unsaved changes, so it's
immediately visible.

Only the edit form is modal; the new-task form keeps its full-screen layout.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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