Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
feat([issue-1179]): lay DevTools integration pages out side-by-side instead of one narrow column
[._.]/ Adam Eivybf7211f6e881
diff --git a/client/src/pages/DataDog.jsx b/client/src/pages/DataDog.jsxindex a8473ca8fb..02abb85781 100644--- a/client/src/pages/DataDog.jsx+++ b/client/src/pages/DataDog.jsx@@ -189,7 +189,7 @@ export default function DataDog() {}return (- <div className="p-4 sm:p-6 max-w-6xl mx-auto">+ <div className="p-4 sm:p-6"><div className="flex flex-col sm:flex-row sm:justify-between sm:items-center gap-4 mb-6"><h1 className="text-xl sm:text-2xl font-bold text-white">DataDog Integration</h1>{!editingInstance && (@@ -228,211 +228,215 @@ export default function DataDog() {</div>)}- {editingInstance ? (- <div className="bg-gray-800 rounded-lg p-4 sm:p-6 mb-6">- <h2 className="text-lg sm:text-xl font-bold text-white mb-4">- {editingInstance === 'new' ? 'Add' : 'Edit'} DataDog Instance- </h2>-- {saveError && (- <div className="mb-4 p-3 bg-red-900 border border-red-700 rounded">- <p className="text-red-300 font-medium">Error saving DataDog instance</p>- <p className="text-red-400 text-sm mt-1">{saveError}</p>- </div>- )}-- <div className="space-y-4">- <div>- <label className="block text-sm font-medium text-gray-300 mb-1">- Instance ID- </label>- <input- type="text"- name="id"- value={formData.id}- onChange={handleInputChange}- disabled={editingInstance !== 'new'}- className="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded text-white disabled:opacity-50"- placeholder="e.g., company-datadog"- />- <p className="text-xs text-gray-400 mt-1">- Unique identifier (cannot be changed after creation)- </p>- </div>-- <div>- <label className="block text-sm font-medium text-gray-300 mb-1">- Display Name- </label>- <input- type="text"- name="name"- value={formData.name}- onChange={handleInputChange}- className="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded text-white"- placeholder="e.g., Company DataDog"- />- </div>-- <div>- <label className="block text-sm font-medium text-gray-300 mb-1">- Site- </label>- <select- value={customSite ? 'custom' : formData.site}- onChange={handleSiteChange}- className="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded text-white mb-2"- >- {SITE_OPTIONS.map(opt => (- <option key={opt.value} value={opt.value}>{opt.label}</option>- ))}- </select>- {customSite && (- <input- type="text"- name="site"- value={formData.site}- onChange={handleInputChange}- className="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded text-white"- placeholder="e.g., api.custom-datadog.com"- />+ <div className="grid grid-cols-1 lg:grid-cols-[1fr_360px] gap-6 items-start">+ <div className="space-y-6 min-w-0">+ {editingInstance ? (+ <div className="bg-gray-800 rounded-lg p-4 sm:p-6">+ <h2 className="text-lg sm:text-xl font-bold text-white mb-4">+ {editingInstance === 'new' ? 'Add' : 'Edit'} DataDog Instance+ </h2>++ {saveError && (+ <div className="mb-4 p-3 bg-red-900 border border-red-700 rounded">+ <p className="text-red-300 font-medium">Error saving DataDog instance</p>+ <p className="text-red-400 text-sm mt-1">{saveError}</p>+ </div>)}- </div>- <div>- <label className="block text-sm font-medium text-gray-300 mb-1">- API Key- </label>- <input- type="password"- name="apiKey"- value={formData.apiKey}- onChange={handleInputChange}- className="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded text-white"- placeholder={editingInstance === 'new' ? 'Enter your DataDog API Key' : 'Leave blank to keep existing key'}- />- <p className="text-xs text-gray-400 mt-1">- Found in DataDog Organization Settings → API Keys- </p>- </div>+ <div className="space-y-4">+ <div>+ <label className="block text-sm font-medium text-gray-300 mb-1">+ Instance ID+ </label>+ <input+ type="text"+ name="id"+ value={formData.id}+ onChange={handleInputChange}+ disabled={editingInstance !== 'new'}+ className="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded text-white disabled:opacity-50"+ placeholder="e.g., company-datadog"+ />+ <p className="text-xs text-gray-400 mt-1">+ Unique identifier (cannot be changed after creation)+ </p>+ </div>- <div>- <label className="block text-sm font-medium text-gray-300 mb-1">- Application Key- </label>- <input- type="password"- name="appKey"- value={formData.appKey}- onChange={handleInputChange}- className="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded text-white"- placeholder={editingInstance === 'new' ? 'Enter your DataDog Application Key' : 'Leave blank to keep existing key'}- />- <p className="text-xs text-gray-400 mt-1">- Found in DataDog Organization Settings → Application Keys- </p>- </div>+ <div>+ <label className="block text-sm font-medium text-gray-300 mb-1">+ Display Name+ </label>+ <input+ type="text"+ name="name"+ value={formData.name}+ onChange={handleInputChange}+ className="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded text-white"+ placeholder="e.g., Company DataDog"+ />+ </div>- <div className="flex flex-col sm:flex-row gap-2">- <button- onClick={handleSave}- disabled={saving || !formData.name || !formData.site || (editingInstance === 'new' && (!formData.apiKey || !formData.appKey))}- className="w-full sm:w-auto px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded disabled:opacity-50 disabled:cursor-not-allowed"- >- {saving ? 'Saving...' : 'Save'}- </button>- <button- onClick={handleCancel}- disabled={saving}- className="w-full sm:w-auto px-4 py-2 bg-gray-600 hover:bg-gray-700 text-white rounded disabled:opacity-50"- >- Cancel- </button>- </div>- </div>- </div>- ) : null}-- <div className="space-y-4">- {Object.values(instances).length === 0 ? (- <div className="bg-gray-800 rounded-lg p-8 text-center">- <p className="text-gray-400">No DataDog instances configured.</p>- <p className="text-gray-500 text-sm mt-2">- Add a DataDog instance to enable error monitoring for your apps.- </p>- </div>- ) : (- Object.values(instances).map((instance) => (- <div key={instance.id} className="bg-gray-800 rounded-lg p-4 sm:p-6">- <div className="flex flex-col sm:flex-row sm:justify-between sm:items-start gap-4">- <div className="flex-1 min-w-0">- <h3 className="text-lg font-bold text-white truncate">{instance.name}</h3>- <p className="text-gray-400 text-sm mt-1 break-all">Site: {instance.site}</p>- <p className="text-gray-500 text-sm">- API Key: {instance.hasApiKey ? 'Configured' : 'Not set'}+ <div>+ <label className="block text-sm font-medium text-gray-300 mb-1">+ Site+ </label>+ <select+ value={customSite ? 'custom' : formData.site}+ onChange={handleSiteChange}+ className="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded text-white mb-2"+ >+ {SITE_OPTIONS.map(opt => (+ <option key={opt.value} value={opt.value}>{opt.label}</option>+ ))}+ </select>+ {customSite && (+ <input+ type="text"+ name="site"+ value={formData.site}+ onChange={handleInputChange}+ className="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded text-white"+ placeholder="e.g., api.custom-datadog.com"+ />+ )}+ </div>++ <div>+ <label className="block text-sm font-medium text-gray-300 mb-1">+ API Key+ </label>+ <input+ type="password"+ name="apiKey"+ value={formData.apiKey}+ onChange={handleInputChange}+ className="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded text-white"+ placeholder={editingInstance === 'new' ? 'Enter your DataDog API Key' : 'Leave blank to keep existing key'}+ />+ <p className="text-xs text-gray-400 mt-1">+ Found in DataDog Organization Settings → API Keys</p>- <p className="text-gray-500 text-sm">- App Key: {instance.hasAppKey ? 'Configured' : 'Not set'}+ </div>++ <div>+ <label className="block text-sm font-medium text-gray-300 mb-1">+ Application Key+ </label>+ <input+ type="password"+ name="appKey"+ value={formData.appKey}+ onChange={handleInputChange}+ className="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded text-white"+ placeholder={editingInstance === 'new' ? 'Enter your DataDog Application Key' : 'Leave blank to keep existing key'}+ />+ <p className="text-xs text-gray-400 mt-1">+ Found in DataDog Organization Settings → Application Keys</p></div>- <div className="flex flex-wrap gap-2 sm:flex-nowrap">+ <div className="flex flex-col sm:flex-row gap-2"><button- onClick={() => handleTest(instance.id)}- disabled={testingInstance === instance.id}- className="flex-1 sm:flex-none px-3 py-2 sm:py-1 bg-blue-600 hover:bg-blue-700 text-white text-sm rounded disabled:opacity-50"+ onClick={handleSave}+ disabled={saving || !formData.name || !formData.site || (editingInstance === 'new' && (!formData.apiKey || !formData.appKey))}+ className="w-full sm:w-auto px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded disabled:opacity-50 disabled:cursor-not-allowed">- {testingInstance === instance.id ? 'Testing...' : 'Test'}+ {saving ? 'Saving...' : 'Save'}</button><button- onClick={() => handleEdit(instance)}- className="flex-1 sm:flex-none px-3 py-2 sm:py-1 bg-yellow-600 hover:bg-yellow-700 text-white text-sm rounded"+ onClick={handleCancel}+ disabled={saving}+ className="w-full sm:w-auto px-4 py-2 bg-gray-600 hover:bg-gray-700 text-white rounded disabled:opacity-50">- Edit- </button>- <button- onClick={() => handleDeleteClick(instance.id)}- className="flex-1 sm:flex-none px-3 py-2 sm:py-1 bg-red-600 hover:bg-red-700 text-white text-sm rounded"- >- Delete+ Cancel</button></div></div>+ </div>+ ) : null}++ <div className="bg-gray-800 rounded-lg p-4 sm:p-6">+ <h2 className="text-base sm:text-lg font-bold text-white mb-3 sm:mb-4">Usage</h2>+ <div className="space-y-2 text-xs sm:text-sm text-gray-300">+ <p>1. Add one or more DataDog instances above</p>+ <p>2. Go to Apps and enable DataDog monitoring in each app's settings</p>+ <p>3. The error monitor job will periodically check for new errors:</p>+ <ul className="list-disc list-inside ml-2 sm:ml-4 space-y-1 text-gray-400">+ <li>Query DataDog for recent error events matching the app's service name</li>+ <li>Surface new errors in notifications and app insights</li>+ <li>Track error trends over time</li>+ </ul>+ </div>+ </div>+ </div>- {testResults[instance.id] && testResults[instance.id].success !== undefined && (- <div- className={`mt-4 p-3 rounded ${- testResults[instance.id].success- ? 'bg-green-900 border border-green-700'- : 'bg-red-900 border border-red-700'- }`}- >- {testResults[instance.id].success ? (- <p className="text-green-300 font-medium">API key validated</p>- ) : (- <>- <p className="text-red-300 font-medium">Connection failed</p>- <p className="text-red-400 text-sm mt-1">{testResults[instance.id].error}</p>- </>- )}- </div>- )}+ <div className="space-y-4">+ {Object.values(instances).length === 0 ? (+ <div className="bg-gray-800 rounded-lg p-8 text-center">+ <p className="text-gray-400">No DataDog instances configured.</p>+ <p className="text-gray-500 text-sm mt-2">+ Add a DataDog instance to enable error monitoring for your apps.+ </p></div>- ))- )}- </div>+ ) : (+ Object.values(instances).map((instance) => (+ <div key={instance.id} className="bg-gray-800 rounded-lg p-4 sm:p-6">+ <div className="flex flex-col gap-4">+ <div className="flex-1 min-w-0">+ <h3 className="text-lg font-bold text-white truncate">{instance.name}</h3>+ <p className="text-gray-400 text-sm mt-1 break-all">Site: {instance.site}</p>+ <p className="text-gray-500 text-sm">+ API Key: {instance.hasApiKey ? 'Configured' : 'Not set'}+ </p>+ <p className="text-gray-500 text-sm">+ App Key: {instance.hasAppKey ? 'Configured' : 'Not set'}+ </p>+ </div>++ <div className="flex flex-wrap gap-2">+ <button+ onClick={() => handleTest(instance.id)}+ disabled={testingInstance === instance.id}+ className="flex-1 sm:flex-none px-3 py-2 sm:py-1 bg-blue-600 hover:bg-blue-700 text-white text-sm rounded disabled:opacity-50"+ >+ {testingInstance === instance.id ? 'Testing...' : 'Test'}+ </button>+ <button+ onClick={() => handleEdit(instance)}+ className="flex-1 sm:flex-none px-3 py-2 sm:py-1 bg-yellow-600 hover:bg-yellow-700 text-white text-sm rounded"+ >+ Edit+ </button>+ <button+ onClick={() => handleDeleteClick(instance.id)}+ className="flex-1 sm:flex-none px-3 py-2 sm:py-1 bg-red-600 hover:bg-red-700 text-white text-sm rounded"+ >+ Delete+ </button>+ </div>+ </div>- <div className="mt-6 sm:mt-8 bg-gray-800 rounded-lg p-4 sm:p-6">- <h2 className="text-base sm:text-lg font-bold text-white mb-3 sm:mb-4">Usage</h2>- <div className="space-y-2 text-xs sm:text-sm text-gray-300">- <p>1. Add one or more DataDog instances above</p>- <p>2. Go to Apps and enable DataDog monitoring in each app's settings</p>- <p>3. The error monitor job will periodically check for new errors:</p>- <ul className="list-disc list-inside ml-2 sm:ml-4 space-y-1 text-gray-400">- <li>Query DataDog for recent error events matching the app's service name</li>- <li>Surface new errors in notifications and app insights</li>- <li>Track error trends over time</li>- </ul>+ {testResults[instance.id] && testResults[instance.id].success !== undefined && (+ <div+ className={`mt-4 p-3 rounded ${+ testResults[instance.id].success+ ? 'bg-green-900 border border-green-700'+ : 'bg-red-900 border border-red-700'+ }`}+ >+ {testResults[instance.id].success ? (+ <p className="text-green-300 font-medium">API key validated</p>+ ) : (+ <>+ <p className="text-red-300 font-medium">Connection failed</p>+ <p className="text-red-400 text-sm mt-1">{testResults[instance.id].error}</p>+ </>+ )}+ </div>+ )}+ </div>+ ))+ )}</div></div></div>diff --git a/client/src/pages/GitHub.jsx b/client/src/pages/GitHub.jsxindex 69955b6343..267c2c7659 100644--- a/client/src/pages/GitHub.jsx+++ b/client/src/pages/GitHub.jsx@@ -165,7 +165,7 @@ export default function GitHub() {}return (- <div className="p-4 sm:p-6 max-w-6xl mx-auto">+ <div className="p-4 sm:p-6"><h1 className="text-xl sm:text-2xl font-bold text-white mb-6">GitHub Repos</h1>{/* Archive Confirmation Modal */}@@ -203,222 +203,226 @@ export default function GitHub() {</div>)}- {/* Secrets Management */}- <div className="bg-port-card rounded-lg border border-port-border p-4 sm:p-6 mb-6">- <h2 className="text-lg font-bold text-white mb-4">Secrets Management</h2>+ <div className="grid grid-cols-1 lg:grid-cols-[1fr_360px] gap-6 items-start">+ {/* Repo List */}+ <div className="bg-port-card rounded-lg border border-port-border p-4 sm:p-6 min-w-0">+ <div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 mb-4">+ <div className="flex items-center gap-3">+ <h2 className="text-lg font-bold text-white">Repositories</h2>+ {lastSync && (+ <span className="text-xs text-gray-500">Last sync: {timeAgo(lastSync)}</span>+ )}+ </div>+ <button+ onClick={handleSync}+ disabled={syncing}+ className="px-4 py-2 bg-port-accent hover:bg-port-accent/80 text-white rounded text-sm disabled:opacity-50"+ >+ {syncing ? 'Syncing...' : 'Sync Repos'}+ </button>+ </div>- {secretEntries.length > 0 && (- <div className="space-y-2 mb-4">- {secretEntries.map(([name, meta]) => (- <div key={name} className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 p-3 bg-port-bg rounded border border-port-border">- <div>- <span className="text-white font-mono text-sm">{name}</span>- <span className={`ml-2 text-xs ${meta.hasValue ? 'text-port-success' : 'text-port-warning'}`}>- {meta.hasValue ? 'configured' : 'no value'}- </span>- {meta.updatedAt && (- <span className="ml-2 text-xs text-gray-500">- updated {timeAgo(meta.updatedAt)}- </span>- )}- </div>+ {/* Search + Filter */}+ <div className="flex flex-col sm:flex-row gap-2 mb-4">+ <input+ type="text"+ value={search}+ onChange={(e) => setSearch(e.target.value)}+ placeholder="Search repos..."+ className="flex-1 px-3 py-2 bg-port-bg border border-port-border rounded text-white text-sm"+ />+ <div className="flex gap-1">+ {FILTERS.map(f => (<button- onClick={() => handleSyncSecret(name)}- disabled={syncingSecret === name || !meta.hasValue}- className="px-3 py-1 text-sm bg-port-accent hover:bg-port-accent/80 text-white rounded disabled:opacity-50"+ key={f}+ onClick={() => setFilter(f)}+ className={`px-3 py-2 text-sm rounded capitalize ${+ filter === f+ ? 'bg-port-accent text-white'+ : 'bg-port-bg text-gray-400 hover:text-white border border-port-border'+ }`}>- {syncingSecret === name ? 'Syncing...' : 'Sync to Repos'}+ {f === 'npm' ? 'NPM Projects' : f === 'secrets' ? 'Has Secrets' : f === 'archived' ? 'Archived' : 'All'}</button>- </div>- ))}- </div>- )}-- <div className="flex flex-col sm:flex-row gap-2">- <input- type="text"- value={newSecretName}- onChange={(e) => setNewSecretName(e.target.value.toUpperCase().replace(/[^A-Z0-9_]/g, ''))}- placeholder="SECRET_NAME"- className="flex-1 px-3 py-2 bg-port-bg border border-port-border rounded text-white font-mono text-sm"- />- <input- type="password"- value={newSecretValue}- onChange={(e) => setNewSecretValue(e.target.value)}- placeholder="Secret value"- className="flex-1 px-3 py-2 bg-port-bg border border-port-border rounded text-white text-sm"- />- <button- onClick={handleSaveSecret}- disabled={savingSecret || !newSecretName.trim() || !newSecretValue}- className="px-4 py-2 bg-port-success hover:bg-port-success/80 text-white rounded text-sm disabled:opacity-50"- >- {savingSecret ? 'Saving...' : 'Save Secret'}- </button>- </div>- <p className="text-xs text-gray-500 mt-2">- Secrets are stored locally and pushed to repos via <code>gh secret set</code>. Stored values are never returned from the server.- </p>- </div>-- {/* Repo List */}- <div className="bg-port-card rounded-lg border border-port-border p-4 sm:p-6 mb-6">- <div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 mb-4">- <div className="flex items-center gap-3">- <h2 className="text-lg font-bold text-white">Repositories</h2>- {lastSync && (- <span className="text-xs text-gray-500">Last sync: {timeAgo(lastSync)}</span>- )}- </div>- <button- onClick={handleSync}- disabled={syncing}- className="px-4 py-2 bg-port-accent hover:bg-port-accent/80 text-white rounded text-sm disabled:opacity-50"- >- {syncing ? 'Syncing...' : 'Sync Repos'}- </button>- </div>-- {/* Search + Filter */}- <div className="flex flex-col sm:flex-row gap-2 mb-4">- <input- type="text"- value={search}- onChange={(e) => setSearch(e.target.value)}- placeholder="Search repos..."- className="flex-1 px-3 py-2 bg-port-bg border border-port-border rounded text-white text-sm"- />- <div className="flex gap-1">- {FILTERS.map(f => (+ ))}<button- key={f}- onClick={() => setFilter(f)}- className={`px-3 py-2 text-sm rounded capitalize ${- filter === f- ? 'bg-port-accent text-white'- : 'bg-port-bg text-gray-400 hover:text-white border border-port-border'- }`}+ onClick={() => setSort(s => s === 'recent' ? 'alpha' : 'recent')}+ className="px-3 py-2 text-sm rounded bg-port-bg text-gray-400 hover:text-white border border-port-border"+ title={`Sort by ${sort === 'recent' ? 'name' : 'recent activity'}`}>- {f === 'npm' ? 'NPM Projects' : f === 'secrets' ? 'Has Secrets' : f === 'archived' ? 'Archived' : 'All'}+ {sort === 'recent' ? 'A-Z' : 'Recent'}</button>- ))}- <button- onClick={() => setSort(s => s === 'recent' ? 'alpha' : 'recent')}- className="px-3 py-2 text-sm rounded bg-port-bg text-gray-400 hover:text-white border border-port-border"- title={`Sort by ${sort === 'recent' ? 'name' : 'recent activity'}`}- >- {sort === 'recent' ? 'A-Z' : 'Recent'}- </button>+ </div></div>- </div>- {/* Repo count */}- <p className="text-xs text-gray-500 mb-3">- {repoList.length} repo{repoList.length !== 1 ? 's' : ''}- {filter !== 'all' ? ` (filtered)` : ''}- </p>+ {/* Repo count */}+ <p className="text-xs text-gray-500 mb-3">+ {repoList.length} repo{repoList.length !== 1 ? 's' : ''}+ {filter !== 'all' ? ` (filtered)` : ''}+ </p>- {Object.keys(repos).length === 0 ? (- <div className="text-center py-8">- <p className="text-gray-400">No repos loaded yet.</p>- <p className="text-gray-500 text-sm mt-1">Click "Sync Repos" to fetch from GitHub.</p>- </div>- ) : repoList.length === 0 ? (- <div className="text-center py-8">- <p className="text-gray-400">No repos match your filter.</p>- </div>- ) : (- <div className="space-y-1">- {repoList.map(repo => (- <div- key={repo.fullName}- className={`flex flex-col sm:flex-row sm:items-center gap-2 p-3 rounded border border-port-border ${- repo.isArchived ? 'opacity-50 bg-port-bg/50' : 'bg-port-bg'- }`}- >- <div className="flex-1 min-w-0">- <div className="flex items-center gap-2 flex-wrap">- <a- href={`https://github.com/${repo.fullName}`}- target="_blank"- rel="noopener noreferrer"- className="text-white text-sm font-medium hover:text-port-accent truncate"- >- {repo.name}- </a>- {repo.isPrivate && (- <span className="text-xs px-1.5 py-0.5 rounded bg-purple-900/50 text-purple-400 border border-purple-800">private</span>- )}- {repo.isFork && (+ {Object.keys(repos).length === 0 ? (+ <div className="text-center py-8">+ <p className="text-gray-400">No repos loaded yet.</p>+ <p className="text-gray-500 text-sm mt-1">Click "Sync Repos" to fetch from GitHub.</p>+ </div>+ ) : repoList.length === 0 ? (+ <div className="text-center py-8">+ <p className="text-gray-400">No repos match your filter.</p>+ </div>+ ) : (+ <div className="space-y-1">+ {repoList.map(repo => (+ <div+ key={repo.fullName}+ className={`flex flex-col sm:flex-row sm:items-center gap-2 p-3 rounded border border-port-border ${+ repo.isArchived ? 'opacity-50 bg-port-bg/50' : 'bg-port-bg'+ }`}+ >+ <div className="flex-1 min-w-0">+ <div className="flex items-center gap-2 flex-wrap"><a- href={`https://github.com/${repo.forkSource}`}+ href={`https://github.com/${repo.fullName}`}target="_blank"rel="noopener noreferrer"- className="text-xs px-1.5 py-0.5 rounded bg-cyan-900/50 text-cyan-400 border border-cyan-800 hover:bg-cyan-900/70"- title={`Forked from ${repo.forkSource}`}+ className="text-white text-sm font-medium hover:text-port-accent truncate">- fork: {repo.forkSource}+ {repo.name}</a>+ {repo.isPrivate && (+ <span className="text-xs px-1.5 py-0.5 rounded bg-purple-900/50 text-purple-400 border border-purple-800">private</span>+ )}+ {repo.isFork && (+ <a+ href={`https://github.com/${repo.forkSource}`}+ target="_blank"+ rel="noopener noreferrer"+ className="text-xs px-1.5 py-0.5 rounded bg-cyan-900/50 text-cyan-400 border border-cyan-800 hover:bg-cyan-900/70"+ title={`Forked from ${repo.forkSource}`}+ >+ fork: {repo.forkSource}+ </a>+ )}+ {repo.isArchived && (+ <span className="text-xs px-1.5 py-0.5 rounded bg-gray-700 text-gray-400">archived</span>+ )}+ {repo.flags?.npmProject && (+ <span className="text-xs px-1.5 py-0.5 rounded bg-red-900/50 text-red-400 border border-red-800">npm</span>+ )}+ {repo.managedSecrets?.map(s => (+ <span key={s} className="text-xs px-1.5 py-0.5 rounded bg-port-accent/10 text-port-accent border border-port-accent/30">+ {s}+ </span>+ ))}+ </div>+ {repo.description && (+ <p className="text-xs text-gray-500 mt-0.5 truncate">{repo.description}</p>)}- {repo.isArchived && (- <span className="text-xs px-1.5 py-0.5 rounded bg-gray-700 text-gray-400">archived</span>- )}- {repo.flags?.npmProject && (- <span className="text-xs px-1.5 py-0.5 rounded bg-red-900/50 text-red-400 border border-red-800">npm</span>+ </div>+ <div className="flex items-center gap-3 shrink-0">+ <span className="text-xs text-gray-500">{timeAgo(repo.pushedAt)}</span>+ {!repo.isArchived && (+ <label className="flex items-center gap-1.5 cursor-pointer">+ <input+ type="checkbox"+ checked={!!repo.flags?.npmProject}+ onChange={() => handleToggleNpm(repo.fullName, repo.flags?.npmProject)}+ className="w-4 h-4 rounded border-gray-600 bg-port-bg text-port-accent focus:ring-port-accent"+ />+ <span className="text-xs text-gray-400">NPM</span>+ </label>)}- {repo.managedSecrets?.map(s => (- <span key={s} className="text-xs px-1.5 py-0.5 rounded bg-port-accent/10 text-port-accent border border-port-accent/30">- {s}- </span>- ))}+ <button+ onClick={() => handleArchiveClick(repo.fullName, repo.isArchived)}+ disabled={archiving === repo.fullName}+ className={`px-2 py-1 text-xs rounded ${+ repo.isArchived+ ? 'bg-port-success/20 text-port-success hover:bg-port-success/30 border border-port-success/30'+ : 'bg-port-warning/20 text-port-warning hover:bg-port-warning/30 border border-port-warning/30'+ } disabled:opacity-50`}+ >+ {archiving === repo.fullName ? '...' : repo.isArchived ? 'Unarchive' : 'Archive'}+ </button></div>- {repo.description && (- <p className="text-xs text-gray-500 mt-0.5 truncate">{repo.description}</p>- )}- </div>- <div className="flex items-center gap-3 shrink-0">- <span className="text-xs text-gray-500">{timeAgo(repo.pushedAt)}</span>- {!repo.isArchived && (- <label className="flex items-center gap-1.5 cursor-pointer">- <input- type="checkbox"- checked={!!repo.flags?.npmProject}- onChange={() => handleToggleNpm(repo.fullName, repo.flags?.npmProject)}- className="w-4 h-4 rounded border-gray-600 bg-port-bg text-port-accent focus:ring-port-accent"- />- <span className="text-xs text-gray-400">NPM</span>- </label>- )}- <button- onClick={() => handleArchiveClick(repo.fullName, repo.isArchived)}- disabled={archiving === repo.fullName}- className={`px-2 py-1 text-xs rounded ${- repo.isArchived- ? 'bg-port-success/20 text-port-success hover:bg-port-success/30 border border-port-success/30'- : 'bg-port-warning/20 text-port-warning hover:bg-port-warning/30 border border-port-warning/30'- } disabled:opacity-50`}- >- {archiving === repo.fullName ? '...' : repo.isArchived ? 'Unarchive' : 'Archive'}- </button></div>+ ))}+ </div>+ )}+ </div>++ <div className="space-y-6">+ {/* Secrets Management */}+ <div className="bg-port-card rounded-lg border border-port-border p-4 sm:p-6">+ <h2 className="text-lg font-bold text-white mb-4">Secrets Management</h2>++ {secretEntries.length > 0 && (+ <div className="space-y-2 mb-4">+ {secretEntries.map(([name, meta]) => (+ <div key={name} className="flex flex-col gap-2 p-3 bg-port-bg rounded border border-port-border">+ <div>+ <span className="text-white font-mono text-sm">{name}</span>+ <span className={`ml-2 text-xs ${meta.hasValue ? 'text-port-success' : 'text-port-warning'}`}>+ {meta.hasValue ? 'configured' : 'no value'}+ </span>+ {meta.updatedAt && (+ <span className="ml-2 text-xs text-gray-500">+ updated {timeAgo(meta.updatedAt)}+ </span>+ )}+ </div>+ <button+ onClick={() => handleSyncSecret(name)}+ disabled={syncingSecret === name || !meta.hasValue}+ className="self-start px-3 py-1 text-sm bg-port-accent hover:bg-port-accent/80 text-white rounded disabled:opacity-50"+ >+ {syncingSecret === name ? 'Syncing...' : 'Sync to Repos'}+ </button>+ </div>+ ))}</div>- ))}+ )}++ <div className="flex flex-col gap-2">+ <input+ type="text"+ value={newSecretName}+ onChange={(e) => setNewSecretName(e.target.value.toUpperCase().replace(/[^A-Z0-9_]/g, ''))}+ placeholder="SECRET_NAME"+ className="px-3 py-2 bg-port-bg border border-port-border rounded text-white font-mono text-sm"+ />+ <input+ type="password"+ value={newSecretValue}+ onChange={(e) => setNewSecretValue(e.target.value)}+ placeholder="Secret value"+ className="px-3 py-2 bg-port-bg border border-port-border rounded text-white text-sm"+ />+ <button+ onClick={handleSaveSecret}+ disabled={savingSecret || !newSecretName.trim() || !newSecretValue}+ className="px-4 py-2 bg-port-success hover:bg-port-success/80 text-white rounded text-sm disabled:opacity-50"+ >+ {savingSecret ? 'Saving...' : 'Save Secret'}+ </button>+ </div>+ <p className="text-xs text-gray-500 mt-2">+ Secrets are stored locally and pushed to repos via <code>gh secret set</code>. Stored values are never returned from the server.+ </p></div>- )}- </div>- {/* Info */}- <div className="bg-port-card rounded-lg border border-port-border p-4 sm:p-6">- <h2 className="text-base font-bold text-white mb-3">How it works</h2>- <div className="space-y-2 text-xs sm:text-sm text-gray-300">- <p>1. Click "Sync Repos" to fetch your GitHub repos via <code>gh repo list</code></p>- <p>2. Toggle "NPM" on repos that publish to npm — this auto-adds NPM_TOKEN to their managed secrets</p>- <p>3. Add secrets (like NPM_TOKEN) with their values — values are stored locally, never in the browser</p>- <p>4. Click "Sync to Repos" to push secrets to all flagged repos via <code>gh secret set</code></p>- <p className="text-gray-500 mt-2">- Requires <code>gh</code> CLI authenticated with repo and admin:org scope.- </p>+ {/* Info */}+ <div className="bg-port-card rounded-lg border border-port-border p-4 sm:p-6">+ <h2 className="text-base font-bold text-white mb-3">How it works</h2>+ <div className="space-y-2 text-xs sm:text-sm text-gray-300">+ <p>1. Click "Sync Repos" to fetch your GitHub repos via <code>gh repo list</code></p>+ <p>2. Toggle "NPM" on repos that publish to npm — this auto-adds NPM_TOKEN to their managed secrets</p>+ <p>3. Add secrets (like NPM_TOKEN) with their values — values are stored locally, never in the browser</p>+ <p>4. Click "Sync to Repos" to push secrets to all flagged repos via <code>gh secret set</code></p>+ <p className="text-gray-500 mt-2">+ Requires <code>gh</code> CLI authenticated with repo and admin:org scope.+ </p>+ </div>+ </div></div></div></div>diff --git a/client/src/pages/Jira.jsx b/client/src/pages/Jira.jsxindex 1004f45042..de0900cc95 100644--- a/client/src/pages/Jira.jsx+++ b/client/src/pages/Jira.jsx@@ -184,7 +184,7 @@ export default function Jira() {}return (- <div className="p-4 sm:p-6 max-w-6xl mx-auto">+ <div className="p-4 sm:p-6"><div className="flex flex-col sm:flex-row sm:justify-between sm:items-center gap-4 mb-6"><h1 className="text-xl sm:text-2xl font-bold text-white">JIRA Integration</h1><div className="flex items-center gap-2">@@ -231,222 +231,226 @@ export default function Jira() {</div>)}- {editingInstance ? (- <div className="bg-gray-800 rounded-lg p-4 sm:p-6 mb-6">- <h2 className="text-lg sm:text-xl font-bold text-white mb-4">- {editingInstance === 'new' ? 'Add' : 'Edit'} JIRA Instance- </h2>-- {saveError && (- <div className="mb-4 p-3 bg-red-900 border border-red-700 rounded">- <p className="text-red-300 font-medium">Error saving JIRA instance</p>- <p className="text-red-400 text-sm mt-1">{saveError}</p>- </div>- )}-- <div className="space-y-4">- <div>- <label className="block text-sm font-medium text-gray-300 mb-1">- Instance ID- </label>- <input- type="text"- name="id"- value={formData.id}- onChange={handleInputChange}- disabled={editingInstance !== 'new'}- className="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded text-white disabled:opacity-50"- placeholder="e.g., company-jira"- />- <p className="text-xs text-gray-400 mt-1">- Unique identifier (cannot be changed after creation)- </p>- </div>+ <div className="grid grid-cols-1 lg:grid-cols-[1fr_360px] gap-6 items-start">+ <div className="space-y-6 min-w-0">+ {editingInstance ? (+ <div className="bg-gray-800 rounded-lg p-4 sm:p-6">+ <h2 className="text-lg sm:text-xl font-bold text-white mb-4">+ {editingInstance === 'new' ? 'Add' : 'Edit'} JIRA Instance+ </h2>++ {saveError && (+ <div className="mb-4 p-3 bg-red-900 border border-red-700 rounded">+ <p className="text-red-300 font-medium">Error saving JIRA instance</p>+ <p className="text-red-400 text-sm mt-1">{saveError}</p>+ </div>+ )}- <div>- <label className="block text-sm font-medium text-gray-300 mb-1">- Display Name- </label>- <input- type="text"- name="name"- value={formData.name}- onChange={handleInputChange}- className="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded text-white"- placeholder="e.g., Company JIRA"- />- </div>+ <div className="space-y-4">+ <div>+ <label className="block text-sm font-medium text-gray-300 mb-1">+ Instance ID+ </label>+ <input+ type="text"+ name="id"+ value={formData.id}+ onChange={handleInputChange}+ disabled={editingInstance !== 'new'}+ className="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded text-white disabled:opacity-50"+ placeholder="e.g., company-jira"+ />+ <p className="text-xs text-gray-400 mt-1">+ Unique identifier (cannot be changed after creation)+ </p>+ </div>- <div>- <label className="block text-sm font-medium text-gray-300 mb-1">- Base URL- </label>- <input- type="url"- name="baseUrl"- value={formData.baseUrl}- onChange={handleInputChange}- className="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded text-white"- placeholder="https://jira.example.com"- />- </div>+ <div>+ <label className="block text-sm font-medium text-gray-300 mb-1">+ Display Name+ </label>+ <input+ type="text"+ name="name"+ value={formData.name}+ onChange={handleInputChange}+ className="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded text-white"+ placeholder="e.g., Company JIRA"+ />+ </div>- <div>- <label className="block text-sm font-medium text-gray-300 mb-1">- </label>- <input- type="email"- name="email"- value={formData.email}- onChange={handleInputChange}- className="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded text-white"- placeholder="[email protected]"- />- </div>+ <div>+ <label className="block text-sm font-medium text-gray-300 mb-1">+ Base URL+ </label>+ <input+ type="url"+ name="baseUrl"+ value={formData.baseUrl}+ onChange={handleInputChange}+ className="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded text-white"+ placeholder="https://jira.example.com"+ />+ </div>- <div>- <label className="block text-sm font-medium text-gray-300 mb-1">- API Token (Personal Access Token)- </label>- <input- type="password"- name="apiToken"- value={formData.apiToken}- onChange={handleInputChange}- className="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded text-white"- placeholder="Enter your JIRA Personal Access Token"- />- <p className="text-xs text-gray-400 mt-1">- Generate this from your JIRA profile → Personal Access Tokens- </p>- </div>+ <div>+ <label className="block text-sm font-medium text-gray-300 mb-1">+ </label>+ <input+ type="email"+ name="email"+ value={formData.email}+ onChange={handleInputChange}+ className="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded text-white"+ placeholder="[email protected]"+ />+ </div>- <div className="flex flex-col sm:flex-row gap-2">- <button- onClick={handleSave}- disabled={saving || !formData.name || !formData.baseUrl || !formData.email || !formData.apiToken}- className="w-full sm:w-auto px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded disabled:opacity-50 disabled:cursor-not-allowed"- >- {saving ? 'Saving...' : 'Save'}- </button>- <button- onClick={handleCancel}- disabled={saving}- className="w-full sm:w-auto px-4 py-2 bg-gray-600 hover:bg-gray-700 text-white rounded disabled:opacity-50"- >- Cancel- </button>- </div>- </div>- </div>- ) : null}-- <div className="space-y-4">- {Object.values(instances).length === 0 ? (- <div className="bg-gray-800 rounded-lg p-8 text-center">- <p className="text-gray-400">No JIRA instances configured.</p>- <p className="text-gray-500 text-sm mt-2">- Add a JIRA instance to enable ticket creation for your apps.- </p>- </div>- ) : (- Object.values(instances).map((instance) => (- <div key={instance.id} className="bg-gray-800 rounded-lg p-4 sm:p-6">- <div className="flex flex-col sm:flex-row sm:justify-between sm:items-start gap-4">- <div className="flex-1 min-w-0">- <h3 className="text-lg font-bold text-white truncate">{instance.name}</h3>- <p className="text-gray-400 text-sm mt-1 break-all">{instance.baseUrl}</p>- <p className="text-gray-500 text-sm truncate">Email: {instance.email}</p>- <p className="text-gray-500 text-sm">- API Token: {instance.hasApiToken ? '✓ Configured' : '✗ Not set'}+ <div>+ <label className="block text-sm font-medium text-gray-300 mb-1">+ API Token (Personal Access Token)+ </label>+ <input+ type="password"+ name="apiToken"+ value={formData.apiToken}+ onChange={handleInputChange}+ className="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded text-white"+ placeholder="Enter your JIRA Personal Access Token"+ />+ <p className="text-xs text-gray-400 mt-1">+ Generate this from your JIRA profile → Personal Access Tokens</p>- {instance.hasApiToken && (() => {- const expiry = getTokenExpiry(instance.tokenUpdatedAt);- if (!expiry) return (- <p className="text-yellow-400 text-sm mt-1">- Token age unknown — re-save to start tracking expiry- </p>- );- if (expiry.daysLeft <= 0) return (- <p className="text-red-400 text-sm font-medium mt-1">- Token likely expired — regenerate your PAT- </p>- );- if (expiry.daysLeft <= TOKEN_WARN_DAYS) return (- <p className="text-yellow-400 text-sm font-medium mt-1">- Token expires in {expiry.daysLeft} day{expiry.daysLeft !== 1 ? 's' : ''} — regenerate soon- </p>- );- return null;- })()}</div>- <div className="flex flex-wrap gap-2 sm:flex-nowrap">- <button- onClick={() => handleTest(instance.id)}- disabled={testingInstance === instance.id}- className="flex-1 sm:flex-none px-3 py-2 sm:py-1 bg-blue-600 hover:bg-blue-700 text-white text-sm rounded disabled:opacity-50"- >- {testingInstance === instance.id ? 'Testing...' : 'Test'}- </button>+ <div className="flex flex-col sm:flex-row gap-2"><button- onClick={() => handleEdit(instance)}- className="flex-1 sm:flex-none px-3 py-2 sm:py-1 bg-yellow-600 hover:bg-yellow-700 text-white text-sm rounded"+ onClick={handleSave}+ disabled={saving || !formData.name || !formData.baseUrl || !formData.email || !formData.apiToken}+ className="w-full sm:w-auto px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded disabled:opacity-50 disabled:cursor-not-allowed">- Edit+ {saving ? 'Saving...' : 'Save'}</button><button- onClick={() => handleDeleteClick(instance.id)}- className="flex-1 sm:flex-none px-3 py-2 sm:py-1 bg-red-600 hover:bg-red-700 text-white text-sm rounded"+ onClick={handleCancel}+ disabled={saving}+ className="w-full sm:w-auto px-4 py-2 bg-gray-600 hover:bg-gray-700 text-white rounded disabled:opacity-50">- Delete+ Cancel</button></div></div>+ </div>+ ) : null}++ <div className="bg-gray-800 rounded-lg p-4 sm:p-6">+ <h2 className="text-base sm:text-lg font-bold text-white mb-3 sm:mb-4">Usage</h2>+ <div className="space-y-2 text-xs sm:text-sm text-gray-300">+ <p>1. Add one or more JIRA instances above</p>+ <p>2. Go to Apps and configure JIRA settings for each app</p>+ <p>+ 3. When the Chief of Staff works on an app with JIRA enabled, it will:+ </p>+ <ul className="list-disc list-inside ml-2 sm:ml-4 space-y-1 text-gray-400">+ <li>Create a JIRA ticket for the work</li>+ <li>Create a feature branch (e.g., feature/PROJ-1234)</li>+ <li>Make commits to that branch</li>+ <li>Create a pull request with ticket link</li>+ </ul>+ </div>+ </div>+ </div>- {testResult && testResult.success !== undefined && (- <div- className={`mt-4 p-3 rounded ${- testResult.success- ? 'bg-green-900 border border-green-700'- : 'bg-red-900 border border-red-700'- }`}- >- {testResult.success ? (- <div>- <p className="text-green-300 font-medium">✓ Connection successful</p>- <p className="text-green-400 text-sm mt-1">- Authenticated as: {testResult.user} ({testResult.email})- </p>- </div>- ) : (- <div>- <p className="text-red-300 font-medium">✗ Connection failed</p>- <p className="text-red-400 text-sm mt-1">{testResult.error}</p>- </div>- )}- </div>- )}+ <div className="space-y-4">+ {Object.values(instances).length === 0 ? (+ <div className="bg-gray-800 rounded-lg p-8 text-center">+ <p className="text-gray-400">No JIRA instances configured.</p>+ <p className="text-gray-500 text-sm mt-2">+ Add a JIRA instance to enable ticket creation for your apps.+ </p></div>- ))- )}- </div>+ ) : (+ Object.values(instances).map((instance) => (+ <div key={instance.id} className="bg-gray-800 rounded-lg p-4 sm:p-6">+ <div className="flex flex-col gap-4">+ <div className="flex-1 min-w-0">+ <h3 className="text-lg font-bold text-white truncate">{instance.name}</h3>+ <p className="text-gray-400 text-sm mt-1 break-all">{instance.baseUrl}</p>+ <p className="text-gray-500 text-sm truncate">Email: {instance.email}</p>+ <p className="text-gray-500 text-sm">+ API Token: {instance.hasApiToken ? '✓ Configured' : '✗ Not set'}+ </p>+ {instance.hasApiToken && (() => {+ const expiry = getTokenExpiry(instance.tokenUpdatedAt);+ if (!expiry) return (+ <p className="text-yellow-400 text-sm mt-1">+ Token age unknown — re-save to start tracking expiry+ </p>+ );+ if (expiry.daysLeft <= 0) return (+ <p className="text-red-400 text-sm font-medium mt-1">+ Token likely expired — regenerate your PAT+ </p>+ );+ if (expiry.daysLeft <= TOKEN_WARN_DAYS) return (+ <p className="text-yellow-400 text-sm font-medium mt-1">+ Token expires in {expiry.daysLeft} day{expiry.daysLeft !== 1 ? 's' : ''} — regenerate soon+ </p>+ );+ return null;+ })()}+ </div>++ <div className="flex flex-wrap gap-2">+ <button+ onClick={() => handleTest(instance.id)}+ disabled={testingInstance === instance.id}+ className="flex-1 sm:flex-none px-3 py-2 sm:py-1 bg-blue-600 hover:bg-blue-700 text-white text-sm rounded disabled:opacity-50"+ >+ {testingInstance === instance.id ? 'Testing...' : 'Test'}+ </button>+ <button+ onClick={() => handleEdit(instance)}+ className="flex-1 sm:flex-none px-3 py-2 sm:py-1 bg-yellow-600 hover:bg-yellow-700 text-white text-sm rounded"+ >+ Edit+ </button>+ <button+ onClick={() => handleDeleteClick(instance.id)}+ className="flex-1 sm:flex-none px-3 py-2 sm:py-1 bg-red-600 hover:bg-red-700 text-white text-sm rounded"+ >+ Delete+ </button>+ </div>+ </div>- <div className="mt-6 sm:mt-8 bg-gray-800 rounded-lg p-4 sm:p-6">- <h2 className="text-base sm:text-lg font-bold text-white mb-3 sm:mb-4">Usage</h2>- <div className="space-y-2 text-xs sm:text-sm text-gray-300">- <p>1. Add one or more JIRA instances above</p>- <p>2. Go to Apps and configure JIRA settings for each app</p>- <p>- 3. When the Chief of Staff works on an app with JIRA enabled, it will:- </p>- <ul className="list-disc list-inside ml-2 sm:ml-4 space-y-1 text-gray-400">- <li>Create a JIRA ticket for the work</li>- <li>Create a feature branch (e.g., feature/PROJ-1234)</li>- <li>Make commits to that branch</li>- <li>Create a pull request with ticket link</li>- </ul>+ {testResult && testResult.success !== undefined && (+ <div+ className={`mt-4 p-3 rounded ${+ testResult.success+ ? 'bg-green-900 border border-green-700'+ : 'bg-red-900 border border-red-700'+ }`}+ >+ {testResult.success ? (+ <div>+ <p className="text-green-300 font-medium">✓ Connection successful</p>+ <p className="text-green-400 text-sm mt-1">+ Authenticated as: {testResult.user} ({testResult.email})+ </p>+ </div>+ ) : (+ <div>+ <p className="text-red-300 font-medium">✗ Connection failed</p>+ <p className="text-red-400 text-sm mt-1">{testResult.error}</p>+ </div>+ )}+ </div>+ )}+ </div>+ ))+ )}</div></div></div>