Files
Gitpub-Desktop/frontend/css/components.css
T
andrew 346f8536f0 Add local repository scanning and UI
Implement local repository scanning end-to-end. Frontend: add UI (toolbar, local-scan panel, list/cards), CSS styles, icons, new state fields, and templates; convert recent repo items to buttons and wire up actions to select, view and open scanned repos. JS: add helper utilities (repoNameFromPath, normalizeRemoteUrl, serverRepoRemoteUrls), scanForLocalRepos/selectLocalRepo functions, render template for scan results, and call scanLocalRepos via tauri-api. Tauri API: expose scan_local_repos (tauri command) in tauri-api.js. Backend (Rust): add LocalRepoCandidate type and a scanner implementation that walks configurable/default roots, deduplicates paths, matches local remotes against allowed server URLs, enforces depth/result limits, and returns matched candidates; register scan_local_repos in the command list. Includes error handling and user-facing messages for missing roots or remotes.
2026-05-10 14:32:41 +12:00

927 lines
16 KiB
CSS

#app {
width: 100%;
height: 100%;
}
.layout {
display: grid;
grid-template-columns: 260px 1fr 320px;
width: 100%;
height: 100%;
gap: 0;
}
.sidebar,
.rightbar {
background: var(--bg-panel);
border-right: 1px solid var(--border);
}
.sidebar {
padding: 16px 12px;
overflow-y: auto;
}
.rightbar {
border-right: 0;
border-left: 1px solid var(--border);
padding: 0 12px 12px;
overflow-y: auto;
}
.main {
padding: 16px;
overflow: auto;
background: var(--bg-app);
}
.panel {
border: 1px solid var(--border);
border-radius: var(--radius-lg);
background: var(--bg-panel);
box-shadow: var(--shadow);
padding: 16px;
}
.stack {
display: flex;
flex-direction: column;
gap: 12px;
}
.row {
display: flex;
gap: 8px;
}
.row.wrap {
flex-wrap: wrap;
}
.row.end {
justify-content: flex-end;
}
.server-chip,
.repo-card {
border: 1px solid var(--border);
border-radius: var(--radius-md);
padding: 12px;
background: var(--bg-panel);
transition: border-color 0.1s ease;
}
.repo-card:hover {
border-color: #8b949e;
}
.repo-grid {
display: grid;
gap: 10px;
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.repo-filter-pills {
display: flex;
gap: 6px;
flex-wrap: wrap;
}
.pill-btn {
padding: 4px 14px;
border-radius: 999px;
border: 1px solid var(--border);
background: transparent;
color: var(--text-muted);
font-size: 13px;
cursor: pointer;
transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.pill-btn:hover {
background: var(--bg-hover);
color: var(--text-main);
border-color: #8b949e;
}
.pill-btn.active {
background: var(--accent-strong);
border-color: rgba(240, 246, 252, 0.1);
color: #fff;
}
.org-group {
gap: 8px;
}
.org-group-header {
display: flex;
align-items: center;
gap: 10px;
}
.org-badge {
font-size: 12px;
font-weight: 600;
color: var(--text-muted);
background: var(--bg-panel-alt);
border: 1px solid var(--border);
border-radius: 999px;
padding: 1px 10px;
}
.muted {
color: var(--text-muted);
}
.label {
font-size: 12px;
color: var(--text-muted);
margin-bottom: 4px;
font-weight: 500;
}
.title {
margin: 0;
font-size: 18px;
font-weight: 600;
color: var(--text-main);
}
.subtitle {
margin: 0;
font-size: 14px;
color: var(--text-muted);
}
.hidden {
display: none !important;
}
.app-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 14px;
}
.section-header {
display: flex;
justify-content: space-between;
align-items: center;
}
.list {
margin: 0;
padding-left: 16px;
}
.welcome-wrap {
min-height: 100%;
display: grid;
place-items: center;
padding: 32px 24px;
background: var(--bg-app);
}
.welcome-card {
width: min(680px, 100%);
}
.welcome-logo {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 4px;
}
.welcome-logo-img {
height: 36px;
width: auto;
}
.welcome-logo-desktop {
font-size: 20px;
font-weight: 300;
color: var(--text-muted);
letter-spacing: 0;
}
.status-ok {
color: var(--success);
font-weight: 500;
}
.status-error {
color: var(--danger);
font-weight: 500;
}
/* ── Tabs ─────────────────────────────────────────── */
.tabs {
display: flex;
align-items: center;
gap: 0;
border-bottom: 1px solid var(--border);
padding: 0;
flex-shrink: 0;
}
.tab-btn {
background: transparent;
border: none;
border-bottom: 2px solid transparent;
border-radius: 0;
padding: 10px 16px;
color: var(--text-muted);
font-size: 14px;
cursor: pointer;
transition: color 0.1s ease, border-color 0.1s ease;
margin-bottom: -1px;
}
.tab-btn:hover {
background: transparent;
color: var(--text-main);
border-color: transparent;
}
.tab-btn.active {
color: var(--text-main);
border-bottom-color: #f78166;
font-weight: 600;
}
.tab-spacer {
flex: 1;
}
.tab-search {
width: 200px !important;
padding: 5px 10px !important;
font-size: 13px;
margin: 4px 8px 4px 0;
}
.main-tabs {
margin-bottom: 0;
}
.right-tabs {
position: sticky;
top: 0;
margin: 0 -12px;
padding: 0 12px;
background: var(--bg-panel);
z-index: 1;
}
/* ── Sidebar ──────────────────────────────────────── */
.sidebar-brand {
padding: 4px 0 12px;
border-bottom: 1px solid var(--border);
margin-bottom: 4px;
}
.sidebar-brand .title {
font-size: 15px;
font-weight: 600;
}
.sidebar-logo {
display: flex;
align-items: center;
gap: 8px;
}
.sidebar-logo-img {
height: 22px;
width: auto;
}
.sidebar-logo-desktop {
font-size: 13px;
font-weight: 400;
color: var(--text-muted);
letter-spacing: 0;
margin-top: 2px;
}
.sidebar .server-chip {
overflow: hidden;
}
.sidebar .server-chip > div {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.sidebar-nav {
display: flex;
gap: 6px;
}
.sidebar-btn {
flex: 1;
font-size: 13px;
padding: 5px 8px;
text-align: center;
}
.sidebar-recents {
display: flex;
flex-direction: column;
gap: 6px;
flex: 1;
min-height: 0;
}
.recent-item {
display: block;
width: 100%;
border: 0;
border-radius: var(--radius-md);
background: transparent;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
cursor: pointer;
color: var(--text-muted);
padding: 4px 6px;
font-size: 13px;
text-align: left;
}
.recent-item:hover {
background: var(--bg-hover);
color: var(--accent);
border: 0;
}
/* ── Git output ───────────────────────────────────── */
.git-output {
background: #010409;
border: 1px solid var(--border);
border-radius: var(--radius-md);
padding: 12px 14px;
font-size: 12px;
font-family: ui-monospace, "Cascadia Code", "Fira Code", "Consolas", monospace;
color: var(--success);
overflow-x: auto;
white-space: pre-wrap;
word-break: break-word;
margin: 0;
line-height: 1.6;
}
.git-output-placeholder {
font-size: 13px;
font-style: italic;
color: var(--text-muted);
margin: 0;
}
.commit-note {
font-size: 11px;
margin-top: 4px;
color: var(--text-muted);
}
/* ── GitHub Desktop style toolbar ─────────────────── */
.gd-toolbar {
display: grid;
grid-template-columns: minmax(0, 2fr) minmax(0, 1.5fr) minmax(0, 1.5fr);
align-items: stretch;
width: 100%;
height: 56px;
margin: -16px -16px 16px;
border-bottom: 1px solid var(--border);
background: var(--bg-panel);
flex-shrink: 0;
}
.main > .gd-toolbar {
margin: 0 0 12px;
border: 1px solid var(--border);
border-radius: var(--radius-md);
overflow: hidden;
}
.gd-toolbar-cell {
display: grid;
grid-template-columns: auto minmax(0, 1fr) auto;
align-items: center;
gap: 10px;
width: 100%;
height: 100%;
padding: 0 14px;
border: 0;
border-right: 1px solid var(--border);
border-radius: 0;
background: transparent;
color: var(--text-main);
cursor: pointer;
text-align: left;
transition: background 0.1s ease;
}
.gd-toolbar-cell:last-child {
border-right: 0;
}
.gd-toolbar-cell:hover:not(:disabled):not(.gd-toolbar-cell-empty) {
background: rgba(177, 186, 196, 0.08);
border-color: var(--border);
}
.gd-toolbar-cell:disabled,
.gd-toolbar-cell-empty {
cursor: default;
opacity: 0.7;
}
.gd-cell-icon {
display: flex;
align-items: center;
justify-content: center;
width: 22px;
height: 22px;
color: var(--text-muted);
flex-shrink: 0;
}
.gd-cell-copy {
min-width: 0;
display: flex;
flex-direction: column;
line-height: 1.25;
}
.gd-cell-label {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: var(--text-muted);
font-size: 11px;
font-weight: 400;
}
.gd-cell-value {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-top: 2px;
font-size: 14px;
font-weight: 600;
color: var(--text-main);
}
.gd-cell-value-muted {
color: var(--text-muted);
font-weight: 400;
font-style: italic;
}
.gd-cell-caret {
color: var(--text-muted);
flex-shrink: 0;
}
.selected-repo-path-line {
margin-top: -6px;
font-size: 12px;
font-family: ui-monospace, "Cascadia Code", "Fira Code", Consolas, monospace;
word-break: break-all;
}
.local-scan-panel {
padding: 12px;
border: 1px solid var(--border);
border-radius: var(--radius-lg);
background: rgba(33, 38, 45, 0.35);
}
.local-scan-title {
font-size: 15px;
}
.local-repo-list {
display: grid;
gap: 8px;
max-height: 320px;
overflow: auto;
}
.local-repo-card {
display: flex;
justify-content: space-between;
align-items: center;
gap: 12px;
padding: 10px 12px;
border: 1px solid var(--border);
border-radius: var(--radius-md);
background: var(--bg-panel);
}
.local-repo-info {
min-width: 0;
display: flex;
flex-direction: column;
gap: 2px;
}
.local-repo-info span {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.local-scan-empty {
padding: 24px 12px;
}
/* ── Empty state ──────────────────────────────────── */
.empty-state {
grid-column: 1 / -1;
text-align: center;
padding: 48px 16px;
}
.empty-state > div:first-child {
font-size: 15px;
color: var(--text-main);
margin-bottom: 6px;
font-weight: 500;
}
/* ── Repo card details ────────────────────────────── */
.repo-card strong {
color: var(--accent);
font-size: 14px;
}
.repo-card strong:hover {
text-decoration: underline;
cursor: pointer;
}
/* ── Repository viewer ────────────────────────────── */
.viewer-panel {
gap: 0;
}
/* Top bar: breadcrumb + branch controls */
.viewer-topbar {
display: flex;
justify-content: space-between;
align-items: center;
gap: 12px;
flex-wrap: wrap;
padding: 0 0 14px;
}
.viewer-crumb-row {
display: flex;
align-items: center;
gap: 4px;
flex-wrap: wrap;
min-width: 0;
}
.viewer-crumb-btn {
padding: 0 2px;
border: 0;
background: transparent;
color: var(--accent);
font-size: 16px;
font-weight: 600;
}
.viewer-crumb-btn:hover {
background: transparent;
border: 0;
text-decoration: underline;
color: var(--accent);
}
.viewer-crumb-sep {
color: var(--text-muted);
font-size: 16px;
font-weight: 300;
padding: 0 2px;
user-select: none;
}
.viewer-source-badge {
font-size: 12px;
font-weight: 500;
padding: 2px 8px;
border: 1px solid var(--border);
border-radius: 999px;
color: var(--text-muted);
background: var(--bg-panel-alt);
white-space: nowrap;
}
.viewer-controls {
gap: 6px;
align-items: center;
}
/* File table */
.viewer-table {
border: 1px solid var(--border);
border-radius: var(--radius-lg);
overflow: hidden;
margin-bottom: 16px;
}
.viewer-table-header {
display: grid;
grid-template-columns: 20px 1fr auto;
align-items: center;
gap: 8px;
padding: 8px 16px;
background: var(--bg-panel-alt);
border-bottom: 1px solid var(--border);
font-size: 11px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.06em;
color: var(--text-muted);
}
.viewer-row {
display: grid;
grid-template-columns: 20px 1fr auto;
align-items: center;
width: 100%;
gap: 8px;
padding: 9px 16px;
border: 0;
border-radius: 0;
border-bottom: 1px solid var(--border);
background: var(--bg-panel);
text-align: left;
color: var(--text-main);
font-size: 14px;
cursor: pointer;
transition: background 0.08s ease;
}
.viewer-row:last-child {
border-bottom: 0;
}
.viewer-row:hover {
background: var(--bg-hover);
border-color: var(--border);
}
.viewer-row.active {
background: rgba(47, 129, 247, 0.07);
border-color: var(--border);
}
.viewer-row-icon {
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.viewer-row-name {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.viewer-dir-name {
color: var(--accent);
}
.viewer-row-size {
font-size: 12px;
white-space: nowrap;
text-align: right;
font-variant-numeric: tabular-nums;
}
.viewer-empty-row {
padding: 32px 16px;
text-align: center;
font-size: 13px;
}
/* File preview panel (below the table) */
.viewer-file-panel {
border: 1px solid var(--border);
border-radius: var(--radius-lg);
overflow: hidden;
margin-bottom: 16px;
display: flex;
flex-direction: column;
}
.viewer-file-panel-header {
display: flex;
justify-content: space-between;
align-items: center;
gap: 12px;
padding: 10px 16px;
background: var(--bg-panel-alt);
border-bottom: 1px solid var(--border);
}
.viewer-file-name {
display: flex;
align-items: center;
gap: 6px;
font-size: 13px;
font-weight: 600;
color: var(--text-main);
}
/* README panel */
.viewer-readme-panel {
border: 1px solid var(--border);
border-radius: var(--radius-lg);
overflow: hidden;
margin-bottom: 16px;
}
.viewer-readme-header {
display: flex;
align-items: center;
gap: 8px;
padding: 10px 16px;
background: var(--bg-panel-alt);
border-bottom: 1px solid var(--border);
font-size: 13px;
font-weight: 600;
color: var(--text-main);
}
.viewer-readme-body {
background: var(--bg-panel);
}
.markdown-body {
padding: 24px;
font-family: inherit;
font-size: 14px;
line-height: 1.75;
word-break: break-word;
color: var(--text-main);
background: var(--bg-panel);
}
.markdown-body > :first-child {
margin-top: 0;
}
.markdown-body > :last-child {
margin-bottom: 0;
}
.markdown-body h1,
.markdown-body h2 {
padding-bottom: 8px;
border-bottom: 1px solid var(--border);
}
.markdown-body h1 {
margin: 0 0 16px;
font-size: 28px;
}
.markdown-body h2 {
margin: 24px 0 12px;
font-size: 22px;
}
.markdown-body h3 {
margin: 20px 0 10px;
font-size: 18px;
}
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
margin: 16px 0 8px;
}
.markdown-body p {
margin: 0 0 12px;
}
.markdown-body ul,
.markdown-body ol {
margin: 0 0 12px;
padding-left: 24px;
}
.markdown-body blockquote {
margin: 0 0 12px;
padding: 0 12px;
border-left: 3px solid var(--border);
color: var(--text-muted);
}
.markdown-body hr {
height: 1px;
margin: 24px 0;
border: 0;
background: var(--border);
}
.markdown-body a {
color: var(--accent);
text-decoration: none;
}
.markdown-body a:hover {
text-decoration: underline;
}
.markdown-body code {
padding: 2px 5px;
border-radius: var(--radius-md);
background: var(--bg-panel-alt);
font-family: ui-monospace, "Cascadia Code", "Fira Code", "Consolas", monospace;
font-size: 85%;
}
.markdown-body .markdown-code {
margin: 0 0 12px;
padding: 12px;
overflow: auto;
border-radius: var(--radius-md);
background: #010409;
}
.markdown-body .markdown-code code {
padding: 0;
background: transparent;
font-size: 12px;
line-height: 1.6;
}
/* Code preview (shared by file panel) */
.code-preview {
flex: 1;
margin: 0;
padding: 16px;
overflow: auto;
background: #010409;
color: var(--text-main);
font-family: ui-monospace, "Cascadia Code", "Fira Code", "Consolas", monospace;
font-size: 12px;
line-height: 1.7;
white-space: pre;
}
.syntax-keyword {
color: #ff7b72;
}
.syntax-key {
color: #79c0ff;
}
.viewer-error,
.viewer-loading {
border: 1px solid var(--border);
border-radius: var(--radius-md);
padding: 8px 12px;
font-size: 13px;
margin-bottom: 12px;
}
.viewer-error {
border-color: rgba(248, 81, 73, 0.35);
color: var(--danger);
background: rgba(248, 81, 73, 0.08);
}
.viewer-loading {
color: var(--text-muted);
background: var(--bg-app);
}
.viewer-empty {
align-self: stretch;
}
/* ── Responsive ───────────────────────────────────── */
@media (max-width: 1180px) {
.layout {
grid-template-columns: 220px 1fr;
}
.rightbar {
display: none;
}
}