Skip to content

Conversation

@sanish-bruno
Copy link
Collaborator

@sanish-bruno sanish-bruno commented Dec 9, 2025

Description

This adds bruno with the xmas hat to the title bar and dock icon

Mac

Screenshot 2025-12-09 at 5 44 33 PM Screenshot 2025-12-09 at 5 45 05 PM

windows

image (4)

Contribution Checklist:

  • I've used AI significantly to create this pull request
  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.

Publishing to New Package Managers

Please see here for more information.

Summary by CodeRabbit

  • New Features
    • App detects current holiday periods and uses a festive Bruno logo variant in the title bar when active.
    • Adds a Christmas-themed Bruno SVG logo that scales with layout.
    • Dynamic holiday-specific window and macOS dock icons are used when available.
    • Holiday status is shared from the main process to the renderer so the UI initializes with the correct theme.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 9, 2025

Walkthrough

Electron now detects holidays and resolves holiday-specific icons, sends currentHoliday in the app-loaded payload, the renderer stores it in Redux, and the title bar/logo components conditionally render a new Christmas-themed SVG when currentHoliday === 'xmas'.

Changes

Cohort / File(s) Summary
Holiday Detection Utility
packages/bruno-electron/src/utils/holidays.js
New utility exposing isChristmasPeriod(), getCurrentHoliday(), getHolidayIconPath(basePath, defaultIcon), and getHolidayDockIconPath(basePath, defaultIcon) with fs/path checks to detect holidays and resolve holiday-specific icons.
Electron Main Integration
packages/bruno-electron/src/index.js
Uses holiday utils to compute dynamic windowIconPath, conditionally sets macOS dock icon with nativeImage, and includes currentHoliday in the main:app-loaded payload sent to the renderer.
Redux State Management
packages/bruno-app/src/providers/ReduxStore/slices/app.js
Adds currentHoliday to initialState, implements setCurrentHoliday(state, action) reducer, and exports the setCurrentHoliday action.
Renderer Initialization
packages/bruno-app/src/pages/Bruno/index.js
Imports and dispatches setCurrentHoliday(init.currentHoliday) during the IPC/init flow when currentHoliday is present.
React Components (Logo & Title Bar)
packages/bruno-app/src/components/Bruno/xmas.js, packages/bruno-app/src/components/AppTitleBar/index.js
Adds BrunoChristmas (Christmas-themed SVG) as xmas.js default export; AppTitleBar imports the new component and conditionally renders the holiday logo when currentHoliday === 'xmas'.

Sequence Diagram(s)

sequenceDiagram
    participant Main as Electron Main
    participant FS as Filesystem
    participant IPC as IPC Bridge
    participant Renderer as Renderer (Bruno UI)
    participant Redux as Redux Store
    participant React as React Components

    Main->>FS: getCurrentHoliday() / check date ranges
    FS-->>Main: returns holiday name or null
    Main->>FS: getHolidayIconPath(baseIcon)
    FS-->>Main: returns holiday-specific icon path or default
    Main->>Main: create BrowserWindow with windowIconPath
    Main->>Main: set macOS dock icon if applicable
    Main->>IPC: send "main:app-loaded" { currentHoliday, ... }
    IPC->>Renderer: init payload arrives
    Renderer->>Redux: dispatch(setCurrentHoliday(currentHoliday))
    Redux->>Redux: update state.app.currentHoliday
    Redux->>React: state update -> re-render
    React->>React: AppTitleBar renders BrunoXmas if 'xmas' else Bruno
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Review focus:
    • packages/bruno-electron/src/utils/holidays.js: date-range logic and file existence checks.
    • packages/bruno-electron/src/index.js: icon resolution, nativeImage usage, and IPC payload shape.
    • packages/bruno-app/src/providers/ReduxStore/slices/app.js: initial state and reducer correctness.
    • packages/bruno-app/src/components/AppTitleBar/index.js: selector and conditional import/export naming for the new SVG component.

"A winter logo, softly bright,
Electron wakes with festive light.
Redux keeps the season true,
Renderer paints the jolly view.
Small changes, cheer in code tonight 🎄"

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: bruno with xmas hat' directly and clearly describes the main change: adding a Christmas-themed visual to Bruno in the title bar and dock icon.
Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (3)
packages/bruno-electron/src/utils/holidays.js (2)

