Skip to content

Commit 7c38f73

Browse files
committed
better install menu
1 parent 257aa31 commit 7c38f73

File tree

4 files changed

+77
-13
lines changed

4 files changed

+77
-13
lines changed

app/static/js/auto_share.js

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ class AutoShareManager {
5959
markDirty() {
6060
this.dirty = true;
6161

62+
// Immediately gray out the UI to show context has changed
63+
this.setUnsyncedState();
64+
6265
// Clear existing timer
6366
if (this.debounceTimer) {
6467
clearTimeout(this.debounceTimer);
@@ -179,6 +182,21 @@ class AutoShareManager {
179182
return JSON.stringify(payload);
180183
}
181184

185+
setUnsyncedState() {
186+
// Gray out only the script input immediately when content changes
187+
if (this.linkInput) {
188+
this.linkInput.classList.add('opacity-50');
189+
this.linkInput.disabled = true;
190+
if (this.currentShareUrl) {
191+
this.linkInput.value = this.currentShareUrl + ' (updating...)';
192+
}
193+
}
194+
// Keep copy button enabled but just disable if no URL
195+
if (this.copyButton) {
196+
this.copyButton.disabled = !this.currentShareUrl;
197+
}
198+
}
199+
182200
setState(newState) {
183201
this.state = newState;
184202

@@ -211,8 +229,9 @@ class AutoShareManager {
211229
this.linkInput.disabled = true;
212230
}
213231
if (this.copyButton) {
214-
this.copyButton.disabled = true;
215-
this.copyButton.classList.add('opacity-50');
232+
this.copyButton.disabled = !this.currentShareUrl;
233+
// Don't gray out the copy button
234+
this.copyButton.classList.remove('opacity-50');
216235
}
217236
break;
218237

app/templates/components/hero.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="mb-8">
22
<div class="w-full flex sm:flex-row flex-col justify-center sm:items-center relative">
33
<h1 class="landing-page-title">
4-
<span class="block">Instant rules</span>
4+
<span class="block">Composable rules</span>
55
<span class="block">for coding agents</span>
66
</h1>
77
<!-- Decorative logos positioned relative to the centered content -->

app/templates/components/workspace_actions.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ <h3 class="text-lg font-black text-black mb-4">Add tools</h3>
55

66
<!-- QuickAction Section - Search Bar -->
77
<div class="mb-4">
8-
<h4 class="text-sm font-bold text-black mb-2">Quick Action</h4>
98
<div class="search-container">
109
<input
1110
type="text"

app/templates/components/workspace_editor.html

Lines changed: 55 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,62 @@ <h3 class="text-lg font-black text-black">Context editor</h3>
2323
<div class="w-full h-full bg-gray-900 translate-y-1 translate-x-1 absolute inset-0 z-0"></div>
2424
<div id="workspace-monaco-editor"
2525
class="relative z-10 border-2 border-black bg-white h-full"
26-
style="min-height: 350px;"></div>
26+
style="min-height: 320px;"></div>
2727
</div>
2828

29-
<!-- Install in one click bar -->
30-
<div id="auto-share-panel" class="flex gap-2 items-center justify-center py-2 border-t-2 border-gray-200">
31-
<label class="text-sm font-bold text-black">Install in one click</label>
32-
<input id="share-link-input" type="text" readonly class="px-3 py-1 bg-white border-2 border-black text-black font-mono text-xs shadow-[2px_2px_0px_0px_rgba(0,0,0,1)] focus:outline-none" style="width: 320px; cursor: text;" value="Waiting for first save...">
33-
<button id="copy-share-link" class="px-3 py-1 bg-cyan-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 disabled:opacity-50 disabled:cursor-not-allowed" disabled>
34-
Copy
35-
</button>
29+
<!-- Install in one click card with tabs -->
30+
<div class="flex justify-center">
31+
<div class="relative inline-block">
32+
<!-- Tabs for the card -->
33+
<div class="flex gap-0">
34+
<button id="share-tab-install" class="share-tab-button active px-3 py-1 bg-pink-400 border-2 border-black border-b-0 text-black font-bold text-xs shadow-[2px_0px_0px_0px_rgba(0,0,0,1)] relative z-10">
35+
macOS/Linux
36+
</button>
37+
<button id="share-tab-other" class="share-tab-button px-3 py-1 bg-gray-100 border-2 border-gray-400 border-b-0 text-gray-500 font-medium text-xs shadow-[1px_0px_0px_0px_rgba(0,0,0,0.3)] relative z-5" disabled>
38+
Windows (soon)
39+
</button>
40+
</div>
41+
42+
<!-- Card content -->
43+
<div id="auto-share-panel" class="bg-pink-400 border-2 border-black shadow-[3px_3px_0px_0px_rgba(0,0,0,1)] p-3 relative z-0" style="margin-top: -2px;">
44+
<div class="flex gap-2 items-center">
45+
<input id="share-link-input" type="text" readonly class="px-3 py-1 bg-white border-2 border-black text-black font-mono text-xs shadow-[2px_2px_0px_0px_rgba(0,0,0,1)] focus:outline-none" style="min-width: 450px; cursor: text;" value="Waiting for first save...">
46+
<button id="copy-share-link" class="px-3 py-1 bg-cyan-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-xs disabled:opacity-50 disabled:cursor-not-allowed" disabled>
47+
Copy
48+
</button>
49+
</div>
50+
</div>
51+
</div>
3652
</div>
3753
</div>
38-
</div>
54+
</div>
55+
56+
<!-- Tab switching for share panel -->
57+
<script>
58+
document.addEventListener('DOMContentLoaded', function() {
59+
const shareTabs = document.querySelectorAll('.share-tab-button');
60+
61+
shareTabs.forEach(tab => {
62+
tab.addEventListener('click', function() {
63+
// Skip if tab is disabled
64+
if (this.disabled) return;
65+
66+
// Remove active state from all tabs
67+
shareTabs.forEach(t => {
68+
if (!t.disabled) {
69+
t.classList.remove('active', 'bg-pink-400', 'border-black', 'text-black', 'font-bold', 'z-10');
70+
t.classList.add('bg-gray-100', 'border-gray-400', 'text-gray-700', 'font-medium', 'z-5');
71+
t.classList.remove('shadow-[2px_0px_0px_0px_rgba(0,0,0,1)]');
72+
t.classList.add('shadow-[1px_0px_0px_0px_rgba(0,0,0,0.3)]');
73+
}
74+
});
75+
76+
// Add active state to clicked tab
77+
this.classList.add('active', 'bg-pink-400', 'border-black', 'text-black', 'font-bold', 'z-10');
78+
this.classList.remove('bg-gray-100', 'border-gray-400', 'text-gray-700', 'font-medium', 'z-5');
79+
this.classList.remove('shadow-[1px_0px_0px_0px_rgba(0,0,0,0.3)]');
80+
this.classList.add('shadow-[2px_0px_0px_0px_rgba(0,0,0,1)]');
81+
});
82+
});
83+
});
84+
</script>

0 commit comments

Comments
 (0)