Skip to content

Commit e0dc8e7

Browse files
committed
feat: Auto-connect free connectors + Coming Soon badges
- Free connectors (HN, Weather) auto-connect on first-ever visit — zero friction - Users get live data immediately without manual Connect click - Notion and Google Drive show 'Coming Soon' badge instead of 'Connect' - Prevents user confusion on CORS-blocked stub connectors - Purple pill badge CSS for Coming Soon state
1 parent 1d91ea2 commit e0dc8e7

3 files changed

Lines changed: 53 additions & 1 deletion

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Connector UX Improvements — Auto-Connect & Coming Soon
2+
3+
- Free connectors (Hacker News, Weather) now auto-connect on first-ever visit
4+
- Users get live data injected into AI context immediately without any manual setup
5+
- `autoConnectFreeConnectors()` runs during init, checks for keyless `authType: 'none'` connectors with no existing localStorage state
6+
- Notion and Google Drive show purple "Coming Soon" badge instead of "Connect" button
7+
- Prevents user confusion from clicking Connect on CORS-blocked integrations
8+
- `comingSoon: true` flag added to Notion and Google Drive registry entries
9+
- New `.connector-coming-soon-badge` CSS class with purple glassmorphic styling

css/connectors.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,20 @@
7474
align-self: flex-start;
7575
}
7676

77+
/* --- "Coming Soon" badge on stub connectors --- */
78+
.connector-coming-soon-badge {
79+
display: inline-block;
80+
font-size: 10px;
81+
font-weight: 700;
82+
letter-spacing: 0.04em;
83+
text-transform: uppercase;
84+
padding: 4px 10px;
85+
border-radius: 20px;
86+
background: rgba(139, 92, 246, 0.12);
87+
color: #8b5cf6;
88+
border: 1px solid rgba(139, 92, 246, 0.3);
89+
}
90+
7791
/* --- "No API key required" notice in detail view --- */
7892
.connector-keyless-notice {
7993
display: flex;

js/connectors.js

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
testEndpoint: 'https://api.notion.com/v1/users/me',
6868
testHeaders: function (token) { return { 'Authorization': 'Bearer ' + token, 'Notion-Version': '2022-06-28' }; },
6969
corsProxy: true, // Notion blocks CORS — use proxy hint
70+
comingSoon: true,
7071
},
7172
linear: {
7273
id: 'linear',
@@ -120,6 +121,7 @@
120121
configFields: [
121122
{ key: 'query', label: 'Search Query', placeholder: 'e.g. meeting notes Q1', hint: 'Pre-set a search query to always pull from this source' }
122123
],
124+
comingSoon: true,
123125
},
124126

125127
// ----- FREE / KEYLESS CONNECTORS (no signup needed) -----
@@ -604,7 +606,9 @@
604606
(userName ? '<div class="connector-card-user"><i class="bi bi-person-circle me-1"></i>' + escapeHtml(userName) + '</div>' : '') +
605607
'</div>' +
606608
'<div class="connector-card-footer">' +
607-
(connected ?
609+
(def.comingSoon && !connected ?
610+
'<span class="connector-coming-soon-badge">Coming Soon</span>' :
611+
connected ?
608612
'<label class="connector-toggle" title="' + (enabled ? 'Disable' : 'Enable') + ' context injection">' +
609613
'<input type="checkbox" class="connector-enable-check" data-id="' + id + '"' + (enabled ? ' checked' : '') + '>' +
610614
'<span class="connector-toggle-slider"></span>' +
@@ -979,8 +983,33 @@
979983
REGISTRY: REGISTRY,
980984
};
981985

986+
// --- Auto-Connect Free Connectors ---
987+
// On first-ever visit, automatically connect keyless connectors (HN, Weather)
988+
// so users get live data immediately without any manual setup.
989+
function autoConnectFreeConnectors() {
990+
Object.keys(REGISTRY).forEach(function (id) {
991+
var def = REGISTRY[id];
992+
if (def.authType !== 'none') return; // only keyless
993+
if (def.comingSoon) return; // skip stubs
994+
var existing = getConnectorState(id);
995+
if (existing) return; // user already interacted
996+
// First-ever visit — auto-connect
997+
var state = {
998+
token: 'KEYLESS',
999+
config: {},
1000+
connected: true,
1001+
enabled: true,
1002+
userName: 'Active',
1003+
connectedAt: Date.now()
1004+
};
1005+
localStorage.setItem(STORAGE_PREFIX + id, JSON.stringify(state));
1006+
console.log('[Connectors] Auto-connected free connector:', def.name);
1007+
});
1008+
}
1009+
9821010
// --- Init ---
9831011
function init() {
1012+
autoConnectFreeConnectors();
9841013
wireModalEvents();
9851014
refreshAiStrip();
9861015

0 commit comments

Comments
 (0)