Skip to content

Commit 79d75b3

Browse files
committed
docs: update GEMINI.md and README.md [skip ci]
1 parent 4002c8c commit 79d75b3

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

GEMINI.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
Electron desktop app. Automate TDCC e-Voting. Login with ID. Find pending/voted company. Vote agree/against/abstain. Take screenshot proof. Logout safe. **Runs in background/unfocused. Notify user on completion/error.**
55

66
### Architecture
7-
- **Main (`main.js`)**: Manage window. Set `BrowserView`. Handle IPC. **Trigger system notifications when window unfocused.**
7+
- **Main (`main.js`)**: Manage window. Set `BrowserView` for automation. Handle IPC. **Trigger system notifications when window unfocused.**
88
- **Preload (`preload.js`)**: Secure bridge renderer ↔ main (`contextBridge`).
99
- **Renderer (`src/renderer/`)**: UI. HTML, Vanilla CSS, JS. No big framework.
10-
- **Auto Engine (`src/automation/`)**: Interact with TDCC.
10+
- **Auto Engine (`src/automation/`)**: Interact with TDCC via `webContents.executeJavaScript`.
1111
- `main_flow.js`: Control flow. Clear session. Respect TDCC maintenance time (00:00 - 07:00 UTC+8).
1212
- `login.js`: Auto login. Select cert. Handle native dialogs.
1313
- `voting.js`: Scrape target companies. Navigate vote form. Submit vote.
1414
- `screenshot.js`: Capture full-page proof. Save local.
1515
- `logout.js`: Find logout button. Click confirm. End session.
16-
- `utils.js`: Reusable tools. `delay`, `randomDelay`, `safeExecute` (timeout prevent hang), `waitForNavigation`.
16+
- `utils.js`: Reusable tools. `delay`, `randomDelay`, `safeExecute` (timeout prevent hang), `waitForNavigation`, `isMaintenanceTime`, `isScreenshotExists`, `calculateProgress`.
1717

1818
## Run App
1919
Use Node + Electron.
@@ -23,7 +23,8 @@ Use Node + Electron.
2323
## Dev Rules
2424
- **Clean + Mod**: Small helper functions. JSDoc them.
2525
- **Variables**: `const` mostly. `let` only if mutate.
26-
- **Early Return**: Avoid deep `if/else`. Bail early if DOM missing.
26+
- **Early Return**: Avoid deep `if/else`. Favor early return to reduce nesting. Bail early if DOM missing.
27+
- **Surgical Changes**: Do not touch unrelated code or perform unrelated refactoring when adding new features.
2728
- **Fast**: No long fixed `delay()`. Use `waitForNavigation`, `safeExecute`, active polling. `some()`, `find()` for text match.
2829
- **Module**: CommonJS (`require`/`module.exports`).
2930
- **DOM**: Execute via `webContents.executeJavaScript`.
@@ -33,7 +34,7 @@ Use Node + Electron.
3334
- **No Crash**: `try/catch` automation steps. `sendLog` error to UI. Move to next account.
3435
- **Config**: Put URL in `src/constants.js`.
3536
- **UI**: Vanilla JS/CSS. No Tailwind.
36-
- **Style**: ESLint enforce `comma-dangle` object multiline.
37+
- **Style**: ESLint enforce `comma-dangle` object multiline (`"objects": "always-multiline"`).
3738

3839
## Use
3940
AI read this. Keep auto engine robust. DOM parsing break if site change. Time async careful.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
**✅ 智慧補截圖**:偵測儲存目錄,僅針對「已投票但缺截圖」的公司進行補圖,不重複作業。
1616
**✅ 多帳號處理**:允許多個身分證字號,依次完成「登入、投票截圖、登出」完整循環。
1717
**✅ 可背景執行**:支援背景執行與視窗最小化,任務完成或異常時發送系統通知。
18+
**✅ 檢查最新版**:自動檢查最新版本並提示使用者更新,不錯過任何新功能!
1819

1920
## ⚠️ 使用前準備 (重要)
2021

0 commit comments

Comments
 (0)