Skip to content

Commit c6aeb83

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix/discussion-replies-nearest
Signed-off-by: Adam Setch <[email protected]>
2 parents 6f688c8 + 27bb98a commit c6aeb83

File tree

19 files changed

+664
-460
lines changed

19 files changed

+664
-460
lines changed

.github/copilot-instructions.md

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
# Gitify Development Instructions
2+
3+
Gitify is a Node.js/Electron desktop application that displays GitHub notifications in the system tray. It's built with React, TypeScript, and uses pnpm for package management.
4+
5+
**ALWAYS follow these instructions first and only fallback to additional search and context gathering if the information in the instructions is incomplete or found to be in error.**
6+
7+
## Working Effectively
8+
9+
### Prerequisites and Setup
10+
- **Install pnpm globally first**: `npm install -g pnpm`
11+
- **Node.js requirement**: This project requires Node.js >=22 (check .nvmrc), though it works with Node 20+ with warnings
12+
- **Bootstrap the repository**:
13+
- `pnpm install` -- takes 2.5 minutes. NEVER CANCEL. Set timeout to 5+ minutes.
14+
15+
### Development Workflow
16+
- **Build the application**:
17+
- `pnpm build` -- takes 32 seconds. NEVER CANCEL. Set timeout to 60+ minutes.
18+
- Builds both main (Electron process) and renderer (React UI) bundles
19+
- Output goes to `build/` directory
20+
- **Development mode with hot reload**:
21+
- `pnpm watch` -- starts webpack in watch mode for both main and renderer
22+
- Takes ~15 seconds for initial compilation
23+
- Leave running while developing
24+
- **Run the Electron app**:
25+
- `pnpm start` -- launches the desktop application
26+
- NOTE: Will fail in headless/container environments due to Electron sandbox restrictions (expected)
27+
- Use `CmdOrCtrl+R` to reload when watch mode detects changes
28+
29+
### Linting and Code Quality
30+
- **Check linting and formatting**:
31+
- `pnpm lint:check` -- takes <1 second using Biome
32+
- **ALWAYS run before committing** or CI will fail
33+
- **Auto-fix issues**:
34+
- `pnpm lint` -- automatically fixes linting and formatting issues
35+
36+
### Testing
37+
- **Run TypeScript compilation check**:
38+
- `pnpm tsc --noEmit` -- takes 5 seconds. NEVER CANCEL. Set timeout to 10+ minutes.
39+
- **Run unit tests**:
40+
- `pnpm test` -- takes 67 seconds. NEVER CANCEL. Set timeout to 30+ minutes.
41+
- Uses Jest with jsdom environment
42+
- NOTE: Some existing snapshot tests may fail but still return success - this is normal
43+
- Update snapshots after legitimate UI changes with `pnpm test -u`
44+
- **Run tests with coverage** (CI format):
45+
- `pnpm test --coverage --runInBand --verbose`
46+
47+
## Validation Scenarios
48+
49+
**CRITICAL**: After making changes, ALWAYS validate your work by running these scenarios:
50+
51+
### Build Validation
52+
1. **Clean build test**: `rm -rf build && pnpm build`
53+
2. **Verify build outputs**: Check that `build/main.js`, `build/renderer.js`, and `build/styles.css` are created
54+
3. **File sizes should be reasonable**: main.js ~300KB, renderer.js ~2MB, styles.css ~1MB
55+
4. **Success indicators**: Look for "webpack compiled successfully" messages for both main and renderer
56+
57+
### Code Quality Validation
58+
1. **Linting passes**: `pnpm lint:check` should show warnings but complete successfully (exit code 0)
59+
2. **TypeScript compiles**: `pnpm tsc --noEmit` should complete without errors
60+
3. **Tests pass**: Run `pnpm test` and ensure no new test failures (some existing ones may fail - focus on your changes)
61+
62+
### Development Environment Testing
63+
1. **Watch mode works**: Start `pnpm watch`, make a small change to a file in `src/`, verify webpack recompiles (look for compilation success messages)
64+
2. **Development build**: The watch mode creates development builds with source maps in `build/` directory
65+
66+
## Expected Command Outputs
67+
68+
### Successful Build
69+
```
70+
webpack 5.101.2 compiled successfully in [time]
71+
```
72+
73+
### Successful Tests (with some expected failures)
74+
```
75+
Test Suites: X failed, Y passed, Z total
76+
Tests: A failed, B passed, C total
77+
```
78+
Note: Focus on ensuring no NEW test failures from your changes.
79+
80+
### Successful Linting
81+
```
82+
Checked X files in Yms. No fixes applied.
83+
Found Z warnings.
84+
```
85+
Warnings are acceptable - the important part is that it completes successfully.
86+
87+
## Common Tasks and File Locations
88+
89+
### Key Files and Directories
90+
- **Main Electron process**: `src/main/` - Node.js backend code
91+
- **Renderer process**: `src/renderer/` - React frontend code
92+
- **Shared code**: `src/shared/` - Common utilities and types
93+
- **Build configuration**: `config/` - Webpack configs and electron-builder settings
94+
- **Assets**: `assets/` - Icons, sounds, and static resources
95+
96+
### Configuration Files
97+
- **package.json**: Main project configuration and scripts
98+
- **biome.json**: Linting and formatting rules
99+
- **jest.config.ts**: Test configuration
100+
- **tsconfig.json**: TypeScript configuration
101+
- **tailwind.config.ts**: CSS framework configuration
102+
103+
### Frequently Modified Areas
104+
- **Notification logic**: `src/renderer/hooks/useNotifications.ts`
105+
- **GitHub API client**: `src/renderer/utils/api/`
106+
- **UI components**: `src/renderer/components/`
107+
- **Authentication**: `src/renderer/utils/auth/`
108+
- **Settings**: `src/renderer/routes/Settings.tsx`
109+
110+
## Build and Release Process
111+
112+
### Local Packaging (for testing)
113+
- **macOS**: `pnpm package:macos --publish=never`
114+
- **Windows**: `pnpm package:win --publish=never`
115+
- **Linux**: `pnpm package:linux --publish=never`
116+
- **NOTE**: These require the full build first and additional platform-specific dependencies
117+
118+
### Pre-commit Checks
119+
- **Automatic via Husky**: Git hooks run `pnpx lint-staged` on commit
120+
- **Manual validation**: Run `pnpm lint:check && pnpm tsc --noEmit && pnpm test`
121+
122+
## Important Constraints and Limitations
123+
124+
### Timing Expectations
125+
- **Dependency installation**: 2-3 minutes (normal for Electron projects)
126+
- **Full build (clean)**: 30-35 seconds
127+
- **Watch mode initial compilation**: 10-15 seconds
128+
- **Watch mode recompilation**: 5-8 seconds for incremental changes
129+
- **Test suite**: 60-70 seconds
130+
- **TypeScript compilation**: 5 seconds
131+
- **Linting**: <1 second
132+
133+
### Environment Issues
134+
- **Electron in containers**: Will fail to start due to sandbox restrictions (expected behavior in headless environments)
135+
- **Node version warnings**: Project requires Node >=22, works with 20+ but shows warnings in `pnpm` commands
136+
- **Build warnings**: Some PostCSS/Tailwind warnings in renderer build are normal and expected
137+
- **Linting warnings**: Existing codebase has some linting warnings - focus only on your changes
138+
139+
### Common Troubleshooting
140+
- **Build failures**: Check Node version, ensure `pnpm install` completed successfully
141+
- **Test snapshot failures**: Run `pnpm test -u` to update snapshots after legitimate UI changes
142+
- **Linting errors**: Run `pnpm lint` to auto-fix most issues
143+
- **Watch mode not updating**: Restart watch mode, check file permissions
144+
145+
## Development Philosophy
146+
147+
This project focuses on GitHub notification monitoring, not being a full GitHub client. Keep changes:
148+
- **Simple and focused** on core notification functionality
149+
- **Consistent** with existing UI patterns and design language
150+
- **Minimal** - avoid adding complexity for edge cases
151+
- **Cross-platform** compatible (macOS, Windows, Linux)
152+
153+
## Technology Stack Reference
154+
155+
**Core Technologies:**
156+
- **Electron 37+**: Desktop app framework
157+
- **React 19+**: UI library
158+
- **TypeScript 5+**: Language
159+
- **pnpm 10+**: Package manager
160+
- **Biome**: Linting and formatting
161+
- **Jest**: Testing framework
162+
- **Webpack 5**: Build system
163+
- **Tailwind CSS**: Styling framework
164+
165+
**Key Dependencies:**
166+
- **menubar**: System tray integration
167+
- **electron-updater**: Auto-update functionality
168+
- **@primer/react**: GitHub's React component library
169+
- **date-fns**: Date utilities
170+
- **axios**: HTTP client for GitHub API
171+
172+
ALWAYS reference this information first before exploring the codebase or running commands to save time and avoid common pitfalls.

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313

1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
16+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1717

1818
- name: Setup pnpm
1919
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
@@ -48,7 +48,7 @@ jobs:
4848

4949
steps:
5050
- name: Checkout
51-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
51+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
5252

5353
- name: Setup pnpm
5454
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
@@ -80,7 +80,7 @@ jobs:
8080

8181
steps:
8282
- name: Checkout
83-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
83+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
8484

8585
- name: Setup pnpm
8686
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313

1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
16+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1717

1818
- name: Setup pnpm
1919
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
steps:
1616
- name: Checkout
17-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
17+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1818

1919
- name: Setup pnpm
2020
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
@@ -54,7 +54,7 @@ jobs:
5454

5555
steps:
5656
- name: Checkout
57-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
57+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
5858

5959
- name: Setup pnpm
6060
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
@@ -88,7 +88,7 @@ jobs:
8888

8989
steps:
9090
- name: Checkout
91-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
91+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
9292

9393
- name: Setup pnpm
9494
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0

.github/workflows/renovate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Checkout
22-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
22+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2323

2424
- name: Setup pnpm
2525
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313

1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
16+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1717

1818
- name: Setup pnpm
1919
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
@@ -43,7 +43,7 @@ jobs:
4343

4444
steps:
4545
- name: Checkout
46-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
46+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
4747
with:
4848
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
4949

.github/workflows/triage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ jobs:
2222
name: Validate PR title
2323
runs-on: ubuntu-latest
2424
steps:
25-
- uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # v5
25+
- uses: amannn/action-semantic-pull-request@fdd4d3ddf614fbcd8c29e4b106d3bbe0cb2c605d # v6.0.1
2626
env:
2727
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2828

2929
pr-labeler:
3030
name: Auto-label PR
3131
runs-on: ubuntu-latest
3232
steps:
33-
- uses: fuxingloh/multi-labeler@b15a54460c38f54043fa75f7b08a0e2aa5b94b5b # v4.0.0
33+
- uses: fuxingloh/multi-labeler@b15a54460c38f54043fa75f7b08a0e2aa5b94b5b # v4.0.0

.vscode/settings.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"editor.codeActionsOnSave": {
3-
"quickfix.biome": "explicit",
4-
"source.organizeImports.biome": "explicit"
3+
"source.fixAll.biome": "explicit"
54
},
65
"editor.defaultFormatter": "biomejs.biome",
76
"[typescript]": {

biome.json

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.1.4/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.2.0/schema.json",
33
"assist": {
44
"actions": {
55
"source": {
@@ -32,8 +32,19 @@
3232
},
3333
"rules": {
3434
"recommended": true,
35-
"suspicious": {
36-
"noConsole": "error"
35+
"a11y": {
36+
"useKeyWithClickEvents": "off",
37+
"useSemanticElements": "off"
38+
},
39+
"correctness": {
40+
"noUnusedFunctionParameters": "error",
41+
"useExhaustiveDependencies": {
42+
"level": "warn",
43+
"options": {
44+
"hooks": [{ "name": "useNavigate", "stableResult": true }]
45+
}
46+
},
47+
"useUniqueElementIds": "warn"
3748
},
3849
"style": {
3950
"useDefaultSwitchClause": "error",
@@ -48,21 +59,9 @@
4859
"noInferrableTypes": "error",
4960
"noUselessElse": "error"
5061
},
51-
"a11y": {
52-
"useKeyWithClickEvents": "off",
53-
"useSemanticElements": "off"
54-
},
55-
"correctness": {
56-
"noUnusedFunctionParameters": "error",
57-
"useExhaustiveDependencies": {
58-
"level": "warn",
59-
"options": {
60-
"hooks": [{ "name": "useNavigate", "stableResult": true }]
61-
}
62-
}
63-
},
64-
"nursery": {
65-
"useUniqueElementIds": "warn"
62+
"suspicious": {
63+
"noConsole": "error",
64+
"noUnknownAtRules": "warn"
6665
}
6766
}
6867
},

0 commit comments

Comments
 (0)