Skip to content

fix(web): make approval requests appear without page reload (#996) - #1073

Merged
zmanian merged 2 commits into
nearai:stagingfrom
G7CNF:codex/issue-996-approval-realtime
Mar 12, 2026
Merged

zmanian merged 2 commits into
nearai:stagingfrom
G7CNF:codex/issue-996-approval-realtime

Conversation

@G7CNF

@G7CNF G7CNF commented Mar 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • handle approval_needed events even when thread_id is absent (show approval card immediately)
  • for background-thread approvals, update unread counts and refresh thread list instead of dropping the event silently
  • refresh Extensions tab on approval events so setup state updates in real time
  • dedupe approval cards by request_id to avoid duplicates on reconnect/history refresh

Why

Issue #996 reports users needing to reload before approval UI appears. The frontend previously dropped approval_needed when thread_id was missing/mismatched, and did not refresh Extensions state on approval events.

Validation

  • manual code-path review of SSE approval flow and history fallback

Closes #996

@github-actions github-actions Bot added the scope: channel/web Web gateway channel label Mar 12, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses an issue where users had to manually reload the page for approval UI to appear. It enhances the frontend's handling of approval_needed events by ensuring immediate display of approval cards, proper updates for background thread approvals, and real-time state synchronization for the Extensions tab. Additionally, it prevents duplicate approval cards, leading to a more responsive and consistent user experience.

Highlights

  • Real-time Approval Display: Modified the approval_needed event handler to display approval cards immediately, even when a thread_id is not present in the event data.
  • Background Thread Approvals: Implemented logic to update unread counts and refresh the thread list when approval requests are received for background threads, preventing silent drops of these events.
  • Extensions Tab Refresh: Ensured the Extensions tab is refreshed upon receiving approval events, allowing setup states to update in real-time.
  • Duplicate Approval Card Prevention: Added a mechanism to deduplicate approval cards based on their request_id, avoiding redundant displays on reconnects or history refreshes.
Changelog
  • src/channels/web/static/app.js
    • Updated the approval_needed event listener to handle cases where thread_id is absent or refers to a background thread, triggering unread count updates and thread list refreshes.
    • Added a call to loadExtensions() within the approval_needed event listener to refresh the Extensions tab when an approval event occurs.
    • Modified the showApproval function to check for existing approval cards using data.request_id and prevent duplicates from being added to the DOM.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@github-actions github-actions Bot added size: S 10-49 changed lines risk: medium Business logic, config, or moderate-risk modules contributor: regular 2-5 merged PRs labels Mar 12, 2026

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request effectively addresses the issue of approval requests not appearing without a page reload. The changes correctly handle approval_needed events, including those without a thread_id and for background threads, and also refresh relevant UI components. The addition of deduplication for approval cards is a good improvement to prevent duplicates on UI refreshes. I have one suggestion to improve the robustness of the deduplication logic.

Comment thread src/channels/web/static/app.js Outdated
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@zmanian
zmanian merged commit e522d33 into nearai:staging Mar 12, 2026
15 checks passed
@G7CNF
G7CNF deleted the codex/issue-996-approval-realtime branch March 15, 2026 14:31
bkutasi pushed a commit to bkutasi/ironclaw that referenced this pull request Mar 28, 2026
…) (nearai#1073)

* fix(web): show approval requests in realtime without reload

* Update src/channels/web/static/app.js

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
drchirag1991 pushed a commit to drchirag1991/ironclaw that referenced this pull request Apr 8, 2026
…) (nearai#1073)

* fix(web): show approval requests in realtime without reload

* Update src/channels/web/static/app.js

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor: regular 2-5 merged PRs risk: medium Business logic, config, or moderate-risk modules scope: channel/web Web gateway channel size: S 10-49 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tool approval modal requires page reload to appear

3 participants