Skip to content

fix(widgets): implement getTasks getter on TaskList #2236#2237

Open
itssagarK wants to merge 1 commit into
Karanjot786:mainfrom
itssagarK:fix/tasklist-gettasks
Open

fix(widgets): implement getTasks getter on TaskList #2236#2237
itssagarK wants to merge 1 commit into
Karanjot786:mainfrom
itssagarK:fix/tasklist-gettasks

Conversation

@itssagarK

@itssagarK itssagarK commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Closes Issue #2236

Description:
Implements getTasks(): TaskItem[] on the TaskList widget to allow reading the current task array.

Changes:

  • Added getTasks(): TaskItem[] to TaskList.ts.
  • Added a unit test in TaskList.test.ts to verify the getter.

Validation:

  • Ran bun vitest run packages/widgets/src/feedback/TaskList.test.ts (13/13 tests passed).

Type of Change

  • 🐛 Bug fix (type:bug)
  • ✨ Feature (type:feature)
  • 📝 Docs (type:docs)
  • 🧪 Tests (type:testing)
  • ♻️ Refactor (type:refactor)
  • 🎨 Design / UX (type:design)
  • ♿ Accessibility (type:accessibility)
  • ⚡ Performance (type:performance)
  • 🔧 DevOps / CI (type:devops)
  • 🔒 Security (type:security)

Checklist

  • ⭐ You starred the repo. The needs-star check blocks your merge otherwise.
  • Tests pass locally: bun vitest run
  • Build passes: bun run build
  • Typecheck passes: bun run typecheck
  • You read CONTRIBUTING.md.
  • Your PR title follows type: short description.
  • Widget state mutators call markDirty() (if your change affects rendering).
  • No new any types without an inline comment explaining why.
  • No unrelated refactors bundled into this PR.

GSSoC 2026 Participation

  • You are a GSSoC 2026 contributor.
  • Your GSSoC profile: https://gssoc.girlscript.org/profile/____

Screenshots / Recordings (UI changes)

Notes for the Reviewer

Summary by CodeRabbit

  • Tests
    • Added coverage to ensure task lists retain the same items passed in during creation.
  • Refactor
    • Exposed a new way to inspect the current task list state without changing existing behavior.

@itssagarK itssagarK requested a review from Karanjot786 as a code owner July 9, 2026 02:28
@github-actions github-actions Bot added type:bug +10 pts. Bug fix. area:widgets @termuijs/widgets type:testing +10 pts. Tests. and removed type:bug +10 pts. Bug fix. labels Jul 9, 2026
@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Added a public getTasks() method to the TaskList widget that returns the internal _tasks array, along with a corresponding unit test verifying it returns the same array instance passed to the constructor.

Changes

TaskList getTasks Accessor

Layer / File(s) Summary
getTasks() method and identity test
packages/widgets/src/feedback/TaskList.ts, packages/widgets/src/feedback/TaskList.test.ts
Adds getTasks(): TaskItem[] returning _tasks, and a test confirming it returns the same TASKS array instance passed to the constructor.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related PRs

  • Karanjot786/TermUI#1034: Both PRs modify TaskList.ts/TaskList.test.ts around the internal _tasks representation and test coverage.

Suggested labels: quality:clean, level:intermediate

Suggested reviewers: Karanjot786

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Title check ✅ Passed The title is concise, specific, and accurately summarizes the main change in the PR.
Description check ✅ Passed The description is mostly complete and matches the template, but it omits the required Which package(s)? section.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@github-actions github-actions Bot added the type:bug +10 pts. Bug fix. label Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:widgets @termuijs/widgets type:bug +10 pts. Bug fix. type:testing +10 pts. Tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant