HR-ATS-Portal/frontend
Talha Ahmed db0652ab24 Inbox: serve the queue from cache instead of re-skeletoning every visit
Opening the Recruitment Inbox showed skeleton placeholders every time, and
on the combined All channel it showed them stacked ABOVE rows that had
already arrived — the channel ORs its two sources' pending flags together,
so the email rows sat under placeholders while the sheet fetch finished.

The queue is a local table, not a live feed. Rows only appear when the Sync
worker writes them, and that path already invalidates qk.mailbox.all(). So
refetching on every visit bought nothing and cost a full-width skeleton each
time — worse on the All channel, which fetches BOTH sources unpaged and so
re-downloaded thousands of rows to render ten.

  - LIST_CACHE / COUNT_CACHE: 10 min staleTime, 1 h gcTime, keepPreviousData.
    A revisit inside the window paints rows immediately and issues no request.
  - Placeholders now mean "nothing to show yet": gated on the list being
    empty. A refetch over live rows is a 2px bar and the word "Updating…",
    with the rows readable and clickable throughout.
  - "Updated 4 min ago" + a Refresh button under the search box, because a
    cached list that never admits its age reads as a broken list. Refresh
    re-reads the DB; Sync pulls new mail from Outlook. Both tooltips now say
    which is which — two circular arrows were indistinguishable.
  - Search debounced to 300ms. Each keystroke used to mint a query key, a
    request and a skeleton, so the list strobed while you typed.
  - resume_text dropped from the list row mapping. serialize_application
    ships the whole extracted CV on every row and the queue renders none of
    it; caching a thousand of them for an hour is not a trade worth making.
    The detail query fetches it for the one row actually open.

Trade-off: a sync run started elsewhere is now invisible here for up to ten
minutes. The age label and the Refresh button are the deliberate mitigation.

inbox-loading.test.mjs pins all of it, driving hand-gated fetches so the
frames a fast API flashes past become assertable: both sources pending, one
source home, and a second visit served from cache. Reverting the placeholder
rule reproduces the original defect as "skeleton=true rows=2". Wired into
npm run verify; needed a mountRoute export on the smoke harness, since
renderRoute tears the tree down before those intermediate frames can be read.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 16:39:55 +05:00
..
.vite/deps update 2026-08-12 13:57:53 +05:00
dist add history 2026-09-02 15:33:20 +05:00
node_modules Mobile responsiveness: fix grid blowouts, calendar clipping, wrapping controls; add viewport test 2026-09-02 15:18:47 +05:00
src Inbox: serve the queue from cache instead of re-skeletoning every visit 2026-09-03 16:39:55 +05:00
.dockerignore push the scoring connect 2026-08-17 14:31:30 +05:00
.env.development Remove `.env.example` and update Docker configurations for environment management 2026-08-24 20:38:15 +05:00
.env.production REACTJS STACK WITH RBAC TESTED 2026-08-05 17:41:46 +05:00
Dockerfile Update Docker and API configurations for improved job fetching and API proxying 2026-08-20 18:55:49 +05:00
inbox-loading.test.mjs Inbox: serve the queue from cache instead of re-skeletoning every visit 2026-09-03 16:39:55 +05:00
index.html Typography overhaul: Inter Tight display headings, Belleza confined to wordmark 2026-08-27 11:31:19 +05:00
mobile.test.mjs Post-merge: Progress screen mobile fixes, register Progress in smoke harness 2026-09-02 15:32:23 +05:00
nginx.conf Add Progress bar 2026-09-02 13:33:11 +05:00
package-lock.json Brand-styled XLSX exports across Inbox, Candidates and Talent Pool 2026-09-02 20:40:43 +05:00
package.json Inbox: serve the queue from cache instead of re-skeletoning every visit 2026-09-03 16:39:55 +05:00
smoke.test.mjs add history 2026-09-02 15:33:20 +05:00
theme.test.mjs theme updated 2026-08-19 19:34:16 +05:00
token.test.mjs REACTJS STACK WITH RBAC TESTED 2026-08-05 17:41:46 +05:00
vite.config.js . 2026-09-01 18:25:53 +05:00