Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
function extractSessionNameFromId(sessionId: string): string {
if (!sessionId) return 'session';

// Match pattern: -Users-${whoami}-workspace-${sessionType}-${sessionName}
// Extract the session name (the part after the second dash after workspace)
const match = sessionId.match(/-workspace-[^-]+-([^-]+)/);
// Match pattern: -Users-${whoami}-workspace-${sessionType}-${sessionName}
// Extract the session name (everything after workspace-type-)
const match = sessionId.match(/-workspace-[^-]+-(.+)/);
if (match && match[1]) {
return match[1];
}
Expand Down Expand Up @@ -341,7 +341,7 @@
const dailyArray = dailyData.daily || dailyData.data || [];

// Find today's data or get the most recent day
let today = dailyArray.find((d: any) => d.date === todayDate);

Check warning on line 344 in src/main.ts

View workflow job for this annotation

GitHub Actions / test (20)

Unexpected any. Specify a different type

Check warning on line 344 in src/main.ts

View workflow job for this annotation

GitHub Actions / test (22)

Unexpected any. Specify a different type

Check warning on line 344 in src/main.ts

View workflow job for this annotation

GitHub Actions / test (24)

Unexpected any. Specify a different type

// If today's data is not found, get the most recent (last item in array)
if (!today && dailyArray.length > 0) {
Expand All @@ -352,7 +352,7 @@
// Get this month's usage
const thisMonthDate = new Date().toISOString().substring(0, 7); // YYYY-MM format
const monthlyArray = monthlyData.monthly || monthlyData.data || [];
const thisMonth = monthlyArray.find((m: any) => m.month === thisMonthDate) || monthlyArray[0] || null;

Check warning on line 355 in src/main.ts

View workflow job for this annotation

GitHub Actions / test (20)

Unexpected any. Specify a different type

Check warning on line 355 in src/main.ts

View workflow job for this annotation

GitHub Actions / test (22)

Unexpected any. Specify a different type

Check warning on line 355 in src/main.ts

View workflow job for this annotation

GitHub Actions / test (24)

Unexpected any. Specify a different type

// Get total from summary
const totalDaily = dailyData.totals || dailyData.summary || {};
Expand All @@ -360,7 +360,7 @@
// Get recent sessions
const sessionsArray = sessionData.sessions || sessionData.data || [];

const recentSessions = sessionsArray.slice(0, 5).map((s: any) => {

Check warning on line 363 in src/main.ts

View workflow job for this annotation

GitHub Actions / test (20)

Unexpected any. Specify a different type

Check warning on line 363 in src/main.ts

View workflow job for this annotation

GitHub Actions / test (22)

Unexpected any. Specify a different type

Check warning on line 363 in src/main.ts

View workflow job for this annotation

GitHub Actions / test (24)

Unexpected any. Specify a different type

// Extract session name from sessionId if available, otherwise use fallback names
let sessionName = s.sessionName || s.session || s.name || 'Unknown Session';
Expand All @@ -383,7 +383,7 @@
const blocksArray = Array.isArray(blocksData.blocks) ? blocksData.blocks : [];

// Find current active block
const currentBlock = blocksArray.find((block: any) =>

Check warning on line 386 in src/main.ts

View workflow job for this annotation

GitHub Actions / test (20)

Unexpected any. Specify a different type

Check warning on line 386 in src/main.ts

View workflow job for this annotation

GitHub Actions / test (22)

Unexpected any. Specify a different type

Check warning on line 386 in src/main.ts

View workflow job for this annotation

GitHub Actions / test (24)

Unexpected any. Specify a different type
block && typeof block === 'object' && block.isActive === true
);
const result = {
Expand Down
Loading