Skip to content

refactor: remove recent tasks section#1577

Merged
mfortman11 merged 4 commits into
mainfrom
tasks-past-vs-recent
May 13, 2026
Merged

refactor: remove recent tasks section#1577
mfortman11 merged 4 commits into
mainfrom
tasks-past-vs-recent

Conversation

@mfortman11

@mfortman11 mfortman11 commented May 11, 2026

Copy link
Copy Markdown
Contributor

Recent vs Past tasks sections get confusing and noisy this removes the recent section and all completed tasks are in the past section

Summary by CodeRabbit

  • Refactor

    • Task notification menu now shows all completed/failed/error tasks in a single "Past Tasks" section (replacing the previous recent/past split).
    • Simplified open/expand behavior: the past section auto-opens when the menu opens or when enabled, and task details expand for the selected task or the most recent failure; empty-state uses the unified past list.
  • Tests

    • Updated tests to verify all terminal tasks appear together in the Past Tasks section.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bd0611f7-cdfb-44a2-bfb1-8a64d5b4c52e

📥 Commits

Reviewing files that changed from the base of the PR and between d281000 and ccc9fb9.

📒 Files selected for processing (1)
  • frontend/tests/core/tasks-unified-panel.spec.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/tests/core/tasks-unified-panel.spec.ts

Walkthrough

The task notification menu is refactored from a two-section Recent/Past Tasks layout to a single Past Tasks section. State management simplifies to one toggle; recent vs. past filtering is removed; the UI displays only terminalTasks with updated expansion and selection logic. Tests use a new helper and validate the unified past section.

Changes

Task Notification Menu Refactoring

Layer / File(s) Summary
State Management Simplification
frontend/components/task-notification-menu.tsx
Replaces dual isRecentOpen/isPastOpen state with a single isPastOpen toggle; reset on menu open and when isRecentTasksExpanded context is enabled; adds useMemo import.
Task Data Model and Selection Logic
frontend/components/task-notification-menu.tsx
Derives terminalTasks and mostRecentFailureTaskId via memoization; adds effect to auto-open past section when selected task exists in terminalTasks.
UI Rendering and Expansion Logic
frontend/components/task-notification-menu.tsx
Removes Recent Tasks section; renders single Past Tasks TaskCollapsibleSection with terminalTasks; per-item details expand for the selected task or (when none selected) the mostRecentFailureTaskId; empty state now checks terminalTasks.length.
Test Helper and Assertions
frontend/tests/core/tasks-unified-panel.spec.ts
Adds openPastTasksSection helper replacing openRecentTasksSection; updates tests to open the past section and assert unified terminal-task grouping and updated INCOMPLETE counts/visibility.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

test

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'refactor: remove recent tasks section' directly and accurately describes the main change: removing the Recent Tasks section and consolidating tasks into the Past Tasks section.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch tasks-past-vs-recent

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added refactor frontend 🟨 Issues related to the UI/UX and removed refactor labels May 11, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
frontend/components/task-notification-menu.tsx (1)

51-55: ⚡ Quick win

Consider renaming isRecentTasksExpanded in the context.

The context property name isRecentTasksExpanded no longer aligns with its usage—it now controls the "Past Tasks" section. Consider renaming it to isPastTasksExpanded or a more generic name like isTerminalTasksExpanded to avoid confusion.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/components/task-notification-menu.tsx` around lines 51 - 55, The
prop/context name is misleading: update every usage and declaration of
isRecentTasksExpanded to a clearer name (e.g., isPastTasksExpanded or
isTerminalTasksExpanded) so it matches its role controlling the "Past Tasks"
panel; specifically rename the identifier in the context/provider and in this
component where useEffect watches isRecentTasksExpanded and sets isPastOpen, and
update any types/props, imports, and tests that reference isRecentTasksExpanded
(ensure renaming preserves runtime behavior and adjust the dependency array in
the useEffect to the new name).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@frontend/components/task-notification-menu.tsx`:
- Around line 82-93: The effect in useEffect that reads terminalTasks is running
every render because terminalTasks is recomputed inline; wrap the terminalTasks
computation (the filter/sort derived from tasks) in a useMemo with [tasks] so
the reference is stable, then keep the existing useEffect that checks
selectedTaskId, selectedTaskTrigger vs lastHandledSelectionTriggerRef.current
and calls setIsPastOpen when a match is found; update imports if needed to
include useMemo and ensure terminalTasks used in useEffect refers to the
memoized variable.

---

Nitpick comments:
In `@frontend/components/task-notification-menu.tsx`:
- Around line 51-55: The prop/context name is misleading: update every usage and
declaration of isRecentTasksExpanded to a clearer name (e.g.,
isPastTasksExpanded or isTerminalTasksExpanded) so it matches its role
controlling the "Past Tasks" panel; specifically rename the identifier in the
context/provider and in this component where useEffect watches
isRecentTasksExpanded and sets isPastOpen, and update any types/props, imports,
and tests that reference isRecentTasksExpanded (ensure renaming preserves
runtime behavior and adjust the dependency array in the useEffect to the new
name).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: adccfea9-9623-4cc5-b755-d63ecd3e4ed2

📥 Commits

Reviewing files that changed from the base of the PR and between e74483c and e3ad606.

📒 Files selected for processing (2)
  • frontend/components/task-notification-menu.tsx
  • frontend/tests/core/tasks-unified-panel.spec.ts

Comment thread frontend/components/task-notification-menu.tsx

@Wallgau Wallgau left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, couldn't do a functional test due to problem in my setup

@github-actions github-actions Bot added the lgtm label May 12, 2026
@lucaseduoli

Copy link
Copy Markdown
Collaborator

Doing a functional test now

@lucaseduoli lucaseduoli left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, tested and it's working perfectly

@mfortman11 mfortman11 merged commit d1303a3 into main May 13, 2026
15 checks passed
@github-actions github-actions Bot deleted the tasks-past-vs-recent branch May 13, 2026 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community frontend 🟨 Issues related to the UI/UX lgtm refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants