chore: renovate semantic commit type#498
Closed
setchy wants to merge 103 commits into
Closed
Conversation
Co-authored-by: Adam Setch <adam.setch@outlook.com>
* chore: rename package to @gitify/menubar * docs: add Gitify copyright to LICENSE * docs: update README for @gitify/menubar fork * chore: remove upstream COLLABORATORS.md
## Summary - Adds a `destroy()` method that removes all tray and app listeners, destroys the underlying `BrowserWindow`, and prevents the window from opening again until a new `Menubar` instance is created. - Adds an `isDestroyed()` accessor reporting the destroyed state. - Refactors `clicked`, `onAppReady`, and `onAppActivate` into arrow-function class fields so they have stable references and can be removed from event emitters by reference. - Documents the new methods in the README. - Adds tests for `destroy()` / `isDestroyed()` and extends the electron mock with `destroy` / `removeListener`. Adapted from the upstream PR [max-mapper#323](max-mapper#323) by @typologist, which fixes [max-mapper#281](max-mapper#281). ## Test plan - [x] `bun run test` — all tests pass - [x] `bun run typecheck` — no errors - [x] `bun run lint:check` — no new warnings (one pre-existing warning unrelated to this PR) - [x] `bun run build` — produces ESM/CJS bundles --------- Co-authored-by: Jimmy <3059814+typologist@users.noreply.github.com>
## Summary Introduces `Options.trigger` — a `'click' | 'right-click' | 'none'` enum that controls which tray event toggles the menubar window. Deprecates the `showOnRightClick` boolean, which is kept as a fallback for one minor. `trigger: 'none'` skips all tray click bindings, enabling the **one tray icon, multiple anchored windows** pattern: a secondary `Menubar` instance reuses tray-anchored positioning while the caller drives visibility via `showWindow()` (typically from a context-menu entry). ## Why an enum, not a `disableClick` boolean The motivating use case was raised upstream as [max-mapper#485](max-mapper#485) by @haydendonald, who proposed a `disableClick: boolean` flag. We're going further: - `disableClick` is a negative-named boolean, and `disableClick: false` reads as a double-negative. - It silently overlaps with the existing `showOnRightClick` — `{ showOnRightClick: true, disableClick: true }` quietly disables right-click too, since the wrapping `if` covers both registration paths. The name lies. - It's asymmetric: there's no `disableDoubleClick` or `disableRightClick`, so the API can't grow cleanly. A single `trigger` enum subsumes both flags, is self-documenting, leaves room for future values (e.g. `'double-click'`), and gives a clean migration path off `showOnRightClick`. ## Migration | Before | After | | -------------------------------------- | ------------------------------ | | (default) | (default — `trigger: 'click'`) | | `showOnRightClick: true` | `trigger: 'right-click'` | | (no equivalent — was upstream PR max-mapper#485) | `trigger: 'none'` | `showOnRightClick` still works and is honored when `trigger` is unset; it's marked `@deprecated` and slated for removal in the next major. ## Test plan - [x] `bun run test` — 18 tests pass, including 5 new cases for `trigger`: - default binds `click` + `double-click` - `trigger: 'right-click'` binds `right-click` + `double-click`, not `click` - `trigger: 'none'` binds nothing - unset `trigger` falls back to `showOnRightClick` - `trigger` wins over `showOnRightClick` when both are set - [x] `bun run typecheck` — clean - [x] `bun run lint:check` — clean (one pre-existing warning, unrelated) - [x] `bun run build` — ESM/CJS bundles produced
## Summary - Adds a Playwright Electron E2E smoke test (boots fixture, asserts \`ready\`, opens window, verifies tray) and a GitHub Actions matrix running it across macOS 13/14/15, Windows 2022/2025, and Ubuntu 22.04/24.04 with \`xvfb-run\` on Linux. - On every push to \`main\`, an \`update-platforms\` job regenerates \`PLATFORMS.md\` from each runner's status artifact and opens an auto-PR via \`peter-evans/create-pull-request\`. The block is loop-safe (no date), so the PR self-closes once results stabilize. - Replaces the stale \`WORKING_PLATFORMS.md\` with the auto-generated \`PLATFORMS.md\` and deletes the unused checked-in typedoc output (\`docs/\`, \`typedoc.json\`, typedoc devDeps, \`docs\` script, broken README API-doc links) — none of it was published anywhere. ## Test plan - [x] \`bun run build && bun run test:e2e\` passes locally on macOS - [x] \`bun run tests/e2e/update-platforms.ts\` is idempotent (no-op when results unchanged) - [ ] First matrix run on \`main\` opens the auto-PR with the populated table
## Summary - Adds the `<!-- platforms:start -->` / `<!-- platforms:end -->` marker pair the `update-platforms` script in `tests/e2e/update-platforms.ts` requires. - Without these markers, the post-E2E job on `main` failed with `markers <!-- platforms:start --> / <!-- platforms:end --> not found in PLATFORMS.md` (see [run 25614347424](https://github.com/gitify-app/menubar/actions/runs/25614347424/job/75189736381)). - Markers are placed above the hand-curated per-OS tables so the live CI status block lands at the top once the next E2E matrix run regenerates it. ## Test plan - [ ] Next push to `main` runs the matrix and the `Update PLATFORMS table` job opens an auto-PR populating the block instead of failing.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…globalShortcut, helpers) (#13) ## Summary Imports patterns that [gitify-app/gitify](https://github.com/gitify-app/gitify) currently reaches around the library to implement, plus fixes a leaky abstraction that forced gitify to access a private field. ### Fixes - `fix(06dd7cf)`: switch the library's window cleanup listener from `'close'` to `'closed'`. Consumer `'close'` handlers can now read `mb.window` and `event.preventDefault()` without racing our cleanup — removing the need for gitify's `_browserWindow` workaround. - `fix(45aab90)`: the right-click context-menu popup now reads the current menu lazily, so `setContextMenu()` swaps and clears take effect without stale closures. ### Features - `feat(f5a0d0e)`: `hideOnClose` option intercepts `close`, defers the hide via `setImmediate` (Wayland half-closed-surface workaround), and passes through during `before-quit` / `destroy()`. `escapeToHide` option hides the window on Escape via `before-input-event`. - `feat(f4856b7)`: `ignoreDoubleClickEvents` (default `true` on macOS) calls `tray.setIgnoreDoubleClickEvents` to prevent tray-icon flicker. - `feat(528631d)`: `contextMenu` option. On Linux uses `setContextMenu` and re-publishes on every show/hide to defeat the libappindicator/SNI cache. On macOS/Windows pops up via `tray.popUpContextMenu` on right-click so left-click stays bound to the window toggle. - `feat(4d08ff7)`: `setGlobalShortcut(accelerator)`, `toggleWindow()`, and `recenterOnTray()` helpers. `globalShortcut` is unregistered automatically on `destroy()`. - `refactor(66b9e76)`: align `setContextMenu` signature with Electron's `Tray.setContextMenu(menu: Menu | null)`. ### Docs / chore - `docs(64a10a8)`: README documents every new option and method. - `style(1949587)`: formatter pass on the touched files. ### Notes - Zero new runtime dependencies. - 62 unit tests pass (was 39); typecheck and lint clean. - The `'close'` → `'closed'` change is a behavior change for anyone who registered a `'close'` listener on `mb.window` and depended on it firing _before_ our cleanup. None of the prior tests covered that path; gitify's usage benefits from the new ordering. ## Test plan - [ ] `bun run test` (62/62 passing locally) - [ ] `bun run typecheck` - [ ] `bun run lint:check` - [ ] `bun run test:e2e` on macOS - [ ] Smoke-test on a Linux desktop (Ubuntu/GNOME for SNI; KDE if available) - [ ] Smoke-test on Windows - [ ] Drop into gitify via `bun link` and confirm the `_browserWindow` workaround in their close handler can be removed
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
update to `pnpm` for consistency
* docs: refresh readme Signed-off-by: Adam Setch <adam.setch@outlook.com> * docs: refresh readme Signed-off-by: Adam Setch <adam.setch@outlook.com> * docs: refresh readme Signed-off-by: Adam Setch <adam.setch@outlook.com> * docs: refresh readme Signed-off-by: Adam Setch <adam.setch@outlook.com> --------- Signed-off-by: Adam Setch <adam.setch@outlook.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…76) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…88) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* chore(deps): lock file maintenance * fix: upgrade awalsh128/cache-apt-pkgs-action to v1.6.3 to fix KDE Plasma CI --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.
Configure as
depsinstead ofchoreso that Release Please picks up in releasable changes - https://github.com/googleapis/release-please#how-should-i-write-my-commits