Skip to content

fix: wire up API quota refresh button#79

Merged
rahul-vyas-dev merged 6 commits into
AOSSIE-Org:mainfrom
Dotify71:fix/api-quota-refresh
Jul 3, 2026
Merged

fix: wire up API quota refresh button#79
rahul-vyas-dev merged 6 commits into
AOSSIE-Org:mainfrom
Dotify71:fix/api-quota-refresh

Conversation

@Dotify71

@Dotify71 Dotify71 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Fixes #78

Description

Wired up the "dead" API Quota refresh button on the Settings page so that users can actually click it to fetch their updated GitHub rate limits without needing to trigger a full page reload or a new organization query.

Solution

  • Exported a new refreshRateLimit callback from AppContext.jsx.
  • Attached the onClick handler to the FiRefreshCw icon in SettingsPage.jsx.
  • Added a seamless CSS transform: rotate animation to provide visual feedback while the API call is in flight.

Summary by CodeRabbit

Release Notes

  • New Features
    • Added an interactive “API Quota” refresh option on the Settings page. Click the refresh button to update your current rate limit with loading feedback and a short delay to prevent repeated simultaneous refresh actions.
    • If the refresh fails, an error indicator is shown and the refresh button is returned to its normal state.

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@Dotify71, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 54 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: c04af8fb-1838-4a0b-8c7a-f8cbf0346664

📥 Commits

Reviewing files that changed from the base of the PR and between c045934 and 3b56f96.

📒 Files selected for processing (1)
  • src/context/AppContext.jsx

Walkthrough

AppContext now exposes a refreshRateLimit action that re-fetches GitHub quota data. SettingsPage consumes that action and turns the API quota icon into a guarded refresh button with loading and error feedback.

Changes

API Quota Refresh Feature

Layer / File(s) Summary
refreshRateLimit callback in AppContext
src/context/AppContext.jsx
Imports fetchRateLimit, defines refreshRateLimit with useCallback, updates rateLimit when a value is returned, and exposes the callback through the context value.
Refresh button in SettingsPage
src/pages/SettingsPage.jsx
Reads refreshRateLimit from useApp, adds isRefreshing, and replaces the static API quota icon with a click-guarded async button that rotates during refresh and shows error state.

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

Possibly related PRs

Suggested labels: Typescript Lang

Suggested reviewers: bhavik-mangla

Poem

🐇 I tapped the hare-speed dial,
And quota spun with a smile.
One click, then a twirl,
The refresh icon did whirl —
Now the API wakes in style.

🚥 Pre-merge checks | ✅ 4
✅ 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 clearly and concisely describes the main change: wiring up the API quota refresh button.
Linked Issues check ✅ Passed The changes implement #78 by exposing refreshRateLimit and wiring the SettingsPage refresh control to call it, with optional loading animation.
Out of Scope Changes check ✅ Passed The PR appears scoped to the API Quota refresh fix and related UX/accessibility updates, with no unrelated code changes shown.
✨ 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 frontend Frontend changes javascript JavaScript/TypeScript changes size/S 11-50 lines changed first-time-contributor First time contributor and removed size/S 11-50 lines changed labels Jun 15, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@src/pages/SettingsPage.jsx`:
- Around line 208-218: The refresh icon (FiRefreshCw) is implemented as a
clickable element that lacks proper keyboard accessibility, preventing
keyboard-only users from accessing the refresh functionality. Replace the icon
with a semantic HTML button element that wraps the FiRefreshCw icon, moving the
onClick handler with the isRefreshing check, setIsRefreshing state management,
and refreshRateLimit call to the button element. This ensures the control is
properly focusable via keyboard and operable with Enter/Space keys while
maintaining the visual styling and rotation animation behavior.
🪄 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: ASSERTIVE

Plan: Pro

Run ID: 80562388-23b1-40f5-85b8-e7c4e8fe5cd5

📥 Commits

Reviewing files that changed from the base of the PR and between 46c5c95 and 0cbd3b8.

📒 Files selected for processing (2)
  • src/context/AppContext.jsx
  • src/pages/SettingsPage.jsx

Comment thread src/pages/SettingsPage.jsx Outdated
@Dotify71

Copy link
Copy Markdown
Contributor Author

@coderabbitai Great catch on accessibility! I have updated the code to wrap the FiRefreshCw icon inside a proper semantic HTML <button> element with an aria-label to ensure full keyboard focusability and operability for all users.

@github-actions github-actions Bot added size/S 11-50 lines changed and removed size/S 11-50 lines changed labels Jun 15, 2026
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

@Dotify71 That's a great improvement! Using a semantic <button> element ensures native keyboard focusability (Tab key navigation), proper Enter/Space key activation, and correct announcement by screen readers — far better than a styled <div> or bare icon with a cursor pointer. The aria-label addition is the perfect complement to convey the button's purpose to assistive technology users. Well done! 🎉

(◕‿◕✿) 🐇


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

@github-actions github-actions Bot added size/S 11-50 lines changed and removed size/S 11-50 lines changed labels Jun 15, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
src/pages/SettingsPage.jsx (1)

210-215: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Ensure isRefreshing is always reset on refresh failure.

If refreshRateLimit() throws (Line 213), the reset path at Line 214 is skipped, leaving isRefreshing stuck true and effectively disabling future refresh attempts.

Proposed fix
                 onClick={async () => {
-                  if (isRefreshing) return;
-                  setIsRefreshing(true);
-                  await refreshRateLimit();
-                  setTimeout(() => setIsRefreshing(false), 500); // Minimum spin duration for visual feedback
+                  if (isRefreshing) return
+                  setIsRefreshing(true)
+                  try {
+                    await refreshRateLimit()
+                  } finally {
+                    setTimeout(() => setIsRefreshing(false), 500) // Minimum spin duration for visual feedback
+                  }
                 }}
🤖 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 `@src/pages/SettingsPage.jsx` around lines 210 - 215, The onClick handler for
the refresh button does not handle failures in the refreshRateLimit() call,
which means if refreshRateLimit() throws an error, the setTimeout that resets
isRefreshing to false will never execute, leaving the state stuck at true and
preventing future refresh attempts. Wrap the await refreshRateLimit() call in a
try-catch block (or use a finally block) to ensure that setIsRefreshing(false)
is always called to reset the loading state, regardless of whether the refresh
succeeds or fails.
🤖 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.

Duplicate comments:
In `@src/pages/SettingsPage.jsx`:
- Around line 210-215: The onClick handler for the refresh button does not
handle failures in the refreshRateLimit() call, which means if
refreshRateLimit() throws an error, the setTimeout that resets isRefreshing to
false will never execute, leaving the state stuck at true and preventing future
refresh attempts. Wrap the await refreshRateLimit() call in a try-catch block
(or use a finally block) to ensure that setIsRefreshing(false) is always called
to reset the loading state, regardless of whether the refresh succeeds or fails.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: f7f99aec-66e9-4d22-8465-96b7bacfbc07

📥 Commits

Reviewing files that changed from the base of the PR and between 0cbd3b8 and 73c7243.

📒 Files selected for processing (1)
  • src/pages/SettingsPage.jsx

@Dotify71

Copy link
Copy Markdown
Contributor Author

@coderabbitai Nice catch on the missing error handling! I've wrapped the await refreshRateLimit() call in a try...finally block to ensure the isRefreshing state is always safely reset, preventing the button from becoming permanently disabled if a network error occurs.

@github-actions github-actions Bot added size/S 11-50 lines changed and removed size/S 11-50 lines changed labels Jun 15, 2026
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

@Dotify71 That's exactly the right pattern! Using try...finally guarantees that isRefreshing is reset to false whether the refresh succeeds, fails, or throws — preventing the button from becoming permanently stuck in a disabled/spinning state after a network error or unexpected exception. Solid defensive programming! 🎉

(✿◠‿◠) 🐇

@Dotify71

Copy link
Copy Markdown
Contributor Author

Hi @Zahnentferner, I've finished implementing this fix and addressing the automated review feedback. All CI checks are passing green and CodeRabbit has approved the changes.

Could you please take a look when you have a free moment? Let me know if you'd like any further adjustments! Thanks.

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

⚠️ This PR has merge conflicts.

Please resolve the merge conflicts before review.

Your PR will only be reviewed by a maintainer after all conflicts have been resolved.

📺 Watch this video to understand why conflicts occur and how to resolve them:
https://www.youtube.com/watch?v=Sqsz1-o7nXk

@rahul-vyas-dev rahul-vyas-dev reopened this Jul 2, 2026
@github-actions github-actions Bot added size/S 11-50 lines changed and removed size/S 11-50 lines changed labels Jul 2, 2026
@rahul-vyas-dev

Copy link
Copy Markdown
Contributor

@Dotify71 Please resolve the merge conflicts, so that I can review and merge your PR.

@github-actions github-actions Bot added size/S 11-50 lines changed and removed size/S 11-50 lines changed labels Jul 2, 2026
@Dotify71

Dotify71 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

@rahul-vyas-dev Resolved the conflicts

@rahul-vyas-dev

Copy link
Copy Markdown
Contributor

@Dotify71 share any visual, If you can.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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 `@src/context/AppContext.jsx`:
- Around line 63-66: `refreshRateLimit` in `AppContext` currently swallows
`fetchRateLimit` failures because `fetchRateLimit(pat)` returns `null` and the
callback just no-ops. Update `fetchRateLimit` and `refreshRateLimit` to
propagate failure explicitly, either by returning a success boolean/nullable
result that callers can inspect or by rejecting on error, and then adjust
`SettingsPage` to consume that result and show a brief error indicator instead
of silently finishing the refresh.

In `@src/pages/SettingsPage.jsx`:
- Around line 211-241: The refresh quota button in SettingsPage needs two
follow-ups: add a disabled state tied to isRefreshing on the button so it is not
focusable/announced as interactive during an in-flight refresh, and replace the
hardcoded hover:bg-zinc-800 styling with the same CSS-variable-based hover
pattern used by the sibling icon button in this file. Update the button block
around the onClick handler and FiRefreshCw usage to keep the existing
guard/try-finally behavior while aligning accessibility and theming.
🪄 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: ASSERTIVE

Plan: Pro

Run ID: 6ab7f6ef-5d85-4056-83b4-c103872b6e16

📥 Commits

Reviewing files that changed from the base of the PR and between 73c7243 and 1e6a4ff.

📒 Files selected for processing (2)
  • src/context/AppContext.jsx
  • src/pages/SettingsPage.jsx

Comment thread src/pages/SettingsPage.jsx
@github-actions github-actions Bot added size/M 51-200 lines changed and removed size/S 11-50 lines changed labels Jul 2, 2026
@Dotify71

Dotify71 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

@rahul-vyas-dev I tried to on this but unfortunately it shows white screen before it turned on properly but this time i don't know whats the matter i have seen results by my own this code is correct

@rahul-vyas-dev

Copy link
Copy Markdown
Contributor

@rahul-vyas-dev I tried to on this but unfortunately it shows white screen before it turned on properly but this time i don't know whats the matter i have seen results by my own this code is correct

Check this and try to fix the bug, and even after this if you face the problem then let us know, and make sure to share any ss or screen recording to know about the bug or working code.

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

⚠️ This PR has merge conflicts.

Please resolve the merge conflicts before review.

Your PR will only be reviewed by a maintainer after all conflicts have been resolved.

📺 Watch this video to understand why conflicts occur and how to resolve them:
https://www.youtube.com/watch?v=Sqsz1-o7nXk

@rahul-vyas-dev

Copy link
Copy Markdown
Contributor

@Dotify71 are you available to solve the conflicts? If not, then I need to close the PR and if yes then solve and share visuals of working code.

@Dotify71

Dotify71 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

Ok i will add the visuals before the morning

@github-actions github-actions Bot added size/M 51-200 lines changed and removed PR has merge conflicts size/M 51-200 lines changed labels Jul 3, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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 `@src/context/AppContext.jsx`:
- Around line 62-69: The manual quota refresh path in refreshRateLimit updates
state but does not persist the new value, unlike the rate-limit-update event
handler. Update refreshRateLimit in AppContext to also write the fetched rl into
localStorage with the same oe_rate_limit key whenever fetchRateLimit(pat)
succeeds, keeping the cached value in sync with setRateLimit and
getStoredRateLimit.
- Around line 187-192: The Ctx.Provider value in AppContext is created inline,
so every AppProvider render produces a new object reference and re-renders all
useApp() consumers. Memoize the provider value in AppContext (for example around
the value passed to Ctx.Provider) and include the referenced state/actions such
as pat, savePat, orgs, model, issuesData, rateLimit, loading, loadMsg,
govLoading, error, totalRepo, explore, runAudit, setError, refreshRateLimit, and
staleRepoStats so the object identity stays stable unless one of those inputs
changes.
🪄 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: ASSERTIVE

Plan: Pro

Run ID: 832ee8f5-9298-4b20-a8e8-ad13c0c797c1

📥 Commits

Reviewing files that changed from the base of the PR and between 1e6a4ff and c045934.

📒 Files selected for processing (2)
  • src/context/AppContext.jsx
  • src/pages/SettingsPage.jsx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 2

🤖 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 `@src/context/AppContext.jsx`:
- Around line 62-69: The manual quota refresh path in refreshRateLimit updates
state but does not persist the new value, unlike the rate-limit-update event
handler. Update refreshRateLimit in AppContext to also write the fetched rl into
localStorage with the same oe_rate_limit key whenever fetchRateLimit(pat)
succeeds, keeping the cached value in sync with setRateLimit and
getStoredRateLimit.
- Around line 187-192: The Ctx.Provider value in AppContext is created inline,
so every AppProvider render produces a new object reference and re-renders all
useApp() consumers. Memoize the provider value in AppContext (for example around
the value passed to Ctx.Provider) and include the referenced state/actions such
as pat, savePat, orgs, model, issuesData, rateLimit, loading, loadMsg,
govLoading, error, totalRepo, explore, runAudit, setError, refreshRateLimit, and
staleRepoStats so the object identity stays stable unless one of those inputs
changes.
🪄 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: ASSERTIVE

Plan: Pro

Run ID: 832ee8f5-9298-4b20-a8e8-ad13c0c797c1

📥 Commits

Reviewing files that changed from the base of the PR and between 1e6a4ff and c045934.

📒 Files selected for processing (2)
  • src/context/AppContext.jsx
  • src/pages/SettingsPage.jsx
🛑 Comments failed to post (2)
src/context/AppContext.jsx (2)

62-69: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Manual refresh doesn't persist to localStorage, unlike the event-driven update path.

The previous silent-failure issue is now correctly resolved via the boolean return. However, refreshRateLimit only calls setRateLimit(rl) on success, while the rate-limit-update event handler (lines 40-42) additionally persists the value with localStorage.setItem('oe_rate_limit', ...). If a user manually refreshes quota and then reloads the page shortly after, getStoredRateLimit() will read a stale/old cached value instead of the freshly fetched one, since the manual refresh never updated oe_rate_limit.

♻️ Suggested fix
 const refreshRateLimit = useCallback(async () => {
   const rl = await fetchRateLimit(pat)
   if (rl) {
     setRateLimit(rl)
+    localStorage.setItem('oe_rate_limit', JSON.stringify(rl))
     return true
   }
   return false
 }, [pat])
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

  const refreshRateLimit = useCallback(async () => {
    const rl = await fetchRateLimit(pat)
    if (rl) {
      setRateLimit(rl)
      localStorage.setItem('oe_rate_limit', JSON.stringify(rl))
      return true
    }
    return false
  }, [pat])
🧰 Tools
🪛 ast-grep (0.44.0)

[warning] 64-64: Avoid using the initial state variable in setState
Context: setRateLimit(rl)
Note: [CWE-710] Improper Adherence to Coding Standards. Security best practice.

(setstate-same-var)

🤖 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 `@src/context/AppContext.jsx` around lines 62 - 69, The manual quota refresh
path in refreshRateLimit updates state but does not persist the new value,
unlike the rate-limit-update event handler. Update refreshRateLimit in
AppContext to also write the fetched rl into localStorage with the same
oe_rate_limit key whenever fetchRateLimit(pat) succeeds, keeping the cached
value in sync with setRateLimit and getStoredRateLimit.

187-192: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Context value is rebuilt on every render, forcing all consumers to re-render.

Flagged by static analysis (React Doctor): the Ctx.Provider value object is constructed inline, so every AppProvider re-render (e.g. from issuesData, loading, or govLoading changes) produces a brand-new object reference and re-renders every useApp() consumer, regardless of which slice of state they actually use.

♻️ Suggested fix
+  const contextValue = useMemo(() => ({
+    pat, savePat, orgs, model, issuesData,
+    rateLimit, loading, loadMsg, govLoading, error, totalRepo,
+    explore, runAudit, setError, refreshRateLimit, staleRepoStats,
+  }), [pat, savePat, orgs, model, issuesData, rateLimit, loading, loadMsg, govLoading, error, totalRepo, explore, runAudit, refreshRateLimit, staleRepoStats])
+
   return (
-    <Ctx.Provider value={{
-      pat, savePat, orgs, model, issuesData,
-      rateLimit, loading, loadMsg, govLoading, error, totalRepo,
-      explore, runAudit, setError, refreshRateLimit, staleRepoStats,
-    }}>
+    <Ctx.Provider value={contextValue}>
       {children}
     </Ctx.Provider>
   )

As per coding guidelines, "The code adheres to best practices associated with React."

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

  const contextValue = useMemo(() => ({
    pat, savePat, orgs, model, issuesData,
    rateLimit, loading, loadMsg, govLoading, error, totalRepo,
    explore, runAudit, setError, refreshRateLimit, staleRepoStats,
  }), [pat, savePat, orgs, model, issuesData, rateLimit, loading, loadMsg, govLoading, error, totalRepo, explore, runAudit, setError, refreshRateLimit, staleRepoStats])

  return (
    <Ctx.Provider value={contextValue}>
      {children}
    </Ctx.Provider>
  )
🧰 Tools
🪛 React Doctor (0.5.8)

[warning] 188-188: Every reader of this context redraws on each render because you build its value inline.

Wrap the context value in useMemo or move it outside the component so consumers do not redraw every render.

(jsx-no-constructed-context-values)

🤖 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 `@src/context/AppContext.jsx` around lines 187 - 192, The Ctx.Provider value in
AppContext is created inline, so every AppProvider render produces a new object
reference and re-renders all useApp() consumers. Memoize the provider value in
AppContext (for example around the value passed to Ctx.Provider) and include the
referenced state/actions such as pat, savePat, orgs, model, issuesData,
rateLimit, loading, loadMsg, govLoading, error, totalRepo, explore, runAudit,
setError, refreshRateLimit, and staleRepoStats so the object identity stays
stable unless one of those inputs changes.

Sources: Coding guidelines, Linters/SAST tools

@github-actions github-actions Bot added size/M 51-200 lines changed and removed size/M 51-200 lines changed labels Jul 3, 2026
@Dotify71

Dotify71 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author
Screen.Recording.2026-07-03.at.10.18.27.PM.mov

hey @rahul-vyas-dev here is the visuals if anything else is needed just tell me i will do it.

@rahul-vyas-dev rahul-vyas-dev merged commit d904719 into AOSSIE-Org:main Jul 3, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

first-time-contributor First time contributor frontend Frontend changes javascript JavaScript/TypeScript changes size/M 51-200 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: "API Quota" refresh button in Settings is unresponsive (missing onClick handler)

2 participants