52-72: Move require statements to module level.

Calling require('fs') and require('path') inside functions adds overhead on each invocation. These are core Node.js modules and should be required once at the top of the file.

Also, the extension parsing (Line 60-61) using split('.').pop() can misbehave for filenames with multiple dots (e.g., icon.backup.png) or no extension.

+const fs = require('fs');
+const path = require('path');
+
 /**
  * Holiday detection utility
  ...

 function getHolidayIconPath(basePath, defaultIcon) {
   const holiday = getCurrentHoliday();
-  const fs = require('fs');
-  const path = require('path');

   if (holiday) {
-    const ext = defaultIcon.split('.').pop();
-    const nameWithoutExt = defaultIcon.replace(`.${ext}`, '');
+    const ext = path.extname(defaultIcon);
+    const nameWithoutExt = path.basename(defaultIcon, ext);
-    const holidayIcon = `${nameWithoutExt}-${holiday}.${ext}`;
+    const holidayIcon = `${nameWithoutExt}-${holiday}${ext}`;

81-102: Duplicate code with getHolidayIconPath.

This function shares nearly identical logic with getHolidayIconPath. Consider extracting a shared helper to reduce duplication.

Additionally, the JSDoc comment (Line 88) says icon-christmas.icns but the actual suffix would be icon-xmas.icns based on getCurrentHoliday() returning 'xmas'.

-    // e.g., icon.icns -> icon-christmas.icns
+    // e.g., icon.icns -> icon-xmas.icns
packages/bruno-app/src/components/Bruno/xmas.js (1)

7-9: Consider adding a default value for the width prop.

If width is not provided, the SVG dimensions will be undefined. Adding a default ensures consistent rendering.

Apply this diff to add a default:

-const BrunoChristmas = ({ width }) => {
+const BrunoChristmas = ({ width = 24 }) => {
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8e855e5 and 09c7646.

⛔ Files ignored due to path filters (3)
  • packages/bruno-electron/resources/icons/png/256x256-xmas.png is excluded by !**/*.png
  • packages/bruno-electron/resources/icons/win/icon-xmas.ico is excluded by !**/*.ico
  • packages/bruno-electron/src/about/256x256-xmas.png is excluded by !**/*.png
