Browse Source

bug-fixes

Nostr-Signature: 146ea5bbc462c4f0188ec4a35a248c2cf518af7088714a4c1ce8e6e35f524e2a 573634b648634cbad10f2451776089ea21090d9407f715e83c577b4611ae6edc dfc5d8d9a2f35e1898404d096f6e3e334885cdb0076caab0f3ea3efd1236e53d4172ed2b9ec16cff80ff364898c287ddb400b7a52cb65a3aedc05bb9df0f7ace
main
Silberengel 3 weeks ago
parent
commit
a2b8b42bdd
  1. 1
      nostr/commit-signatures.jsonl
  2. 12
      src/lib/components/RepoHeaderEnhanced.svelte
  3. 69
      src/lib/styles/repo.css
  4. 38
      src/routes/repos/[npub]/[repo]/+page.svelte

1
nostr/commit-signatures.jsonl

@ -52,3 +52,4 @@ @@ -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"}

12
src/lib/components/RepoHeaderEnhanced.svelte

@ -376,18 +376,6 @@ @@ -376,18 +376,6 @@
{/if}
</div>
{/if}
{#if isRepoCloned === true && onCopyCloneUrl}
<button
class="copy-clone-button"
onclick={() => onCopyCloneUrl()}
disabled={copyingCloneUrl}
title="Copy clone URL"
>
<img src="/icons/copy.svg" alt="" class="icon" />
{copyingCloneUrl ? 'Copying...' : 'Copy Clone URL'}
</button>
{/if}
</div>
</header>

69
src/lib/styles/repo.css

@ -1026,6 +1026,44 @@ @@ -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 @@ @@ -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;

38
src/routes/repos/[npub]/[repo]/+page.svelte

@ -791,6 +791,8 @@ @@ -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,11 +2947,22 @@ @@ -2945,11 +2947,22 @@
await renderFileAsHtml(fileContent, ext || '');
}
// Apply syntax highlighting for read-only view (non-maintainers) - only if not in preview mode
if (fileContent && !isMaintainer && !showFilePreview) {
// 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) {
error = err instanceof Error ? err.message : 'Failed to load file';
console.error('Error loading file:', err);
@ -4319,7 +4332,18 @@ @@ -4319,7 +4332,18 @@
</svg>
</button>
<div class="clone-url-list" class:collapsed={!cloneUrlsExpanded}>
{#each pageData.repoCloneUrls.slice(0, 3) as cloneUrl}
{#if isRepoCloned === true}
<button
class="copy-clone-url-button"
onclick={() => copyCloneUrl()}
disabled={copyingCloneUrl}
title="Copy clone URL"
>
<img src="/icons/copy.svg" alt="" class="icon-inline" />
{copyingCloneUrl ? 'Copying...' : 'Copy Clone URL'}
</button>
{/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 @@ @@ -4359,7 +4383,13 @@
</div>
{/each}
{#if pageData.repoCloneUrls.length > 3}
<span class="clone-more">+{pageData.repoCloneUrls.length - 3} more</span>
<button
class="clone-more"
onclick={() => showAllCloneUrls = !showAllCloneUrls}
title={showAllCloneUrls ? 'Show fewer' : 'Show all clone URLs'}
>
{showAllCloneUrls ? `-${pageData.repoCloneUrls.length - 3} less` : `+${pageData.repoCloneUrls.length - 3} more`}
</button>
{/if}
</div>
</div>

Loading…
Cancel
Save