File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ export function registerAppHandlers(mb: Menubar): void {
2020
2121 onMainEvent ( EVENTS . QUIT , ( ) => mb . app . quit ( ) ) ;
2222
23+ // Path handlers for renderer queries about resource locations
2324 handleMainEvent ( EVENTS . NOTIFICATION_SOUND_PATH , ( ) => {
2425 return Paths . notificationSound ;
2526 } ) ;
Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ import { APPLICATION } from '../../shared/constants';
77import { logError } from '../../shared/logger' ;
88import { isMacOS } from '../../shared/platform' ;
99
10+ /**
11+ * On first launch, write the first-run marker file and prompt macOS users
12+ * to move the app to the Applications folder. No-ops on subsequent launches.
13+ */
1014export async function onFirstRunMaybe ( ) {
1115 if ( isFirstRun ( ) ) {
1216 await promptMoveToApplicationsFolder ( ) ;
@@ -38,6 +42,9 @@ async function promptMoveToApplicationsFolder() {
3842 }
3943}
4044
45+ /**
46+ * Returns the absolute path to the first-run marker file in the user data directory.
47+ */
4148const getConfigPath = ( ) => {
4249 const userDataPath = app . getPath ( 'userData' ) ;
4350 return path . join ( userDataPath , 'FirstRun' , APPLICATION . FIRST_RUN_FOLDER ) ;
Original file line number Diff line number Diff line change @@ -9,10 +9,18 @@ import type { Menubar } from 'menubar';
99import { APPLICATION } from '../shared/constants' ;
1010import { logError , logInfo } from '../shared/logger' ;
1111
12- export function isDevMode ( ) {
12+ /**
13+ * Returns true when the app is running in development mode (i.e. not packaged).
14+ */
15+ export function isDevMode ( ) : boolean {
1316 return ! app . isPackaged ;
1417}
1518
19+ /**
20+ * Capture the current window contents and save a PNG file to the user's home directory.
21+ * The filename includes an ISO timestamp and the application name.
22+ * @param mb - The menubar instance whose window is captured.
23+ */
1624export function takeScreenshot ( mb : Menubar ) {
1725 const date = new Date ( ) ;
1826 const dateStr = date . toISOString ( ) . replaceAll ( ':' , '-' ) ;
@@ -28,6 +36,10 @@ export function takeScreenshot(mb: Menubar) {
2836 } ) ;
2937}
3038
39+ /**
40+ * Open the directory containing the application log file in the OS file manager.
41+ * Logs an error if the log file path cannot be resolved.
42+ */
3143export function openLogsDirectory ( ) {
3244 const logFilePath = log . transports . file ?. getFile ( ) ?. path ;
3345
You can’t perform that action at this time.
0 commit comments