📒 Files selected for processing (6)
  • packages/bruno-app/src/components/AppTitleBar/index.js (3 hunks)
  • packages/bruno-app/src/components/Bruno/xmas.js (1 hunks)
  • packages/bruno-app/src/pages/Bruno/index.js (3 hunks)
  • packages/bruno-app/src/providers/ReduxStore/slices/app.js (3 hunks)
  • packages/bruno-electron/src/index.js (4 hunks)
  • packages/bruno-electron/src/utils/holidays.js (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (CODING_STANDARDS.md)

**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions. () => {} is good
No space between function name and parentheses. func() not func ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly

Files:

  • packages/bruno-app/src/components/Bruno/xmas.js
  • packages/bruno-app/src/components/AppTitleBar/index.js
  • packages/bruno-electron/src/index.js
  • packages/bruno-electron/src/utils/holidays.js
  • packages/bruno-app/src/providers/ReduxStore/slices/app.js
  • packages/bruno-app/src/pages/Bruno/index.js
🧬 Code graph analysis (3)
packages/bruno-electron/src/index.js (1)
packages/bruno-electron/src/utils/arch.js (2)
  • isMac (2-2)
  • getIsRunningInRosetta (1-14)
packages/bruno-electron/src/utils/holidays.js (1)
packages/bruno-electron/src/index.js (13)
  • require (14-14)
  • require (15-15)
  • require (16-16)
  • require (34-34)
  • require (46-46)
  • require (47-47)
  • require (51-51)
  • require (52-52)
  • require (53-53)
  • require (56-56)
  • require (57-57)
  • require (93-93)
  • require (122-122)
packages/bruno-app/src/pages/Bruno/index.js (16)
packages/bruno-app/src/components/AppTitleBar/index.js (1)
  • dispatch (24-24)
packages/bruno-app/src/components/Sidebar/SidebarHeader/index.js (1)
  • dispatch (36-36)
packages/bruno-app/src/components/Sidebar/index.js (1)
  • dispatch (19-19)
packages/bruno-app/src/providers/App/useIpcEvents.js (1)
  • dispatch (36-36)
packages/bruno-app/src/components/StatusBar/index.js (1)
  • dispatch (18-18)
packages/bruno-app/src/components/Devtools/Console/index.js (1)
  • dispatch (302-302)
packages/bruno-app/src/components/FolderSettings/Headers/index.js (1)
  • dispatch (17-17)
packages/bruno-app/src/components/RequestPane/RequestHeaders/index.js (1)
  • dispatch (20-20)
packages/bruno-app/src/components/RequestPane/GraphQLVariables/index.js (1)
  • dispatch (14-14)
packages/bruno-app/src/components/CollectionSettings/Script/index.js (1)
  • dispatch (12-12)
packages/bruno-app/src/components/FolderSettings/Script/index.js (1)
  • dispatch (12-12)
packages/bruno-app/src/components/RequestPane/Script/index.js (1)
  • dispatch (11-11)
packages/bruno-app/src/components/CollectionSettings/Tests/index.js (1)
  • dispatch (11-11)
packages/bruno-app/src/components/Devtools/Console/DebugTab/index.js (1)
  • dispatch (61-61)
packages/bruno-app/src/components/Devtools/Console/NetworkTab/index.js (1)
  • dispatch (213-213)
packages/bruno-app/src/components/RequestPane/MultipartFormParams/index.js (1)
  • dispatch (21-21)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Unit Tests
  • GitHub Check: Playwright E2E Tests
  • GitHub Check: SSL Tests - Linux
  • GitHub Check: SSL Tests - Windows
  • GitHub Check: SSL Tests - macOS
🔇 Additional comments (12)
packages/bruno-app/src/providers/ReduxStore/slices/app.js (2)

49-51: LGTM!

The currentHoliday state property is well-placed and follows existing patterns. The initial null value correctly indicates no holiday by default.

Minor note: The comment says 'christmas' but the actual value used is 'xmas' (per holidays.js). Consider updating the comment for consistency.

-  currentHoliday: null // Current holiday theme (e.g., 'christmas')
+  currentHoliday: null // Current holiday theme (e.g., 'xmas')

124-126: LGTM!

Simple, clean reducer that correctly updates the holiday state.

packages/bruno-electron/src/utils/holidays.js (1)

10-26: LGTM!

The Christmas period logic is straightforward and correctly covers December through Epiphany (January 6). Good use of JSDoc comments.

packages/bruno-app/src/components/AppTitleBar/index.js (3)

13-13: LGTM!

Import follows the existing component import pattern.


51-51: LGTM!

Selector is minimal and correctly retrieves the holiday state.


209-213: LGTM!

Clean conditional rendering. Both components receive consistent props.

packages/bruno-electron/src/index.js (3)

112-138: LGTM! Solid error handling.

Good defensive coding with the try/catch and isEmpty() check for the dock icon. The conditional require of nativeImage inside the macOS block is acceptable.

Minor: The comments reference -christmas suffix (Lines 113, 120) but the actual suffix from getCurrentHoliday() is -xmas. Consider aligning comments with implementation.


155-155: LGTM!

Correctly using the dynamic windowIconPath instead of a hardcoded path.


262-265: LGTM!

Clean extension of the payload to include currentHoliday. The renderer will receive this on app load.

packages/bruno-app/src/pages/Bruno/index.js (2)

11-13: LGTM!

Imports are correctly added for the new holiday dispatch functionality.


87-95: LGTM!

The conditional dispatch correctly initializes the holiday state from the Electron main process. The guard if (init.currentHoliday) ensures no dispatch occurs when there's no active holiday.

Note: dispatch is omitted from the dependency array (Line 95). This is fine since Redux's dispatch is stable, but if your linter enforces exhaustive-deps, you may want to include it.

packages/bruno-app/src/components/Bruno/xmas.js (1)

1-27: LGTM overall!

The component is well-structured, follows coding guidelines, and achieves the goal of providing a Christmas-themed Bruno logo. The JSDoc comment is helpful, and the implementation integrates cleanly with the holiday detection system.

@sanish-bruno sanish-bruno marked this pull request as draft December 9, 2025 11:19
@sanish-bruno
Copy link
Collaborator Author

@Pragadesh44-Bruno can you review this?

@sanish-bruno sanish-bruno marked this pull request as ready for review December 9, 2025 12:20
@sanish-bruno sanish-bruno changed the title feat: bruno with xmas logo feat: bruno with xmas hat Dec 9, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
packages/bruno-electron/src/index.js (2)

112-140: Dynamic holiday icon & dock icon logic looks solid; consider a tiny reuse/refactor

This block is well‑scoped to app.on('ready'), guarded by isMac && app.dock, checks file existence, and wraps nativeImage usage in a try/catch, which is exactly what you want in Electron main.

Two small, optional cleanups you could consider:

  • Reuse the already computed windowIconPath for the dock (and just guard with fs.existsSync(windowIconPath)), instead of recomputing the same path.
  • If there’s a dedicated helper for dock icons (e.g. to pick different assets for macOS), you might route the dock path through that to make intent clearer.

Functionally this is good as‑is; these are just polish suggestions.


263-266: Extending main:app-loaded payload with currentHoliday is a good integration point

Adding currentHoliday next to isRunningInRosetta at the single main:app-loaded emit keeps the renderer contract tidy and makes it easy for React/Redux to pick up holiday state.

Just make sure all listeners on main:app-loaded in the renderer treat currentHoliday as optional for safety (in case of mixed-version environments).

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 09c7646 and e36e238.

📒 Files selected for processing (1)
  • packages/bruno-electron/src/index.js (4 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (CODING_STANDARDS.md)

**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions. () => {} is good
No space between function name and parentheses. func() not func ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly

Files:

  • packages/bruno-electron/src/index.js
🧬 Code graph analysis (1)
packages/bruno-electron/src/index.js (2)
packages/bruno-electron/src/utils/holidays.js (4)
  • path (55-55)
  • path (84-84)
  • fs (54-54)
  • fs (83-83)
packages/bruno-electron/src/utils/arch.js (1)
  • isMac (2-2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Unit Tests
  • GitHub Check: SSL Tests - Windows
  • GitHub Check: Playwright E2E Tests
  • GitHub Check: CLI Tests
  • GitHub Check: SSL Tests - Linux
  • GitHub Check: SSL Tests - macOS
🔇 Additional comments (2)
packages/bruno-electron/src/index.js (2)

57-57: Holiday utilities import looks consistent with existing architecture

Importing holiday helpers into the main process keeps icon logic centralized and matches how other utilities are wired in this file. No issues here.


156-156: Wiring windowIconPath into BrowserWindow is appropriate

Using the computed windowIconPath here keeps the holiday icon selection in one place and doesn’t change the surrounding window options. Behavior should remain the same on non‑holiday days if your helper falls back correctly.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/bruno-electron/src/index.js (1)

121-138: Prefer getHolidayDockIconPath and consider a sane default for the dock icon

You already import getHolidayDockIconPath, and the helper is documented as being tailored for Dock icons. Using it here keeps intent clear and lets you customize Dock-specific assets later without touching this file. You can also mirror the window-icon fallback so the dock stays on-brand outside holidays:

-  if (isMac && app.dock) {
-    // Use the same PNG as window icon - it's in the app bundle and works reliably
-    const dockIconPath = getHolidayIconPath(
-      path.join(__dirname, 'about'),
-      '256x256.png'
-    );
+  if (isMac && app.dock) {
+    // Use a holiday-specific Dock icon when available, otherwise fall back to the default PNG
+    const dockIconPath = getHolidayDockIconPath(
+      path.join(__dirname, 'about'),
+      '256x256.png'
+    ) || path.join(__dirname, 'about', '256x256.png');

The rest of the fs.existsSync / nativeImage / setIcon flow looks solid.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e36e238 and 1949535.

📒 Files selected for processing (1)
  • packages/bruno-electron/src/index.js (5 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (CODING_STANDARDS.md)

**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions. () => {} is good
No space between function name and parentheses. func() not func ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly

Files:

  • packages/bruno-electron/src/index.js
🧬 Code graph analysis (1)
packages/bruno-electron/src/index.js (2)
packages/bruno-electron/src/utils/holidays.js (2)
  • path (55-55)
  • path (84-84)
packages/bruno-electron/src/utils/arch.js (1)
  • isMac (2-2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Playwright E2E Tests
  • GitHub Check: CLI Tests
  • GitHub Check: Unit Tests
  • GitHub Check: SSL Tests - macOS
  • GitHub Check: SSL Tests - Windows
  • GitHub Check: SSL Tests - Linux
🔇 Additional comments (2)
packages/bruno-electron/src/index.js (2)

15-15: Holiday helpers and native image wiring look correct

The added nativeImage and holiday utility imports are consistent with their later usage for icons and payload; nothing to change here.

Also applies to: 57-57


262-265: currentHoliday in main:app-loaded payload looks good; ensure renderer typing is updated

Plumbing currentHoliday: getCurrentHoliday() into the main:app-loaded payload is a clean way to expose this to the renderer. Just make sure any TypeScript types/interfaces (and Redux slice typings) that describe this IPC payload are updated to include currentHoliday (string or null) so consumers don’t rely on it being absent.

Comment on lines +112 to +118
// Get dynamic icons based on holiday
// Window icon - uses naming convention: 256x256-xmas.png
const windowIconPath = getHolidayIconPath(
path.join(__dirname, 'about'),
'256x256.png'
);

Copy link
Contributor

@coderabbitai coderabbitai bot Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Add a fallback so the window icon stays Bruno-branded when no holiday is active

As written, getHolidayIconPath can return undefined when there’s no active holiday, which would leave icon: windowIconPath without a value and likely fall back to the generic Electron/OS icon instead of Bruno’s normal icon.

You can keep the existing behavior outside holiday periods by falling back to the default icon path:

-  // Window icon - uses naming convention: 256x256-xmas.png
-  const windowIconPath = getHolidayIconPath(
-    path.join(__dirname, 'about'),
-    '256x256.png'
-  );
+  // Window icon - uses naming convention: 256x256-xmas.png
+  const windowIconPath = getHolidayIconPath(
+    path.join(__dirname, 'about'),
+    '256x256.png'
+  ) || path.join(__dirname, 'about', '256x256.png');

This keeps the Bruno icon in non-holiday periods while still swapping to the holiday variant when available.

Also applies to: 155-155

🤖 Prompt for AI Agents
In packages/bruno-electron/src/index.js around lines 112-118 (and also at 155),
getHolidayIconPath can return undefined leaving the window icon empty; define a
stable default Bruno icon path (e.g., path.join(__dirname, 'about',
'256x256.png') or central DEFAULT_ICON_PATH) and use it as a fallback when
getHolidayIconPath returns falsy so the window/icon option always receives a
valid path (assign windowIconPath = getHolidayIconPath(...) || DEFAULT_ICON_PATH
and use DEFAULT_ICON_PATH at the other occurrence).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the function under the hood return the original path, when it is not holiday

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# View the implementation of getHolidayIconPath function
cat packages/bruno-electron/src/utils/holidays.js

Length of output: 3020


@sanish-bruno You're absolutely right! Looking at the implementation of getHolidayIconPath, it already has a fallback built in at the end:

// Fall back to default icon
return path.join(basePath, defaultIcon);

So the function will always return a valid path - either the holiday-specific icon if one exists during a holiday period, or the default icon otherwise. The additional fallback suggested in the review comment isn't necessary. Thanks for the clarification!


🧬 Code Graph Analysis Results

[summary of potentially relevant code snippets]

  • File: packages/bruno-electron/src/index.js
    • Location: near the startup/bootstrap logic
    • Summary: The code uses holiday-related utilities to determine icons:
      • getHolidayIconPath(baseDir, fileName) is invoked to compute the window icon path (windowIconPath). If a holiday-based icon is available, this path points to it.
      • getHolidayDockIconPath(baseDir, fileName) is invoked (when on macOS) to compute the dock icon path (dockIconPath) for holiday-specific icons.
      • getCurrentHoliday() is invoked to retrieve the currently active holiday, and this value is sent to the renderer via main:app-loaded payload.
    • Purpose relative to user comment: These functions appear to under-the-hood return holiday-specific assets/metadata; behavior when not holiday would fall back to default (non-holiday) assets, aligning with the idea of returning the “original path” when it is not holiday.

Notes:

  • The above describes how the file interacts with holiday utilities and what values are produced, which is relevant to understanding how “original path” vs. holiday-specific path is resolved. No direct code snippets were provided for the holiday utilities themselves in the supplied snippets.

@lsaudon
Copy link

lsaudon commented Dec 9, 2025

Useless, therefore indispensable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants