feat(integram-table): show AJAX spinner while waiting on the server (closes #2778)#2779
Merged
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: #2778
…loses #2778) Adds a PrimeIcons spinner as the first child of .integram-table-controls so it sits to the left of the refresh/filter/settings icons whenever the table is waiting for the server - record-count, filter, sort, grouping, paging. A pendingRequests counter is bumped in beginRequest()/endRequest() around both loadData() and fetchTotalCount(); updateAjaxSpinner() toggles the .active class on the spinner and renders "(N)" next to it when more than one request is in flight.
Collaborator
Author
Working session summaryDone. PR #2779 is updated, out of draft, and ready for review. Summary of what shipped:
No CI checks are configured for this branch. This summary was automatically extracted from the AI working session output. |
Collaborator
Author
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost: $5.878188📊 Context and tokens usage:Claude Opus 4.7: (2 sub-sessions)
Total: (2.1K new + 176.5K cache writes + 7.5M cache reads) input tokens, 41.0K output tokens, $5.878188 cost 🤖 Models used:
📎 Log file uploaded as Gist (3390KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
Collaborator
Author
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
This reverts commit 0caaf5c.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #2778. Adds an AJAX spinner inside
.integram-table-controlsso the user can see when the table is waiting on the server (record count, filter, sort, grouping, paging). The spinner is placed to the left of the existing refresh / filter / settings icons and shows a bracketed counter(N)when more than one request is in flight.Implementation
js/integram-table/01-core.js— newpendingRequestscounter on the instance, plus three helpers:beginRequest()/endRequest()— increment / decrement (clamped at 0) and callupdateAjaxSpinner().updateAjaxSpinner()— toggles.activeon.integram-table-ajax-spinnerand writes the counter text. Mutates only the spinner DOM, so concurrent requests never cause a full re-render of the table.loadData()is wrapped:beginRequest()before thetry,endRequest()infinally. That single wrap covers filters, sorting, grouping, scrolling, and refresh because they all flow throughloadData().js/integram-table/02-format-helpers.js—fetchTotalCount()is wrapped the same way so the record-count request also drives the spinner.js/integram-table/04-render-table.js— renders the spinner as the first child of.integram-table-controls, before the refresh icon, so it appears at the left of the toolbar. The element survives full re-renders because its initial.activeand counter text are derived frompendingRequests.css/integram-table.css—.integram-table-ajax-spinnerisdisplay: noneby default and switches toinline-flexwhen.activeis present. The counter uses a slightly smaller font and--md-primarycolor matching the rest of the toolbar.js/integram-table.js— auto-regenerated bybash build.sh(the bundle thatindex.phpactually loads).Test plan
Two standalone harnesses are shipped under
experiments/so the behavior can be reproduced without a full CRM server:experiments/test-issue-2778-ajax-spinner.html— four static scenarios (idle, 1 request, 3 requests, and a live+/-counter button) verifying the CSS rules and counter-text logic.experiments/test-issue-2778-integration.html— boots a realIntegramTableinstance with a mockedwindow.fetch(1.2 s delay), exposes buttons to fireloadData(),fetchTotalCount(), and both concurrently.Manual verification with Playwright on the integration harness:
(3).loadData()andfetchTotalCount()both drive the spinner.Screenshots
1 pending request — spinner only, no counter:
3 pending requests — spinner with
(3)counter, to the left of the other icons:All four states from the standalone harness (idle / 1 / 3 / live):