Spaces:
Paused
Paused
Savestate: Translate timeline to German and match Apple Files document aesthetics by hiding names
Browse files- index.html +1 -1
- src/views/documents/documents-view.js +9 -9
index.html
CHANGED
|
@@ -74,7 +74,7 @@
|
|
| 74 |
</head>
|
| 75 |
<body class="dark-theme in-chat-view">
|
| 76 |
|
| 77 |
-
<div id="live-version-badge" style="position: fixed; top: 50px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--text-secondary); opacity: 0.6; z-index: 99999; pointer-events: none; font-weight: 500; font-family: monospace; letter-spacing: 1px; background: rgba(0,0,0,0.2); padding: 2px 8px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.05);">BUILD 1.8.
|
| 78 |
|
| 79 |
<!-- SVG Filters for Liquid Glass Refraction -->
|
| 80 |
<svg width="0" height="0" style="position: absolute; pointer-events: none;">
|
|
|
|
| 74 |
</head>
|
| 75 |
<body class="dark-theme in-chat-view">
|
| 76 |
|
| 77 |
+
<div id="live-version-badge" style="position: fixed; top: 50px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--text-secondary); opacity: 0.6; z-index: 99999; pointer-events: none; font-weight: 500; font-family: monospace; letter-spacing: 1px; background: rgba(0,0,0,0.2); padding: 2px 8px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.05);">BUILD 1.8.252</div>
|
| 78 |
|
| 79 |
<!-- SVG Filters for Liquid Glass Refraction -->
|
| 80 |
<svg width="0" height="0" style="position: absolute; pointer-events: none;">
|
src/views/documents/documents-view.js
CHANGED
|
@@ -148,14 +148,13 @@ export class DocumentsView {
|
|
| 148 |
|
| 149 |
// Group documents by date (simulated with random dates for demo if mtime isn't easily formatted, but we'll try to use a static nice date for now like the reference)
|
| 150 |
// To match the reference closely, let's group them by a realistic date string.
|
| 151 |
-
// In a real app we'd use: new Intl.DateTimeFormat('
|
| 152 |
const groups = {};
|
| 153 |
documents.forEach((f, i) => {
|
| 154 |
-
// Create a nice date string.
|
| 155 |
-
// We'll just use today's date formatted beautifully for all of them for now, or group by mtime if available.
|
| 156 |
const date = new Date(f.mtime || Date.now());
|
| 157 |
-
// Formatting like "
|
| 158 |
-
const dateString = new Intl.DateTimeFormat('
|
| 159 |
|
| 160 |
if (!groups[dateString]) groups[dateString] = [];
|
| 161 |
groups[dateString].push(f);
|
|
@@ -180,7 +179,7 @@ export class DocumentsView {
|
|
| 180 |
<div class="vault-timeline-header">
|
| 181 |
<div class="vault-timeline-line"></div>
|
| 182 |
<div class="vault-timeline-title">${dateTitle}</div>
|
| 183 |
-
<div class="vault-timeline-subtitle">${groupFiles.length}
|
| 184 |
</div>
|
| 185 |
<div class="vault-timeline-content">
|
| 186 |
<div class="vault-timeline-line-content"></div>
|
|
@@ -268,13 +267,14 @@ export class DocumentsView {
|
|
| 268 |
const sizeStr = f.size ? Math.round(f.size / 1024) + ' KB' : '';
|
| 269 |
|
| 270 |
return `
|
| 271 |
-
<div class="vault-file vault-item-enter" style="--delay: ${delay}ms" data-name="${f.name}" data-isdir="false" data-path="${path}">
|
| 272 |
<div class="vault-file-body vault-file-body-${ext}">
|
| 273 |
<div id="preview-${path.replace(/[^a-zA-Z0-9]/g, '_')}" class="vault-file-preview-slot" style="width: 100%; height: 100%;">
|
| 274 |
</div>
|
| 275 |
</div>
|
| 276 |
-
<
|
| 277 |
-
|
|
|
|
| 278 |
<button class="vault-item-delete" title="Löschen" data-name="${f.name}" data-isdir="false">
|
| 279 |
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2"><polyline points="3 6 5 6 21 6"></polyline><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path></svg>
|
| 280 |
</button>
|
|
|
|
| 148 |
|
| 149 |
// Group documents by date (simulated with random dates for demo if mtime isn't easily formatted, but we'll try to use a static nice date for now like the reference)
|
| 150 |
// To match the reference closely, let's group them by a realistic date string.
|
| 151 |
+
// In a real app we'd use: new Intl.DateTimeFormat('de-DE', { weekday: 'long', month: 'long', day: 'numeric' }).format(new Date(f.mtime || Date.now()))
|
| 152 |
const groups = {};
|
| 153 |
documents.forEach((f, i) => {
|
| 154 |
+
// Create a nice date string.
|
|
|
|
| 155 |
const date = new Date(f.mtime || Date.now());
|
| 156 |
+
// Formatting like "Montag, 23. September" (German format)
|
| 157 |
+
const dateString = new Intl.DateTimeFormat('de-DE', { weekday: 'long', day: 'numeric', month: 'long' }).format(date);
|
| 158 |
|
| 159 |
if (!groups[dateString]) groups[dateString] = [];
|
| 160 |
groups[dateString].push(f);
|
|
|
|
| 179 |
<div class="vault-timeline-header">
|
| 180 |
<div class="vault-timeline-line"></div>
|
| 181 |
<div class="vault-timeline-title">${dateTitle}</div>
|
| 182 |
+
<div class="vault-timeline-subtitle">${groupFiles.length} Dokument${groupFiles.length !== 1 ? 'e' : ''}</div>
|
| 183 |
</div>
|
| 184 |
<div class="vault-timeline-content">
|
| 185 |
<div class="vault-timeline-line-content"></div>
|
|
|
|
| 267 |
const sizeStr = f.size ? Math.round(f.size / 1024) + ' KB' : '';
|
| 268 |
|
| 269 |
return `
|
| 270 |
+
<div class="vault-file vault-item-enter" style="--delay: ${delay}ms" data-name="${f.name}" data-isdir="false" data-path="${path}" title="${f.name}">
|
| 271 |
<div class="vault-file-body vault-file-body-${ext}">
|
| 272 |
<div id="preview-${path.replace(/[^a-zA-Z0-9]/g, '_')}" class="vault-file-preview-slot" style="width: 100%; height: 100%;">
|
| 273 |
</div>
|
| 274 |
</div>
|
| 275 |
+
<!-- To match Apple Files timeline reference, no names or sizes are shown under the documents -->
|
| 276 |
+
<!-- <div class="vault-file-name">${f.name}</div> -->
|
| 277 |
+
<!-- ${sizeStr ? `<div class="vault-file-size">${sizeStr}</div>` : ''} -->
|
| 278 |
<button class="vault-item-delete" title="Löschen" data-name="${f.name}" data-isdir="false">
|
| 279 |
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2"><polyline points="3 6 5 6 21 6"></polyline><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path></svg>
|
| 280 |
</button>
|