feat: history/favorites panel, image preview, context strip

Co-Authored-By: Ovis Fast (Claude) <[email protected]>
This commit is contained in:
FactorandOvis Fast committed 2026-11-19 11:50:53 +01:00
1 parent 6360c75ff8
commit 7116af9434
9 files changed
+930 -79

No files matched your search

+15
View File
@@ -177,3 +177,18 @@ function standalone(before, after, afterNext) {
if (after === "." && PATH_CHAR.test(afterNext)) return false;
return true;
}
/**
* A size for a tile: `512 B`, `1,5 KB`, `5 MB`.
*
* @param {number|undefined|null} bytes
* @returns {string} nothing when the size is not known
*/
export function formatBytes(bytes) {
if (!Number.isFinite(bytes) || bytes < 0) return "";
const unit = (value, name) => `${String(Math.round(value * 10) / 10).replace(".", ",")} ${name}`;
if (bytes < 1024) return `${bytes} B`;
if (bytes < 1024 * 1024) return unit(bytes / 1024, "KB");
if (bytes < 1024 * 1024 * 1024) return unit(bytes / 1024 / 1024, "MB");
return unit(bytes / 1024 / 1024 / 1024, "GB");
}