Skip to content

feat(export): add Markdown and JSON task export with GUI dialog - #40

Closed
MrSpideyNihal wants to merge 10 commits into
developmentfrom
feature/task-export
Closed

MrSpideyNihal wants to merge 10 commits into
developmentfrom
feature/task-export

Conversation

@MrSpideyNihal

Copy link
Copy Markdown
Owner

Summary

Closes #20 — Adds full task export functionality in both Markdown checklist and JSON formats, accessible via a new Export button in the main sidebar.


What's Changed

New: src/taskify/export/exporter.py

Core serialisation logic extracted into a standalone, testable module:

  • export_tasks_to_file(db, filepath, format, quadrant, start_date, end_date) → returns task count
  • Supports Markdown (GitHub-style checklist) and JSON formats
  • Quadrant filter (do_first, schedule, delegate, eliminate, or None for all)
  • Date-range filter via start_date / end_date datetime objects
  • Each exported task includes its nearest transcript excerpt (via get_transcript_excerpt_for_task)
  • Correct completed flag: task.status == completed (fixes silent bug where truthy string always set completed = True)

New: src/taskify/ui/export_dialog.py

Modal ExportDialog (CustomTkinter, matches app dark theme):

  • Format selector: Markdown / JSON
  • Quadrant filter dropdown
  • Togglable date-range inputs with YYYY-MM-DD validation
  • asksaveasfilename save dialog pre-populated with today's filename
  • Success / error messageboxes

Modified: src/taskify/ui/main_window.py

  • open_export() method added
  • Settings and Export buttons placed side-by-side in a shared bottom actions frame

New: tests/unit/test_export.py (5 tests)

  • test_export_to_json — verifies JSON structure including completed flag and transcript excerpt
  • test_export_to_markdown — verifies checkbox rendering and quadrant labels
  • test_export_with_quadrant_filter — verifies single-quadrant filtering
  • test_export_with_date_range_filters — verifies date-range boundary logic
  • test_export_invalid_format — verifies ValueError on unknown format

New: tests/unit/test_ui_export_dialog.py (8 tests)

  • Init state, date toggle, date format validations (3 error paths), chronology check, and two successful export flows (Markdown + JSON)

Modified: tests/unit/conftest.py

  • _W stub widget gains _state tracking in __init__ + configure, and a cget(attr) method to support state-assertion tests

Test Results

164 passed · ruff clean · mypy clean · coverage 84.41%

Screenshots

Before After
Single âš™ Settings button Export + Settings side-by-side

The Export dialog features format, quadrant, and optional date-range filters before prompting for a save location.

MrSpideyNihal and others added 10 commits July 17, 2026 12:37
feat: Eisenhower Matrix dashboard main window
Implements GitHub issue for task export functionality:

- Add src/taskify/export/exporter.py with export_tasks_to_file()
  supporting Markdown checklist and JSON formats, quadrant filtering,
  and date-range filtering with transcript excerpt embedding.
- Add src/taskify/ui/export_dialog.py (ExportDialog) — a modal
  CustomTkinter dialog matching the app theme, with format selector,
  quadrant filter, togglable date-range inputs, and a Save-As file
  dialog trigger.
- Wire open_export() into MainWindow, add Export + Settings buttons
  side-by-side in a shared bottom actions frame.
- Fix �ool(task.status) bug: replace with 	ask.status == 'completed'
  in both JSON and Markdown serialisation paths.
- Add �ssert task.id is not None to satisfy mypy before passing to
  get_transcript_excerpt_for_task.
- Add 	ests/unit/test_export.py (5 tests) and
  	ests/unit/test_ui_export_dialog.py (8 tests).
- Enhance _W stub in 	ests/unit/conftest.py with _state tracking
  and cget() to enable state-assertion tests.

All 164 tests pass · ruff clean · mypy clean · coverage 84.41%
@MrSpideyNihal

Copy link
Copy Markdown
Owner Author

Superseded: all changes from this branch have been merged into main directly. Closing as stale.

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