diff --git a/nostr/commit-signatures.jsonl b/nostr/commit-signatures.jsonl index 0ac349e..b9ca7c6 100644 --- a/nostr/commit-signatures.jsonl +++ b/nostr/commit-signatures.jsonl @@ -52,3 +52,4 @@ {"kind":1640,"pubkey":"573634b648634cbad10f2451776089ea21090d9407f715e83c577b4611ae6edc","created_at":1771747544,"tags":[["author","Silberengel","silberengel7@protonmail.com"],["message","handle panel-switching on mobile"]],"content":"Signed commit: handle panel-switching on mobile","id":"1b65fafbc3cef0e06fc9fd9e7c2478f3028ecea0974173cbac59a9afcb1defe9","sig":"fe917e8c371c9567bf677ac5f21175ee4f3783e8a9a0b0cb4f43f17f235041306422e73ec048b7a3638ba4268faaca6bf415593cea4cd89761f43edb51184bca"} {"kind":1640,"pubkey":"573634b648634cbad10f2451776089ea21090d9407f715e83c577b4611ae6edc","created_at":1771750234,"tags":[["author","Silberengel","silberengel7@protonmail.com"],["message","reformatting design"]],"content":"Signed commit: reformatting design","id":"3d9cac8d0ed3abac1a42c891a2352f21e6bf60c98af7fcac3b1703c5ab965f9f","sig":"d08ea355c001bf0c83eb0ab06e3dcae32a1bad0c565b626167e9c2218372532b2ba11e87f79521cafabc58c8cc5be5d9fb72235aec4dcb9f3f2556c040fc3599"} {"kind":1640,"pubkey":"573634b648634cbad10f2451776089ea21090d9407f715e83c577b4611ae6edc","created_at":1771750596,"tags":[["author","Silberengel","silberengel7@protonmail.com"],["message","fix git folders"]],"content":"Signed commit: fix git folders","id":"3d2475034fdfa5eea36e5caad946460b034a1e4e16b6ba6e3f7fb9b6e1b0a31f","sig":"3eb6e3300081a53434e0f692f0c46618369089bb25047a83138ef3ffd485f749cf817b480f5c8ff0458bb846d04654ba2730ba7d42272739af18a13e8dcb4ed4"} +{"kind":1640,"pubkey":"573634b648634cbad10f2451776089ea21090d9407f715e83c577b4611ae6edc","created_at":1771753256,"tags":[["author","Silberengel","silberengel7@protonmail.com"],["message","markup and csv previews in file viewer\ncorrect image view\ncorrect syntax view\nadd copy, raw, and download buttons"]],"content":"Signed commit: markup and csv previews in file viewer\ncorrect image view\ncorrect syntax view\nadd copy, raw, and download buttons","id":"40e64c0a716e0ff594b736db14021e43583d5ff0918c1ec0c4fe2c07ddbdbc73","sig":"bb3a50267214a005104853e9b78dd94e4980024146978baef8612ef0400024032dd620749621f832ee9f0458e582084f12ed9c85a40c306f5bbc92e925198a97"} diff --git a/src/lib/components/RepoHeaderEnhanced.svelte b/src/lib/components/RepoHeaderEnhanced.svelte index fd73798..21bde52 100644 --- a/src/lib/components/RepoHeaderEnhanced.svelte +++ b/src/lib/components/RepoHeaderEnhanced.svelte @@ -376,18 +376,6 @@ {/if} {/if} - - {#if isRepoCloned === true && onCopyCloneUrl} - - {/if} diff --git a/src/lib/styles/repo.css b/src/lib/styles/repo.css index f8aa9c7..0d5f9b1 100644 --- a/src/lib/styles/repo.css +++ b/src/lib/styles/repo.css @@ -1026,6 +1026,44 @@ overflow: hidden; } +.copy-clone-url-button { + padding: 0.5rem 0.75rem; + background: var(--button-primary, var(--accent)); + color: var(--accent-text, #ffffff); + border: none; + border-radius: 0.375rem; + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + gap: 0.5rem; + font-size: 0.875rem; + font-weight: 500; + transition: all 0.2s ease; + margin-bottom: 0.5rem; + width: 100%; +} + +.copy-clone-url-button:hover:not(:disabled) { + background: var(--button-primary-hover, var(--accent-hover)); + transform: translateY(-1px); + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); +} + +.copy-clone-url-button:active:not(:disabled) { + transform: translateY(0); +} + +.copy-clone-url-button:disabled { + opacity: 0.6; + cursor: not-allowed; +} + +.copy-clone-url-button .icon-inline { + width: 16px; + height: 16px; +} + .clone-url-list.collapsed { max-height: 0; opacity: 0; @@ -1068,6 +1106,37 @@ } .clone-more { + background: var(--button-secondary, var(--bg-secondary)); + border: 1px solid var(--border-color, #e0e0e0); + padding: 0.375rem 0.75rem; + margin: 0.5rem 0 0 0; + cursor: pointer; + color: var(--text-primary); + font-size: 0.875rem; + border-radius: 4px; + transition: all 0.2s ease; + display: inline-block; + font-weight: 500; +} + +.clone-more:hover { + background: var(--button-secondary-hover, var(--bg-tertiary)); + border-color: var(--accent, #007bff); + color: var(--accent, #007bff); +} + +.clone-more:active { + transform: translateY(1px); +} + +.clone-more:focus { + outline: 2px solid var(--accent, #007bff); + outline-offset: 2px; + border-radius: 4px; +} + +/* Legacy span version (if still used) */ +span.clone-more { color: var(--text-muted); font-size: 0.75rem; margin-top: 0.25rem; diff --git a/src/routes/repos/[npub]/[repo]/+page.svelte b/src/routes/repos/[npub]/[repo]/+page.svelte index eacdac4..28145d9 100644 --- a/src/routes/repos/[npub]/[repo]/+page.svelte +++ b/src/routes/repos/[npub]/[repo]/+page.svelte @@ -791,6 +791,8 @@ let showLeftPanelOnMobile = $state(true); // Mobile collapse for clone URLs let cloneUrlsExpanded = $state(false); + // Show all clone URLs (beyond the first 3) + let showAllCloneUrls = $state(false); // Guard to prevent README auto-load loop let readmeAutoLoadAttempted = $state(false); @@ -2945,9 +2947,20 @@ await renderFileAsHtml(fileContent, ext || ''); } - // Apply syntax highlighting for read-only view (non-maintainers) - only if not in preview mode - if (fileContent && !isMaintainer && !showFilePreview) { - await applySyntaxHighlighting(fileContent, ext || ''); + // Apply syntax highlighting + // For files that support HTML preview (markdown, HTML, etc.), only show highlighting in raw mode + // For code files and other non-markup files, always show syntax highlighting + const hasHtmlPreview = supportsPreview(ext); + if (fileContent) { + if (hasHtmlPreview) { + // Markup files: only show highlighting when not in preview mode (raw mode) + if (!showFilePreview) { + await applySyntaxHighlighting(fileContent, ext || ''); + } + } else { + // Code files and other non-markup files: always show syntax highlighting + await applySyntaxHighlighting(fileContent, ext || ''); + } } } } catch (err) { @@ -4319,7 +4332,18 @@
- {#each pageData.repoCloneUrls.slice(0, 3) as cloneUrl} + {#if isRepoCloned === true} + + {/if} + {#each (showAllCloneUrls ? pageData.repoCloneUrls : pageData.repoCloneUrls.slice(0, 3)) as cloneUrl} {@const cloneVerification = verificationStatus?.cloneVerifications?.find(cv => { const normalizeUrl = (url: string) => url.replace(/\/$/, '').toLowerCase().replace(/^https?:\/\//, ''); const normalizedCv = normalizeUrl(cv.url); @@ -4359,7 +4383,13 @@
{/each} {#if pageData.repoCloneUrls.length > 3} - +{pageData.repoCloneUrls.length - 3} more + {/if}