codedash-app 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codedash-app",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Termius-style browser dashboard for Claude Code sessions. View, search, resume, and delete sessions with a dark-themed UI.",
5
5
  "bin": {
6
6
  "codedash": "./bin/cli.js"
package/src/data.js CHANGED
@@ -65,16 +65,30 @@ function scanCodexSessions() {
65
65
  const uuidMatch = basename.match(/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/);
66
66
  if (!uuidMatch) continue;
67
67
  const sid = uuidMatch[1];
68
+ // Try to extract cwd from session_meta
69
+ let cwd = '';
70
+ try {
71
+ const firstLine = fs.readFileSync(f, 'utf8').split('\n')[0];
72
+ const meta = JSON.parse(firstLine);
73
+ if (meta.type === 'session_meta' && meta.payload && meta.payload.cwd) {
74
+ cwd = meta.payload.cwd;
75
+ }
76
+ } catch {}
77
+
68
78
  const existing = sessions.find(s => s.id === sid);
69
79
  if (existing) {
70
80
  existing.has_detail = true;
71
81
  existing.file_size = stat.size;
82
+ if (cwd && !existing.project) {
83
+ existing.project = cwd;
84
+ existing.project_short = cwd.replace(os.homedir(), '~');
85
+ }
72
86
  } else {
73
87
  sessions.push({
74
88
  id: sid,
75
89
  tool: 'codex',
76
- project: '',
77
- project_short: '',
90
+ project: cwd,
91
+ project_short: cwd ? cwd.replace(os.homedir(), '~') : '',
78
92
  first_ts: stat.mtimeMs,
79
93
  last_ts: stat.mtimeMs,
80
94
  messages: 0,
@@ -219,6 +219,14 @@ function applyFilters() {
219
219
  return true;
220
220
  });
221
221
 
222
+ // Starred sessions first
223
+ filteredSessions.sort(function(a, b) {
224
+ var aStarred = stars.indexOf(a.id) >= 0 ? 1 : 0;
225
+ var bStarred = stars.indexOf(b.id) >= 0 ? 1 : 0;
226
+ if (aStarred !== bStarred) return bStarred - aStarred;
227
+ return b.last_ts - a.last_ts;
228
+ });
229
+
222
230
  render();
223
231
  }
224
232
 
@@ -863,6 +871,17 @@ async function confirmDelete() {
863
871
  if (data.ok) {
864
872
  showToast('Session deleted');
865
873
  allSessions = allSessions.filter(function(s) { return s.id !== pendingDelete.id; });
874
+ // Clear search if no more results
875
+ if (searchQuery) {
876
+ var remaining = allSessions.filter(function(s) {
877
+ return (s.project || '').toLowerCase().indexOf(searchQuery.toLowerCase()) >= 0 ||
878
+ (s.first_message || '').toLowerCase().indexOf(searchQuery.toLowerCase()) >= 0;
879
+ });
880
+ if (remaining.length === 0) {
881
+ searchQuery = '';
882
+ document.querySelector('.search-box').value = '';
883
+ }
884
+ }
866
885
  closeConfirm();
867
886
  closeDetail();
868
887
  applyFilters();