Refactor Gemini model display: filter old versions, group low/high pкo, and improve naming (#114)

* Refactor Gemini model display: filter old versions, group low/high pro, and improve naming

* Fix potential negative minutes and refine Gemini 3 Pro grouping logic based on PR feedback

* The account change process has been sped up

* Address PR review: enhance error message and parameterize polling interval in process handler

* Address PR review: fix potential race condition in database backup logic

* fix: prevent renderer white screen and harden sentry gating

* feat:  localize model labels

* chore: enable hoisted node-linker

* chore: ignore .agent/.claude/.codex in prettier

---------

Co-authored-by: Draculabo <[email protected]>
This commit is contained in:
AngeloooooandDraculabo authored and GitHub committed 2026-02-19 19:37:30 +08:00
1 parent b9497648c6
commit 8ed4593f73
162 files changed
+2981 -2541

No files matched your search

@@ -13,7 +13,7 @@ tags: javascript, localStorage, storage, caching, performance
```typescript
function getTheme() {
return localStorage.getItem('theme') ?? 'light'
return localStorage.getItem('theme') ?? 'light';
}
// Called 10 times = 10 storage reads
```
@@ -21,18 +21,18 @@ function getTheme() {
**Correct (Map cache):**
```typescript
const storageCache = new Map<string, string | null>()
const storageCache = new Map<string, string | null>();
function getLocalStorage(key: string) {
if (!storageCache.has(key)) {
storageCache.set(key, localStorage.getItem(key))
storageCache.set(key, localStorage.getItem(key));
}
return storageCache.get(key)
return storageCache.get(key);
}
function setLocalStorage(key: string, value: string) {
localStorage.setItem(key, value)
storageCache.set(key, value) // keep cache in sync
localStorage.setItem(key, value);
storageCache.set(key, value); // keep cache in sync
}
```
@@ -41,15 +41,13 @@ Use a Map (not a hook) so it works everywhere: utilities, event handlers, not ju
**Cookie caching:**
```typescript
let cookieCache: Record<string, string> | null = null
let cookieCache: Record<string, string> | null = null;
function getCookie(name: string) {
if (!cookieCache) {
cookieCache = Object.fromEntries(
document.cookie.split('; ').map(c => c.split('='))
)
cookieCache = Object.fromEntries(document.cookie.split('; ').map((c) => c.split('=')));
}
return cookieCache[name]
return cookieCache[name];
}
```
@@ -59,12 +57,12 @@ If storage can change externally (another tab, server-set cookies), invalidate c
```typescript
window.addEventListener('storage', (e) => {
if (e.key) storageCache.delete(e.key)
})
if (e.key) storageCache.delete(e.key);
});
document.addEventListener('visibilitychange', () => {
if (document.visibilityState === 'visible') {
storageCache.clear()
storageCache.clear();
}
})
});
```