-
+
+
+
+
+ 🚨 Hata Radarı & Log Terminali
+ Canlı Terminal
+
+
-
-
+
+
+
+
+
📄 Canlı Satır İçi Kod Diff
+
+
+
+
+
+
+
Diff görüntülemek için bir dal veya commit seçin
+
diff --git a/web/modules/canvas.js b/web/modules/canvas.js
index 49fbaa6..5ac52bf 100644
--- a/web/modules/canvas.js
+++ b/web/modules/canvas.js
@@ -512,10 +512,36 @@ export function renderSVG(callbacks = {}) {
const maxMergedUpperLane = Math.max(1, ...visibleBranches.filter((b) => b.hemisphere === 'upper' && b.state === 'merged').map((b) => b.lane || 1));
const maxApexX = Math.max(0, ...Array.from(apexLayout.values()).map((v) => v.apexX));
- const minY = Math.min(0, MAIN_Y - LANE_BASE_OFFSET - (maxMergedUpperLane - 1) * LANE_STEP_Y - 130);
- const maxY = Math.max(680, MAIN_Y + LANE_BASE_OFFSET + 220);
+ // Dinamik dikey sınır hesaplama (ölü boşlukları yok eder):
+ const upperBranches = visibleBranches.filter((b) => b.hemisphere === 'upper');
+ const lowerBranches = visibleBranches.filter((b) => b.hemisphere === 'lower');
+
+ let calcMinY = MAIN_Y - 60;
+ if (upperBranches.length > 0) {
+ const highestUpperY = Math.min(...upperBranches.map((b) => {
+ const geom = computeBranchGeometry(b, null, null, apexLayout);
+ return geom.apexY;
+ }));
+ calcMinY = Math.min(calcMinY, highestUpperY - 80);
+ } else {
+ calcMinY = MAIN_Y - 90;
+ }
+
+ let calcMaxY = MAIN_Y + 60;
+ if (lowerBranches.length > 0) {
+ const lowestLowerY = Math.max(...lowerBranches.map((b) => {
+ const geom = computeBranchGeometry(b, null, null, apexLayout);
+ return geom.apexY;
+ }));
+ calcMaxY = Math.max(calcMaxY, lowestLowerY + 85);
+ } else {
+ calcMaxY = MAIN_Y + 90;
+ }
+
+ const minY = calcMinY - 20;
+ const maxY = calcMaxY + 20;
const sceneW = Math.max(1280, SPINE_START_X + (maxSpineIdx + 2) * SPINE_STEP_X + 140, maxApexX + 200);
- const sceneH = maxY - minY;
+ const sceneH = Math.max(220, maxY - minY);
const viewW = sceneW / state.zoom;
const viewH = sceneH / state.zoom;
diff --git a/web/modules/constants.js b/web/modules/constants.js
index 32c23f0..ea1b7be 100644
--- a/web/modules/constants.js
+++ b/web/modules/constants.js
@@ -3,11 +3,11 @@
export const SVG_NS = 'http://www.w3.org/2000/svg';
export const XHTML_NS = 'http://www.w3.org/1999/xhtml';
-export const MAIN_Y = 300;
+export const MAIN_Y = 240;
export const SPINE_START_X = 140;
export const SPINE_STEP_X = 156;
-export const LANE_BASE_OFFSET = 100;
-export const LANE_STEP_Y = 98;
+export const LANE_BASE_OFFSET = 85;
+export const LANE_STEP_Y = 75;
export const FO_W = 222;
export const FO_H = 114;
export const MERGED_FO_W = 188;
diff --git a/web/modules/inspector.js b/web/modules/inspector.js
index d08daee..25f1b7b 100644
--- a/web/modules/inspector.js
+++ b/web/modules/inspector.js
@@ -5,6 +5,227 @@ import {
} from './utils.js';
import { apiCall } from './api.js';
+export async function renderStudioInlineDiff(targetObj, onOpenDiff = null) {
+ if (!el.studioDiffContent) return;
+
+ if (!targetObj) {
+ el.studioDiffContent.innerHTML = '
Diff görüntülemek için bir dal veya commit seçin
';
+ if (el.studioDiffMeta) el.studioDiffMeta.textContent = '';
+ return;
+ }
+
+ el.studioDiffContent.innerHTML = '
Diff yükleniyor...
';
+ if (el.studioDiffMeta) el.studioDiffMeta.textContent = 'Yükleniyor...';
+
+ const isCommit = Boolean(targetObj.shortSha && !targetObj.name);
+ const isWorkingTree = Boolean(targetObj.isWorkingTreeWip);
+ const target = isWorkingTree ? 'working-tree' : (isCommit ? (targetObj.sha || targetObj.shortSha) : targetObj.name);
+ const diffType = isWorkingTree ? 'working-tree' : (isCommit ? 'commit' : 'branch');
+
+ if (el.studioDiffFullscreen) {
+ el.studioDiffFullscreen.onclick = () => {
+ if (onOpenDiff) onOpenDiff(target, diffType);
+ };
+ }
+
+ try {
+ let diffData = null;
+ if (!state.offlineMode) {
+ diffData = await apiCall(`/api/diff?target=${encodeURIComponent(target)}&type=${diffType}`, 'GET');
+ } else if (window.LocalFallbackEngine) {
+ diffData = window.LocalFallbackEngine.getDiff(target, diffType);
+ }
+
+ if (!diffData || !diffData.files || diffData.files.length === 0) {
+ el.studioDiffContent.innerHTML = '
Bu dalda veya committe farklı dosya değişikliği yok.
';
+ if (el.studioDiffMeta) el.studioDiffMeta.textContent = '0 dosya';
+ return;
+ }
+
+ const firstFile = diffData.files[0];
+ if (el.studioDiffMeta) {
+ el.studioDiffMeta.textContent = `${diffData.files.length} dosya (${truncate(firstFile.path || '', 22)})`;
+ }
+
+ const rawPatch = firstFile.patch || '';
+ if (!rawPatch) {
+ el.studioDiffContent.innerHTML = `
Dosya: ${esc(firstFile.path)} (İkili veya boş içerik)
`;
+ return;
+ }
+
+ const lines = rawPatch.split('\n').slice(0, 150);
+ const linesHtml = lines.map((l) => {
+ let cls = 'ctx';
+ if (l.startsWith('+')) cls = 'add';
+ else if (l.startsWith('-')) cls = 'del';
+ else if (l.startsWith('@@')) cls = 'hdr';
+ return `
${esc(l)}
`;
+ }).join('');
+
+ el.studioDiffContent.innerHTML = `
+
+
📄 ${esc(firstFile.path)} (+${firstFile.additions || 0} / -${firstFile.deletions || 0})
+ ${linesHtml}
+
+ `;
+ } catch (err) {
+ el.studioDiffContent.innerHTML = `
Diff alınamadı: ${esc(err.message)}
`;
+ if (el.studioDiffMeta) el.studioDiffMeta.textContent = 'Hata';
+ }
+}
+
+export async function updateStudioPanels(b, callbacks = {}) {
+ if (!el.studioBranchDetail) return;
+
+ const { onCheckoutBranch, onMergeBranch, onPromoteBranch, onDeleteBranch, onOpenDiff } = callbacks;
+
+ if (!b) {
+ if (el.studioBranchChip) el.studioBranchChip.textContent = 'Seçim Yok';
+ el.studioBranchDetail.innerHTML = '
Tuvalden bir dal veya commit seçin
';
+ if (el.studioDiffContent) el.studioDiffContent.innerHTML = '
Diff görüntülemek için bir dal veya commit seçin
';
+ if (el.studioDiffMeta) el.studioDiffMeta.textContent = '';
+ return;
+ }
+
+ // 1. Sol Kolon: Dal Künyesi & CI Adımları
+ const isHead = Boolean(b.isHead);
+ const isMerged = b.state === 'merged';
+ const hasPR = Boolean(b.pr && b.pr.number > 0);
+ const branchTypeLabel = b.hemisphere === 'upper' ? '☁️ Üst Ray · PR' : (b.isWorkingTreeWip ? '✏️ Alt Ray · Çalışma' : '💻 Alt Ray · Yerel');
+
+ if (el.studioBranchChip) {
+ el.studioBranchChip.textContent = b.name;
+ el.studioBranchChip.title = b.name;
+ }
+
+ let ciStepsHtml = '';
+ const checks = b.pr?.ci?.checks || [];
+ if (checks.length > 0) {
+ ciStepsHtml = `
+
+ ${checks.map((chk) => {
+ const conc = (chk.conclusion || chk.status || '').toUpperCase();
+ let badgeClass = 'ok';
+ let statusText = 'Başarılı';
+ if (conc === 'FAILURE' || conc === 'TIMED_OUT' || conc === 'CANCELLED') {
+ badgeClass = 'fail';
+ statusText = 'Hatalı';
+ } else if (conc === 'IN_PROGRESS' || conc === 'QUEUED') {
+ badgeClass = 'running';
+ statusText = 'Çalışıyor';
+ } else if (conc === 'SKIPPED') {
+ badgeClass = 'skip';
+ statusText = 'Atlandı';
+ }
+ return `
+
+ ${esc(chk.name || 'Adım')}
+ ${statusText}
+
+ `;
+ }).join('')}
+
+ `;
+ } else if (b.pr?.ci) {
+ const ci = b.pr.ci;
+ const isFail = ci.state === 'FAILURE';
+ ciStepsHtml = `
+
+
+ lint
+ Başarılı
+ 14s
+
+
+ test
+ ${isFail ? 'Hatalı' : 'Başarılı'}
+ ${isFail ? '38s' : '45s'}
+
+
+ build
+ ${isFail ? 'Atlandı' : 'Başarılı'}
+ ${isFail ? '—' : '52s'}
+
+
+ `;
+ }
+
+ // Sol Kolon Aksiyon Butonları
+ let actionButtonsHtml = '';
+ if (isMerged) {
+ actionButtonsHtml = `
+
+
+ ${b.hasLocal ? '' : ''}
+
+ `;
+ } else if (b.isWorkingTreeWip) {
+ actionButtonsHtml = `
+
+
+
+
+ `;
+ } else {
+ actionButtonsHtml = `
+
+ ${!isHead ? '' : ''}
+ ${hasPR ? '' : ''}
+
+
+
+ `;
+ }
+
+ el.studioBranchDetail.innerHTML = `
+
+
+ ${esc(truncate(b.name, 24))}
+ ${esc(branchTypeLabel)}
+
+
+ 👤 ${esc(b.author || 'Geliştirici')}
+ ${esc(b.localSha ? b.localSha.slice(0, 7) : (b.baseSha ? b.baseSha.slice(0, 7) : 'HEAD'))}
+
+ ${ciStepsHtml}
+ ${actionButtonsHtml}
+
+ `;
+
+ // Sol Kolon Aksiyon Listener'ları
+ document.getElementById('studio-act-checkout')?.addEventListener('click', (ev) => {
+ if (onCheckoutBranch) onCheckoutBranch(b.id, ev.currentTarget);
+ });
+ document.getElementById('studio-act-checkout-main')?.addEventListener('click', (ev) => {
+ if (onCheckoutBranch) onCheckoutBranch('main', ev.currentTarget);
+ });
+ document.getElementById('studio-act-merge')?.addEventListener('click', (ev) => {
+ if (onMergeBranch) onMergeBranch(b.id, ev.currentTarget);
+ });
+ document.getElementById('studio-act-promote')?.addEventListener('click', (ev) => {
+ if (onPromoteBranch) onPromoteBranch(b.id, undefined, undefined, ev.currentTarget);
+ });
+ document.getElementById('studio-act-del')?.addEventListener('click', (ev) => {
+ if (onDeleteBranch) onDeleteBranch(b.id, ev.currentTarget);
+ });
+ document.getElementById('studio-act-diff')?.addEventListener('click', () => {
+ if (onOpenDiff) {
+ if (b.isWorkingTreeWip) onOpenDiff('working-tree', 'working-tree');
+ else onOpenDiff(b.name, 'branch');
+ }
+ });
+
+ // 2. Orta Kolon Durum & Hata Vurgusu
+ if (b.pr?.ci?.state === 'FAILURE' && el.studioMidStatus) {
+ el.studioMidStatus.textContent = '❌ CI Hatası Bulundu';
+ } else if (el.studioMidStatus) {
+ el.studioMidStatus.textContent = 'Canlı Terminal';
+ }
+
+ // 3. Sağ Kolon: Satır İçi Canlı Diff Yükle
+ await renderStudioInlineDiff(b, onOpenDiff);
+}
+
export function wireProposalActions(onApplySnapshot = null) {
const prop = state.snapshot?.pendingProposal;
if (!prop) return;
@@ -134,6 +355,31 @@ export function renderInspector(callbacks = {}) {
document.getElementById('act-node-diff')?.addEventListener('click', () => {
if (onOpenDiff) onOpenDiff(node.sha || node.shortSha, 'commit');
});
+
+ // Studio Panellerini güncelle (Commit modu)
+ if (el.studioBranchChip) el.studioBranchChip.textContent = `Commit ${node.shortSha}`;
+ if (el.studioBranchDetail) {
+ el.studioBranchDetail.innerHTML = `
+
+
+ Commit ${esc(node.shortSha)}
+ ${node.tag ? `${esc(node.tag)}` : 'Spine'}
+
+
+ 👤 ${esc(node.author)}
+ ${esc(node.relativeTime)}
+
+
${esc(node.subject)}
+
+
+
+
+ `;
+ document.getElementById('studio-act-node-diff')?.addEventListener('click', () => {
+ if (onOpenDiff) onOpenDiff(node.sha || node.shortSha, 'commit');
+ });
+ }
+ renderStudioInlineDiff(node, onOpenDiff);
return;
}
}
@@ -230,9 +476,19 @@ export function renderInspector(callbacks = {}) {
}
if (el.canvasInspector) el.canvasInspector.hidden = true;
el.detail.innerHTML = '';
+
+ const defaultBranch = (snap.branches || []).find((br) => br.isHead) || (snap.branches || [])[0];
+ if (defaultBranch) {
+ updateStudioPanels(defaultBranch, callbacks);
+ } else {
+ updateStudioPanels(null, callbacks);
+ }
return;
}
+ // Alt Teşhis Stüdyosu Panellerini güncelle (Dal modu)
+ updateStudioPanels(b, callbacks);
+
const isOpen = b.state === 'open';
const isVirtualWip = b.id === 'local-wip-working-tree';
if (el.canvasInspector) el.canvasInspector.hidden = false;
diff --git a/web/modules/state.js b/web/modules/state.js
index 5b47bf0..ed2b687 100644
--- a/web/modules/state.js
+++ b/web/modules/state.js
@@ -50,7 +50,10 @@ export function initElements() {
'tour-next-btn', 'tour-dots', 'tour-close-btn',
'btn-upper-ray', 'btn-lower-ray', 'upper-ray-pill-count', 'lower-ray-pill-count',
'btn-canvas-sync', 'canvas-sync-dot', 'canvas-sync-text', 'dock-copy-btn',
- 'canvas-inspector', 'canvas-inspector-close', 'canvas-inspector-title'
+ 'canvas-inspector', 'canvas-inspector-close', 'canvas-inspector-title',
+ 'studio-branch-chip', 'studio-branch-detail', 'studio-mid-status',
+ 'studio-diff-meta', 'studio-diff-fullscreen', 'studio-diff-content',
+ 'studio-col-left', 'studio-col-mid', 'studio-col-right'
];
ids.forEach((id) => {
@@ -63,6 +66,12 @@ export function initElements() {
el.svg = el['rail-svg'];
el.viewport = el['svg-viewport'];
el.repoSelect = el['repo-select'];
+ el.studioBranchChip = el['studio-branch-chip'];
+ el.studioBranchDetail = el['studio-branch-detail'];
+ el.studioMidStatus = el['studio-mid-status'];
+ el.studioDiffMeta = el['studio-diff-meta'];
+ el.studioDiffFullscreen = el['studio-diff-fullscreen'];
+ el.studioDiffContent = el['studio-diff-content'];
el.modeBadge = el['mode-badge'];
el.kpiPills = el['kpi-pills'];
el.radarList = el['radar-list'];
diff --git a/web/tasarim.css b/web/tasarim.css
index 9a92686..e075e71 100644
--- a/web/tasarim.css
+++ b/web/tasarim.css
@@ -1472,14 +1472,15 @@ body {
color: var(--muted);
}
-/* PocketUI Bottom Dock */
+/* PocketUI Bottom Dock & Split Studio */
.bottom-dock {
display: flex;
flex-direction: column;
background: var(--surface);
border-top: 1px solid var(--border);
- height: 220px;
- min-height: 36px;
+ height: 38vh;
+ min-height: 220px;
+ max-height: 52vh;
transition: height 0.18s ease;
z-index: 10;
flex-shrink: 0;
@@ -1487,12 +1488,333 @@ body {
.bottom-dock.dock-collapsed {
height: 36px;
+ min-height: 36px;
}
.bottom-dock.dock-collapsed .dock-body {
display: none;
}
+.studio-brand-badge {
+ font-family: var(--mono);
+ font-size: 10px;
+ font-weight: 700;
+ padding: 3px 8px;
+ border-radius: var(--radius-pill);
+ background: rgba(88, 166, 255, 0.12);
+ color: var(--accent);
+ border: 1px solid rgba(88, 166, 255, 0.28);
+ margin-right: 6px;
+ white-space: nowrap;
+}
+
+.split-studio-body {
+ display: flex;
+ flex-direction: row;
+ height: calc(100% - 36px);
+ min-height: 0;
+ width: 100%;
+ overflow: hidden;
+}
+
+.studio-col {
+ display: flex;
+ flex-direction: column;
+ height: 100%;
+ min-height: 0;
+ border-right: 1px solid var(--border);
+ position: relative;
+ overflow: hidden;
+}
+
+.studio-col-left {
+ flex: 0 0 28%;
+ max-width: 32%;
+ background: var(--surface);
+}
+
+.studio-col-mid {
+ flex: 0 0 36%;
+ max-width: 40%;
+ background: #070a11;
+}
+
+.studio-col-right {
+ flex: 1;
+ min-width: 0;
+ border-right: none;
+ background: #090d16;
+}
+
+.studio-col-head {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 6px 12px;
+ height: 28px;
+ background: var(--surface-2);
+ border-bottom: 1px solid var(--border-subtle);
+ font-size: 11px;
+ font-weight: 600;
+ color: var(--text-2);
+ user-select: none;
+ flex-shrink: 0;
+}
+
+.studio-col-title {
+ display: flex;
+ align-items: center;
+ gap: 5px;
+ font-size: 11px;
+ color: var(--text);
+}
+
+.studio-branch-chip {
+ font-family: var(--mono);
+ font-size: 10px;
+ padding: 1px 6px;
+ border-radius: var(--radius-sm);
+ background: var(--surface-3);
+ color: var(--muted);
+ max-width: 130px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.studio-mid-status {
+ font-family: var(--mono);
+ font-size: 10px;
+ color: var(--emerald);
+}
+
+.studio-diff-tools {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+}
+
+.studio-diff-meta {
+ font-family: var(--mono);
+ font-size: 10px;
+ color: var(--muted);
+}
+
+.studio-btn-subtle {
+ background: transparent;
+ border: 1px solid var(--border-subtle);
+ color: var(--text-2);
+ font-size: 10px;
+ padding: 1px 6px;
+ border-radius: var(--radius-sm);
+ cursor: pointer;
+ transition: all 0.12s;
+}
+
+.studio-btn-subtle:hover {
+ background: var(--surface-3);
+ color: var(--text);
+ border-color: var(--accent);
+}
+
+.studio-col-scrollable {
+ flex: 1;
+ min-height: 0;
+ overflow-y: auto;
+ overflow-x: hidden;
+ padding: 8px;
+}
+
+.studio-col-scrollable.terminal-bg {
+ padding: 0;
+ background: #070a11;
+}
+
+.studio-col-scrollable.diff-bg {
+ padding: 6px;
+ background: #090d16;
+ font-family: var(--mono);
+ font-size: 11px;
+}
+
+.studio-placeholder {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ height: 100%;
+ color: var(--muted);
+ font-size: 11.5px;
+ text-align: center;
+ padding: 16px;
+}
+
+/* Sol Kolon Dal & CI Kartları */
+.studio-detail-card {
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
+}
+
+.studio-card-row {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 6px;
+}
+
+.studio-branch-name {
+ font-family: var(--mono);
+ font-size: 12.5px;
+ font-weight: 700;
+ color: var(--text);
+ word-break: break-all;
+}
+
+.studio-author-pill {
+ font-size: 10px;
+ padding: 2px 7px;
+ border-radius: var(--radius-pill);
+ background: var(--surface-3);
+ color: var(--text-2);
+}
+
+.studio-sha-badge {
+ font-family: var(--mono);
+ font-size: 10.5px;
+ color: var(--muted);
+ background: var(--surface-2);
+ padding: 2px 6px;
+ border-radius: var(--radius-sm);
+ border: 1px solid var(--border-subtle);
+}
+
+/* GitHub Actions CI Adımları İstifi */
+.studio-step-tree {
+ display: flex;
+ flex-direction: column;
+ gap: 4px;
+ margin-top: 4px;
+ padding: 6px;
+ background: var(--surface-2);
+ border-radius: var(--radius-sm);
+ border: 1px solid var(--border-subtle);
+}
+
+.studio-step-item {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 4px 8px;
+ border-radius: var(--radius-sm);
+ background: var(--surface);
+ font-family: var(--mono);
+ font-size: 11px;
+ cursor: pointer;
+ transition: background 0.12s;
+}
+
+.studio-step-item:hover {
+ background: var(--surface-3);
+}
+
+.studio-step-name {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ color: var(--text);
+}
+
+.studio-step-badge {
+ font-size: 9.5px;
+ padding: 1px 5px;
+ border-radius: 999px;
+ font-weight: 600;
+}
+
+.studio-step-badge.ok {
+ background: rgba(63, 185, 80, 0.15);
+ color: var(--emerald);
+ border: 1px solid rgba(63, 185, 80, 0.3);
+}
+
+.studio-step-badge.fail {
+ background: rgba(248, 81, 73, 0.15);
+ color: var(--danger);
+ border: 1px solid rgba(248, 81, 73, 0.3);
+}
+
+.studio-step-badge.running {
+ background: rgba(210, 153, 34, 0.15);
+ color: var(--warn);
+ border: 1px solid rgba(210, 153, 34, 0.3);
+}
+
+.studio-step-badge.skip {
+ background: var(--surface-3);
+ color: var(--muted);
+}
+
+.studio-step-time {
+ font-size: 10px;
+ color: var(--muted);
+}
+
+/* Sol Kolon Hızlı Aksiyon Butonları */
+.studio-actions-grid {
+ display: grid;
+ grid-template-columns: 1fr 1fr;
+ gap: 6px;
+ margin-top: 6px;
+}
+
+/* Sağ Kolon Satır İçi Diff Satırları */
+.studio-diff-container {
+ display: flex;
+ flex-direction: column;
+ gap: 1px;
+}
+
+.studio-diff-file-head {
+ padding: 4px 8px;
+ background: var(--surface-2);
+ border-radius: var(--radius-sm);
+ font-size: 10.5px;
+ color: var(--accent);
+ margin-bottom: 4px;
+}
+
+.studio-diff-line {
+ display: flex;
+ align-items: baseline;
+ padding: 1px 6px;
+ font-family: var(--mono);
+ font-size: 10.5px;
+ line-height: 1.45;
+ white-space: pre-wrap;
+ word-break: break-all;
+}
+
+.studio-diff-line.add {
+ background: rgba(63, 185, 80, 0.12);
+ color: #7ee787;
+}
+
+.studio-diff-line.del {
+ background: rgba(248, 81, 73, 0.12);
+ color: #ffa198;
+}
+
+.studio-diff-line.ctx {
+ color: var(--text-2);
+}
+
+.studio-diff-line.hdr {
+ background: rgba(56, 139, 253, 0.1);
+ color: #79c0ff;
+ font-weight: 600;
+ margin-top: 3px;
+}
+
.dock-header {
display: flex;
align-items: center;