Feat refactorimproveperformance#83
Closed
dawiisss wants to merge 13 commits into
Closed
Conversation
Replaced native scrollbar on the sidebar with better looking scrollbar.
Merge main to dev.
CI/Build Fixes
…rrors - Redesigned the System Metrics tab into theme-aligned visual cards monitoring CPU, RAM, Disk I/O, Network speeds, GPU, and Battery status. - Added self-monitoring of Vet's own CPU and memory (RSS) footprint. - Implemented smooth progress transitions (1.8s cubic-bezier) synchronized with the 2s polling interval to achieve fluid, continuous animations. - Filtered out virtual filesystems (e.g. efivarfs, tmpfs) and deduplicated redundant mount points sharing physical block devices (e.g., Btrfs subvolumes). - Resolved pre-existing TypeScript strict compiler errors: - Imported missing `shell` module from electron in `src/main/index.ts`. - Added safe fallbacks for `win.getSize()` array destructuring. - Declared full type signature for the metrics update payload in renderer. - Automatically applied custom scrollbar styling to panel body lists. - Updated `sysinfo.test.ts` to mock new systeminformation calls and include comprehensive payload assertions.
…rrors - Redesigned the System Metrics tab into theme-aligned visual cards monitoring CPU, RAM, Disk I/O, Network speeds, GPU, and Battery status. - Added self-monitoring of Vet's own CPU and memory (RSS) footprint. - Implemented smooth progress transitions (1.8s cubic-bezier) synchronized with the 2s polling interval to achieve fluid, continuous animations. - Filtered out virtual filesystems (e.g. efivarfs, tmpfs) and deduplicated redundant mount points sharing physical block devices (e.g., Btrfs subvolumes). - Resolved pre-existing TypeScript strict compiler errors: - Imported missing `shell` module from electron in `src/main/index.ts`. - Added safe fallbacks for `win.getSize()` array destructuring. - Declared full type signature for the metrics update payload in renderer. - Automatically applied custom scrollbar styling to panel body lists. - Updated `sysinfo.test.ts` to mock new systeminformation calls and include comprehensive payload assertions.
…ithub.com:dawiisss/vet into feat-codeimprovementsandsystemmetricsimprovements
feat: Introducted better looking scrollbar on sidebar componets
…tricsimprovements feat(sysinfo): expand system metrics dashboard and resolve compiler e…
… triggers Refactored system metrics, database operations, and adblocker loading to maximize performance and resolve race conditions and CSS issues: - database: Enabled PRAGMA synchronous = NORMAL in historyDb.ts under WAL mode for optimized disk write throughput. - database: Added secondary sort keys (s.id DESC / id ASC) to SQLite history queries to guarantee deterministic sorting. - sysinfo: Split metrics polling into fast-changing metrics (CPU, RAM, network, IO, temp; every 2s) and slow-changing/static metrics (disks, battery, GPU; every 10s) to reduce CPU cycles and battery consumption. - adblocker: Simplified blocker list config to use Ghostery's fullLists exclusively, removing duplicate lists (AdGuard, Fanboy) to save memory, download time, and parsing latency. - titlebar: Moved base styles from React inline styles in TitleBar.tsx into global.css classes, resolving a specificity conflict that prevented the button hover animations from displaying. - onboarding: Checked isInitialized before evaluating showIntroOnStartup in App.tsx, resolving a race condition where the welcome modal opened before persisted configuration loaded from disk. - docs: Updated CHANGELOG.md and walkthrough.md to document optimizations.
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.
Description
Added
node:sqlite(DatabaseSync) withbetter-sqlite3for the history database, providing ~5-10x faster synchronous SQLite operations and significantly reduced main thread blocking.synchronous = NORMAL): Addeddb.pragma("synchronous = NORMAL")to database initialization to bypass immediate disk synchronization under WAL mode, dramatically optimizing write speeds.INSERT INTO sessions,INSERT INTO session_chunks,INSERT INTO session_search,UPDATE sessions SET closed_at) are now prepared once at init and reused, eliminating per-call prepare overhead.cleanupHistoryDb()now checkpoints the WAL before closing, ensuring a clean.dbfile on exit.expandHomeutility: Proper~and~userpath expansion for workspace file operations, replacing fragile regex-based tilde expansion.logSensitivePathAccessfunction: Replaces the previously-unconditionalisPathAllowed()(which always returnedtrue) with a function that resolves and logs access to sensitive paths (.ssh,.gnupg,.aws, vet config) while still allowing full filesystem access..agents/and.Jules/in.gitignore: Added per project's own convention.Fixed
__redacted__passwords now have the key deleted rather than set to"", preventing accidental credential loss.connectionTargetoff-by-one:args.indexOf("-it")returning-1causedargs[0]to be used as the container name. Now correctly handles missing-itflag.useConfigStorerace condition:isInitializedwas set totruesynchronously beforeconfigApi.get()resolved. Moved into the.then()callback so the state reflects actual initialization.blockedCountsandlastHostnameMaps now clean up on webviewdestroyedevent instead of growing indefinitely.%and_characters in search queries are now escaped, and theESCAPE '\\'clause is explicitly specified.structuredCloneinstead ofJSON.parse(JSON.stringify(...)): Config deep cloning now usesstructuredClone()instead of the lossy, slow JSON round-trip.process.envspread dropsundefinedvalues: Replaced unsafe{ ...process.env } as Record<string, string>withObject.fromEntries(Object.entries(process.env).filter(...))to correctly handleundefinedenv values.mainWindownull bug:mainWindow = createWindow(isTransparent)is now called beforeinitConfigManager(mainWindow), fixing a null pointer crash in the main process startup flow.backgroundandcolorstyles inTitleBar.tsxoverrode the hover styles inglobal.css(caused by the removal of!importantflags in version1.0.7), by moving base backgrounds and colors directly to CSS classes.isInitializedstate before evaluatingshowIntroOnStartup.adblocker.ts.historyDb.tsto include secondary sort keys (s.id DESC/id ASC) to ensure consistent sorting order and prevent test non-determinism.adblocker.ts,sysinfo.ts,index.ts, andsplitActions.ts.console.log("[adblocker] cosmetic filter for", url)that fired on every cosmetic filter application.install.shversion mismatch:FALLBACK_VERSIONupdated from1.0.6to1.0.7to matchpackage.json.EventEmitter.defaultMaxListenerscomment: Added documentation explaining why the global override exists and that per-emitter limits are preferred.mainIndex.test.ts: Updated mocks forelectron(addedshell),fs,json5, and fixedinitAdblockerassertion for lazy-loading change.sysinfo.test.ts: Added mocks for../main/pty(getPtyPids) andapp.getAppMetricsto prevent ESMuuidimport failure.db.transaction()for atomicity.Changed
DirectoryIteminterface: Replacedany[]with a typedDirectoryIteminterface in workspace directory listings.flushBuffertransaction: ManualBEGIN TRANSACTION/COMMIT/ROLLBACKreplaced withbetter-sqlite3'sdb.transaction()for automatic rollback on errors.db.exec("PRAGMA ...")calls replaced withdb.pragma()(better-sqlite3 idiomatic API;getLogicalDatabaseSizeMbnow uses{ simple: true }for direct number returns).web-contents-created:wcIdis now captured outside the navigation handler so it's available in thedestroyedcleanup listener.@ghostery/adblocker-electron's consolidatedfullListsCDN asset, optimizing memory, parsing speed, and network usage.sysinfo.tshas been optimized. Fast-changing metrics (CPU, memory, network, disk IO, temperature) continue to poll every 2s, while slow-changing/static metrics (mounted disks size, battery, graphics info) are cached and queried only once every 10s, reducing system call and subprocess spawn CPU overhead.Type of Change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.
npm run testor specific test files run)Test Environment:
Screenshots / Screen Recordings (if applicable)
Please attach any relevant screenshots or screen recordings showing visual/UI changes or behaviors.
Checklist