Skip to content

Commit f8ac17a

Browse files
committed
Update development guidelines and improve icon update logic
- Enhanced icon update logic to simplify handling of tab activation - Added cache check to skip events for removed queries in sync process
1 parent c933c6d commit f8ac17a

4 files changed

Lines changed: 12 additions & 6 deletions

File tree

.github/agents/copilot-instructions.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# tanstack-query-chrome-devtools-3 Development Guidelines
22

3-
Auto-generated from all feature plans. Last updated: 2026-03-28
3+
Auto-generated from all feature plans. Last updated: 2026-03-30
44

55
## Active Technologies
66
- TypeScript 5.9 (strict mode) + React 19, WXT 0.20, Tailwind CSS v4, lucide-react (for mutation status icons) (002-page-layout-placeholders)
@@ -40,6 +40,8 @@ Auto-generated from all feature plans. Last updated: 2026-03-28
4040
- N/A (no storage changes in this feature) (021-ui-layout-fixes)
4141
- TypeScript 5.9 (strict mode) + React 19, WXT (web extension framework), @tanstack/query-core (022-action-button-fetch-state)
4242
- N/A (in-memory state synced via message passing) (022-action-button-fetch-state)
43+
- TypeScript (strict mode) on React 19 + WXT + `@tanstack/query-core`, WXT, `lucide-react`, `highlight.js` (023-icon-stale-query-bugs)
44+
- N/A (ephemeral in-memory state + browser.storage.session for SW recovery) (023-icon-stale-query-bugs)
4345

4446
- TypeScript 5.9 (strict mode) + React 19, WXT 0.20, Tailwind CSS v4, highlight.js 11, lucide-react, @tanstack/query-core (001-setup-connection-message)
4547

@@ -59,9 +61,9 @@ npm test && npm run lint
5961
TypeScript 5.9 (strict mode): Follow standard conventions
6062

6163
## Recent Changes
64+
- 023-icon-stale-query-bugs: Added TypeScript (strict mode) on React 19 + WXT + `@tanstack/query-core`, WXT, `lucide-react`, `highlight.js`
6265
- 022-action-button-fetch-state: Added TypeScript 5.9 (strict mode) + React 19, WXT (web extension framework), @tanstack/query-core
6366
- 021-ui-layout-fixes: Added TypeScript (strict mode), React 19 + WXT (web extension framework), Tailwind CSS v4 (`@tailwindcss/vite`), `@tanstack/query-core`, `lucide-react`, `highlight.js`, `@tanstack/react-virtual` (to be removed)
64-
- 020-filter-relative-time: Added TypeScript (strict mode) + React 19.2 + React 19, @tanstack/react-virtual 3.13, WXT 0.20, Tailwind CSS v4
6567

6668

6769
<!-- MANUAL ADDITIONS START -->

entrypoints/background.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,7 @@ export default defineBackground(() => {
121121

122122
// === Service worker recovery: restore icon on tab switch ===
123123
browser.tabs.onActivated.addListener(({ tabId }) => {
124-
if (contentPorts.has(tabId)) {
125-
updateIcon(tabId, "colored");
126-
}
124+
updateIcon(tabId, snapshotCache.has(tabId) ? "colored" : "gray");
127125
});
128126

129127
// === Port connection handling ===

entrypoints/sync.content.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@ function startSync(client: NonNullable<Window["__TANSTACK_QUERY_CLIENT__"]>) {
126126
return;
127127
}
128128

129+
// Skip events for queries that have been removed from the cache
130+
// (e.g., observerRemoved firing after removeQueries was called)
131+
if (!queryCache.get(query.queryHash)) {
132+
return;
133+
}
134+
129135
// added, updated, observerAdded, observerRemoved all map to entry updates
130136
const changeType = type === "added" ? "added" : "updated";
131137
postChange({

specs

Submodule specs updated from 60b9c2e to a0ef25d

0 commit comments

Comments
 (0)