feat: subtask count in task lists #41
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "feat/subtask-count"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary by CodeRabbit
New Features
TaskWithSubtasks
structure to encapsulate tasks along with their subtasks.Bug Fixes
Documentation
Chores
Walkthrough
The pull request introduces substantial changes across various components and models to enhance task management functionality. Key modifications include the transition from basic task queries to those that retrieve tasks along with their associated subtasks. This involves updates to components such as
CategoryCalendarPage
,CategoryPage
, andSubtasksForm
, as well as the introduction of new structs and traits to support relationships between tasks and subtasks, thereby improving the overall data structure and query capabilities within the application.Changes
src/components/pages/category_calendar_page.rs
,src/components/pages/category_page.rs
,src/components/pages/category_today_page.rs
src/components/subtasks_form.rs
,src/components/task_form.rs
Task
objects instead of IDs, updated logic for managing subtasks.src/components/task_list.rs
TaskWithSubtasks
, updated rendering logic to display subtasks effectively.src/models/project.rs
,src/models/subtask.rs
,src/models/task.rs
Identifiable
andAssociations
traits, defined relationships, and introducedTaskWithSubtasks
struct.src/query/mod.rs
,src/query/tasks.rs
QueryValue
andQueryKey
enums, introduced functions to fetch tasks with subtasks in a specified category.src/server/tasks.rs
Possibly related PRs
CategoryCalendarPage
component involve transitioning to a new query that retrieves tasks with subtasks, which directly relates to the changes in thesrc/components/pages/category_calendar_page.rs
file in PR #40, where the ability to manage subtasks is introduced.Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Share
Tips
Chat
There are 3 ways to chat with CodeRabbit:
I pushed a fix in commit <commit_id>.
Generate unit testing code for this file.
Open a follow-up GitHub issue for this discussion.
@coderabbitai
in a new review comment at the desired location with your query. Examples:@coderabbitai generate unit testing code for this file.
@coderabbitai modularize this function.
@coderabbitai
in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai generate interesting stats about this repository and render them as a table.
@coderabbitai show all the console.log statements in this repository.
@coderabbitai read src/utils.ts and generate unit testing code.
@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
@coderabbitai help me debug CodeRabbit configuration file.
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
@coderabbitai pause
to pause the reviews on a PR.@coderabbitai resume
to resume the paused reviews.@coderabbitai review
to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full review
to do a full review from scratch and review all the files again.@coderabbitai summary
to regenerate the summary of the PR.@coderabbitai resolve
resolve all the CodeRabbit review comments.@coderabbitai configuration
to show the current CodeRabbit configuration for the repository.@coderabbitai help
to get help.Other keywords and placeholders
@coderabbitai ignore
anywhere in the PR description to prevent this PR from being reviewed.@coderabbitai summary
to generate the high-level summary at a specific location in the PR description.@coderabbitai
anywhere in the PR title to generate the title automatically.CodeRabbit Configuration File (
.coderabbit.yaml
).coderabbit.yaml
file to the root of your repository.# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Documentation and Community
Actionable comments posted: 5
Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Commits
Files that changed from the base of the PR and between
1479957916
and024c5a2258
.Files selected for processing (12)
Additional comments not posted (19)
@ -2,3 +2,3 @@
use crate::models::category::Category;
use crate::query::tasks::use_tasks_in_category_query;
use crate::query::tasks::use_tasks_with_subtasks_in_category_query;
use crate::query::QueryValue;
Approved: Updated query function and result handling in
CategoryPage
.The replacement of the query function with
use_tasks_with_subtasks_in_category_query
and the updated handling of query results are well-aligned with the PR's objectives. The changes enhance the component's ability to present a more comprehensive view of tasks. However, consider implementing the loading indicator as mentioned in the TODO comment to improve user experience during data loading.Would you like assistance in implementing the loading indicator? If so, I can help draft the necessary code or open a GitHub issue to track this enhancement.
Also applies to: 12-17
@ -22,4 +22,4 @@
let long_term_tasks_query_result = long_term_tasks_query.result();
rsx! {
div {
Refactor: Updated query functions for task fetching.
The component now uses
use_tasks_with_subtasks_in_category_query
for fetching tasks, which is aligned with the new model requirements. This change is crucial for supporting the enhanced task management functionality.Also applies to: 21-21
@ -86,22 +86,22 @@ pub(crate) fn CategoryTodayPage() -> Element {
value => panic!("Unexpected query result: {value:?}")
}
Refactor: Enhanced rendering logic for tasks with subtasks.
The rendering logic within the
rsx!
macro has been updated to accommodate tasks with subtasks. This includes changes in how tasks are accessed (task.task()
) and displayed, particularly handling task properties likeid
,title
, anddeadline
. These changes are crucial for correctly displaying tasks with their subtasks and ensuring the UI is consistent with the new data model.Also applies to: 58-62, 92-104, 99-104
@ -18,3 +19,1 @@
form {
class: "flex flex-row items-center gap-3",
onsubmit: move |event| async move {
form {
Refactor: Updated function signature and form submission handler.
The function signature of
SubtasksForm
has been updated to accept aTask
object, enhancing the component's integration with the task management system. The form submission handler now utilizestask.id()
andtask.category()
, which simplifies the logic and reduces the risk of errors. Additionally, the query invalidation logic has been updated to include the task's category, ensuring more precise cache management.Also applies to: 14-15, 21-33
@ -136,2 +136,3 @@
QueryKey::TasksInCategory(selected_category())
QueryKey::TasksInCategory(selected_category()),
QueryKey::TasksWithSubtasksInCategory(selected_category()),
]);
Refactor: Enhanced query invalidation and input field handling.
The query invalidation logic has been expanded to include
QueryKey::TasksWithSubtasksInCategory(selected_category())
, which allows the application to refresh the relevant data when a task is submitted. This addition improves the responsiveness of the UI. The handling of theautofocus
property for the title input field has been updated to improve user experience by automatically focusing on the title input when creating a new task. Additionally, theSubtasksForm
now receives the entire task object, facilitating easier access to task properties within the subtasks context.Also applies to: 155-155, 350-350
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Commits
Files that changed from the base of the PR and between
024c5a2258
andbdfc2bc945
.Files selected for processing (2)
Additional comments not posted (7)