Skip to content

Commit f8a7952

Browse files
nkmr-jpclaude
andcommitted
refactor: remove unused statistics types and methods
Remove unused AppStats, DraftStats interfaces and getAppStats method to clean up codebase and reduce maintenance overhead. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 55bfabb commit f8a7952

File tree

3 files changed

+1
-44
lines changed

3 files changed

+1
-44
lines changed

src/handlers/CLAUDE.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,13 @@ import {
5656
- **`remove-history-item`**: Removes specific item with ID format validation
5757
- Regex validation: `/^[a-z0-9]+$/` (coupled with utils.generateId())
5858
- **`search-history`**: Full-text search with configurable result limits
59-
- **`get-history-stats`**: Returns HistoryStats object with metadata
6059

6160
### Draft Management
6261
- **`save-draft`**: Draft persistence with debouncing control
6362
- Supports immediate mode for explicit saves
6463
- Uses DraftManager's debounced or immediate save methods
6564
- **`clear-draft`**: Explicit draft removal
6665
- **`get-draft`**: Current draft content retrieval
67-
- **`get-draft-stats`**: Draft metadata and statistics
6866

6967
### Window Management
7068
- **`show-window`**: Window display with optional WindowData context

src/main.ts

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import DraftManager from './managers/draft-manager';
2323
import SettingsManager from './managers/settings-manager';
2424
import IPCHandlers from './handlers/ipc-handlers';
2525
import { logger, ensureDir } from './utils/utils';
26-
import type { AppStats, HistoryStats, WindowData, DraftStats } from './types';
26+
import type { WindowData } from './types';
2727

2828
class PromptLineApp {
2929
private windowManager: WindowManager | null = null;
@@ -318,31 +318,6 @@ class PromptLineApp {
318318
}
319319
}
320320

321-
getAppStats(): AppStats {
322-
const defaultDraftStats: DraftStats = {
323-
hasData: false,
324-
length: 0,
325-
lastSaved: null,
326-
autoSaveEnabled: false
327-
};
328-
329-
const draftStats = this.draftManager ? this.draftManager.getDraftStats() : defaultDraftStats;
330-
331-
return {
332-
isInitialized: this.isInitialized,
333-
historyStats: this.historyManager ? this.historyManager.getHistoryStats() : {} as HistoryStats,
334-
draftStats: {
335-
hasData: 'hasContent' in draftStats ? draftStats.hasContent || false : false,
336-
length: draftStats.length || 0,
337-
lastSaved: null,
338-
autoSaveEnabled: false
339-
},
340-
windowVisible: this.windowManager ? this.windowManager.isVisible() : false,
341-
platform: process.platform,
342-
version: config.app.version
343-
};
344-
}
345-
346321
private async cleanup(): Promise<void> {
347322
try {
348323
logger.info('Cleaning up application resources...');

src/types/index.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,6 @@ export interface HistoryStats {
4646
newestTimestamp: number | null;
4747
}
4848

49-
export interface DraftStats {
50-
hasData: boolean;
51-
length: number;
52-
lastSaved: number | null;
53-
autoSaveEnabled: boolean;
54-
}
55-
56-
export interface AppStats {
57-
isInitialized: boolean;
58-
historyStats: HistoryStats;
59-
draftStats: DraftStats;
60-
windowVisible: boolean;
61-
platform: string;
62-
version: string;
63-
}
64-
6549
export interface PlatformConfig {
6650
isMac: boolean;
6751
isWindows: boolean;

0 commit comments

Comments
 (0)