Skip to content

fix: resolve 5 type/safety bugs across adapters, jsx, data, and widgets#3075

Open
tmdeveloper007 wants to merge 1 commit into
Karanjot786:mainfrom
tmdeveloper007:fix/termui-gssoc-batch-2026-07-26
Open

fix: resolve 5 type/safety bugs across adapters, jsx, data, and widgets#3075
tmdeveloper007 wants to merge 1 commit into
Karanjot786:mainfrom
tmdeveloper007:fix/termui-gssoc-batch-2026-07-26

Conversation

@tmdeveloper007

@tmdeveloper007 tmdeveloper007 commented Jul 26, 2026

Copy link
Copy Markdown

Summary

Resolves 5 bugs across 4 packages:

# Package Fix
#3074 adapters/conf ConfStore.config typed as ConfInstance<T> instead of { store: T }
#3073 jsx usePrevious uses useLayoutEffect so ref updates synchronously
#3072 data loadingRef added to useInfiniteQuery fetchNextPage deps
#3070 widgets Remove redundant clamp01(value) call in ProgressCircle.setValue
#3071 jsx useThrottle runTimeout uses intervalRef.current instead of stale closure

CI

All checks pass:

  • bun run build
  • bun vitest run ✅ (427 files, 5976 tests)
  • bun run typecheck

Closes #3074
Closes #3073
Closes #3072
Closes #3070
Closes #3071

Summary by CodeRabbit

  • Bug Fixes

    • Improved throttled updates so changing the interval takes effect reliably.
    • Fixed progress indicators to consistently retain their correctly bounded values.
    • Improved previous-value tracking timing for more predictable rendering behavior.
    • Ensured loading state changes are reflected when fetching additional results.
  • Internal Improvements

    • Strengthened configuration type definitions for better compile-time reliability.

- fix(adapters): fix ConfStore.config type to use ConfInstance<T> instead of { store: T }
- fix(jsx): use useLayoutEffect in usePrevious so ref updates synchronously (closes Karanjot786#3073)
- fix(data): add loadingRef to useInfiniteQuery fetchNextPage deps array (closes Karanjot786#3072)
- fix(widgets): remove redundant clamp01 call in ProgressCircle.setValue (closes Karanjot786#3070)
- fix(jsx): fix useThrottle stale intervalRef capture in runTimeout (closes Karanjot786#3071)

Closes Karanjot786#3074
Closes Karanjot786#3073
Closes Karanjot786#3072
Closes Karanjot786#3070
Closes Karanjot786#3071
@github-actions github-actions Bot added type:bug +10 pts. Bug fix. area:widgets @termuijs/widgets area:jsx @termuijs/jsx area:data @termuijs/data type:testing +10 pts. Tests. labels Jul 26, 2026
@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f1cd85da-7e3c-4331-aa6b-105f7a073782

📥 Commits

Reviewing files that changed from the base of the PR and between 46503a5 and d058f78.

📒 Files selected for processing (6)
  • packages/adapters/src/conf/index.ts
  • packages/data/src/hooks.ts
  • packages/jsx/src/hooks/usePrevious.test.ts
  • packages/jsx/src/hooks/usePrevious.ts
  • packages/jsx/src/hooks/useThrottle.ts
  • packages/widgets/src/feedback/ProgressCircle.ts

📝 Walkthrough

Walkthrough

Updates configuration adapter typing, React hook lifecycle and dependency handling, throttle interval scheduling, previous-value tests, and progress value assignment.

Changes

Configuration, hooks, and widgets

Layer / File(s) Summary
Configuration API contract
packages/adapters/src/conf/index.ts
Adds typed ConfInstance operations and updates ConfConstructor and ConfStore to use the expanded configuration shape.
Hook lifecycle and timing behavior
packages/data/src/hooks.ts, packages/jsx/src/hooks/usePrevious.ts, packages/jsx/src/hooks/usePrevious.test.ts, packages/jsx/src/hooks/useThrottle.ts
Adds loadingRef to the infinite-query callback dependencies, switches usePrevious to useLayoutEffect, updates its test harness, and schedules throttle timers using the current interval.
Progress value assignment
packages/widgets/src/feedback/ProgressCircle.ts
Stores the computed clamped value directly after checking whether it changed.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

Possibly related PRs

Suggested labels: level:beginner

Suggested reviewers: karanjot786

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description covers the summary and linked issues, but it omits most required template sections and checklist items. Add the required sections from the template: Description, Related Issue, Which package(s)?, Type of Change, Checklist, GSSoC, and Notes/Screenshots as applicable.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise, uses the required fix prefix, and summarizes the main change across the touched packages.
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.
✨ 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

1 participant