feat: add Tasks app with Todoist provider#23
Open
HenriqueMorato wants to merge 6 commits into
Open
Conversation
- Task POD with fixed char[] fields (no std::string, ESP32-C3 heap budget) - TasksFilter struct with Date/Overdue enum axes - TaskProvider pure-virtual interface for swappable backends - TasksConfig singleton persisting to /.crosspoint/tasks.json - Stub written on first launch with empty token so users have a JSON to edit
- TodoistProvider singleton implements the TaskProvider interface - TodoistFilter translates generic TasksFilter to Todoist query DSL - Inlines esp_http_client with lazy 16KB buffer post-TLS to dodge heap fragmentation on ESP32-C3 - Defines TasksConfig::getActiveProvider() here so TasksConfig stays free of provider dependencies - HttpDownloader was unsuitable: no custom-header API for Bearer auth, no lazy-alloc for the response body
- TasksActivity renders Minimal (compact list) or Daily (date + day-of-week + list) layout - First-launch setup screen shown when todoistApiToken is empty, pointing user to /.crosspoint/tasks.json on SD card - Daily date header suppressed when system clock isn't set (no garbage "Jan 1 1970" rendering) - appTasks toggle on CrossPetSettings controls visibility in Tools menu - Added minimal Tasks i18n keys (full settings strings land in Phase 4) - Day-of-week uses LEXEND_18 bold, matching WeatherActivity's headline-data convention
- New TasksSettingsActivity with 7 rows (provider, design, date filter, overdue filter, date format, orientation, forget) - Launched from inside TasksActivity via Left or Right front button (mirrors WeatherActivity pattern; no entry in main Settings) - Up/Down now scroll the task list; Left/Right open settings — explicit button handling instead of ButtonNavigator so the two roles don't conflict - Confirm in Setup state re-loads config so users can populate the token via SD card and continue without restarting the app - Settings sub-screen restores activity orientation on close so a change there takes effect on the next render - Added 16 i18n keys for settings labels and filter values
- Load TasksConfig at boot so settings persist across power cycles - Switch all input handlers to wasReleased to match parent ToolsActivity's edge convention (Back from sub-activity no longer cascades up the stack) - Wrap the setup screen message with wrappedText so the JSON path fits on smaller orientations - Natural-sort task titles so "task 2" comes before "task 10" - Re-sort tasks by date then title (drop the timed/untimed split — it made order surprising for the common all-untimed-today case) - Nudge the scroll bar into the side padding so it isn't on top of task titles - Make TasksSettingsActivity landscape-aware so the hint strip stops overlapping the row list in CW/CCW orientations - Surface the appTasks toggle in the main CrossPet settings panel alongside the other apps - Add an "Are you sure?" confirmation before Forget and auto-close settings on confirm so the user lands on the setup screen instead of a stale task list
- esp-tls getaddrinfo() returned EAI_FAIL (errno 202) for api.todoist.com immediately after WiFi associated - lwIP's resolver needs a beat to initialize on a fresh connection - Mirrors the pattern already used by WeatherActivity::silentRefresh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
What is the goal of this PR?
Adds a Tasks app to the Apps menu that shows todos from a configured provider. First provider is Todoist, talking directly to the REST API.
What changes are included?
src/tasks/— generic domain types (Task,TaskProvider,TasksFilter) and aTasksConfigsingleton persisting to/.crosspoint/tasks.jsonsrc/tasks/providers/todoist/—TodoistProviderimplementingTaskProvider, plusTodoistFiltertranslating the generic filter into Todoist's query DSLsrc/activities/tasks/TasksActivity— Minimal and Daily layouts, plus a first-launch setup screen pointing users to the JSON config on the SD cardsrc/activities/settings/TasksSettingsActivity— provider, design, date/overdue filters, date format, orientation, forget; opened from inside the Tasks app via Left/Right front buttons (mirrors WeatherActivity)appTaskstoggle onCrossPetSettingscontrols visibility in the Tools menuAdditional Context
TaskProviderinterface — Todoist is just the first. Nothing outsidesrc/tasks/providers/todoist/is Todoist-specific.TodoistProviderinlinesesp_http_clientwith a lazy 16KB buffer allocated post-TLS handshake to dodge heap fragmentation on the ESP32-C3.HttpDownloaderwas unsuitable: no custom-header API for Bearer auth, no lazy-alloc for the response body.Taskuses fixedchar[]fields (nostd::string) to stay within the ~380KB heap budget.The Todoist API token is not entered on-device — there's no on-screen keyboard
TasksConfigwrites a stub/.crosspoint/tasks.jsonto the SD card with emptytodoistApiTokenand all other defaults.TasksSettingsActivityon-device and persist back into the same JSON. Settings can be edited either through the device UI or by hand-editing the file.AI Usage
While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it
helps set the right context for reviewers.
Did you use AI tools to help write this code? YES