Skip to content

Commit 8009ed3

Browse files
committed
better context selection
1 parent c3fa733 commit 8009ed3

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

app/static/js/workspace_manager.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,13 @@ class WorkspaceManager {
342342
Object.values(this.contexts).forEach(ctx => {
343343
const option = document.createElement('option');
344344
option.value = ctx.id;
345-
option.textContent = ctx.name;
345+
// Truncate long names to fit the dropdown
346+
let displayName = ctx.name;
347+
if (displayName.length > 25) {
348+
displayName = displayName.substring(0, 22) + '...';
349+
}
350+
option.textContent = displayName;
351+
option.title = ctx.name; // Show full name on hover
346352
option.selected = ctx.id === this.currentContextId;
347353
contextSwitcher.appendChild(option);
348354
});

app/templates/components/workspace_files.html

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,20 @@ <h3 class="text-lg font-black text-black">Files</h3>
3434
<!-- Context selector relocated here -->
3535
<div class="mt-4 pt-4 border-t-2 border-black">
3636
<div class="flex flex-col gap-2">
37-
<label class="text-sm font-bold text-black">Context:</label>
38-
<div class="flex gap-1">
39-
<select id="context-switcher" class="flex-1 px-2 py-1 bg-white border-2 border-black text-black font-medium shadow-[2px_2px_0px_0px_rgba(0,0,0,1)] hover:shadow-[3px_3px_0px_0px_rgba(0,0,0,1)] focus:outline-none focus:ring-2 focus:ring-cyan-400 text-sm">
40-
<!-- Options will be populated dynamically -->
41-
</select>
42-
<button id="new-context-btn" class="px-2 py-1 bg-pink-400 border-2 border-black text-black font-bold shadow-[2px_2px_0px_0px_rgba(0,0,0,1)] hover:shadow-[3px_3px_0px_0px_rgba(0,0,0,1)] hover:translate-x-[-1px] hover:translate-y-[-1px] active:shadow-[1px_1px_0px_0px_rgba(0,0,0,1)] active:translate-x-[1px] active:translate-y-[1px] transition-all text-sm" title="New Context">
43-
+
44-
</button>
45-
<button id="delete-context-btn" class="px-2 py-1 bg-red-400 border-2 border-black text-black font-bold shadow-[2px_2px_0px_0px_rgba(0,0,0,1)] hover:shadow-[3px_3px_0px_0px_rgba(0,0,0,1)] hover:translate-x-[-1px] hover:translate-y-[-1px] active:shadow-[1px_1px_0px_0px_rgba(0,0,0,1)] active:translate-x-[1px] active:translate-y-[1px] transition-all text-sm" title="Delete Context">
46-
×
47-
</button>
37+
<div class="flex justify-between items-center mb-1">
38+
<label class="text-sm font-black text-black">CONTEXT</label>
39+
<div class="flex gap-1">
40+
<button id="new-context-btn" class="w-6 h-6 bg-pink-400 border-2 border-black text-black font-bold flex items-center justify-center shadow-[2px_2px_0px_0px_rgba(0,0,0,1)] hover:shadow-[3px_3px_0px_0px_rgba(0,0,0,1)] hover:translate-x-[-1px] hover:translate-y-[-1px] active:shadow-[1px_1px_0px_0px_rgba(0,0,0,1)] active:translate-x-[1px] active:translate-y-[1px] transition-all" title="New Context">
41+
<span class="text-xs">+</span>
42+
</button>
43+
<button id="delete-context-btn" class="w-6 h-6 bg-red-400 border-2 border-black text-black font-bold flex items-center justify-center shadow-[2px_2px_0px_0px_rgba(0,0,0,1)] hover:shadow-[3px_3px_0px_0px_rgba(0,0,0,1)] hover:translate-x-[-1px] hover:translate-y-[-1px] active:shadow-[1px_1px_0px_0px_rgba(0,0,0,1)] active:translate-x-[1px] active:translate-y-[1px] transition-all" title="Delete Context">
44+
<span class="text-xs">×</span>
45+
</button>
46+
</div>
4847
</div>
48+
<select id="context-switcher" class="w-full px-2 py-2 bg-white border-2 border-black text-black font-medium shadow-[2px_2px_0px_0px_rgba(0,0,0,1)] hover:shadow-[3px_3px_0px_0px_rgba(0,0,0,1)] hover:translate-x-[-1px] hover:translate-y-[-1px] focus:shadow-[3px_3px_0px_0px_rgba(0,0,0,1)] focus:translate-x-[-1px] focus:translate-y-[-1px] focus:outline-none text-xs truncate transition-all appearance-none bg-no-repeat" style="background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3e%3cpath fill=%22%23000000%22 d=%22M7 10l5 5 5-5z%22/%3e%3c/svg%3e'); background-position: right 0.5rem center; background-size: 1.5em 1.5em; padding-right: 2rem;">
49+
<!-- Options will be populated dynamically -->
50+
</select>
4951
</div>
5052
</div>
5153
</div>

0 commit comments

Comments
 (0)