semantic update

This commit is contained in:
2026-01-28 16:57:19 +03:00
parent 18b42f8dd0
commit 0e0e26e2f7
18 changed files with 11792 additions and 1427 deletions

View File

@@ -1,8 +1,9 @@
<!-- [DEF:FileList:Component] -->
<!--
@TIER: STANDARD
@SEMANTICS: storage, files, list, table
@PURPOSE: Displays a table of files with metadata and actions.
@LAYER: Component
@LAYER: UI
@RELATION: DEPENDS_ON -> storageService
@PROPS: files (Array) - List of StoredFile objects.
@@ -22,10 +23,13 @@
// [DEF:isDirectory:Function]
/**
* @purpose Checks if a file object represents a directory.
* @pre file object has mime_type property.
* @post Returns boolean.
* @param {Object} file - The file object to check.
* @return {boolean} True if it's a directory, false otherwise.
*/
function isDirectory(file) {
console.log("[isDirectory][Action] Checking file type");
return file.mime_type === 'directory';
}
// [/DEF:isDirectory:Function]
@@ -33,10 +37,13 @@
// [DEF:formatSize:Function]
/**
* @purpose Formats file size in bytes into a human-readable string.
* @pre bytes is a number.
* @post Returns formatted string.
* @param {number} bytes - The size in bytes.
* @return {string} Formatted size (e.g., "1.2 MB").
*/
function formatSize(bytes) {
console.log(`[formatSize][Action] Formatting ${bytes} bytes`);
if (bytes === 0) return '0 B';
const k = 1024;
const sizes = ['B', 'KB', 'MB', 'GB', 'TB'];
@@ -48,10 +55,13 @@
// [DEF:formatDate:Function]
/**
* @purpose Formats an ISO date string into a localized readable format.
* @pre dateStr is a valid date string.
* @post Returns localized string.
* @param {string} dateStr - The date string to format.
* @return {string} Localized date and time.
*/
function formatDate(dateStr) {
console.log("[formatDate][Action] Formatting date string");
return new Date(dateStr).toLocaleString();
}
// [/DEF:formatDate:Function]