Skip to content

ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.

redesign(files): owner column + flush inline preview pane

Juan Denis80bdd213755b
diff --git a/frontend/src/components/file-manager/FileRow.jsx b/frontend/src/components/file-manager/FileRow.jsx
index 49f43c20..e17a58ed 100644
--- a/frontend/src/components/file-manager/FileRow.jsx
+++ b/frontend/src/components/file-manager/FileRow.jsx
@@ -51,6 +51,7 @@ function FileRow({
{new Date(entry.modified).toLocaleDateString()}
</span>
<span className="col-permissions">{entry.permissions}</span>
+ <span className="col-owner">{entry.owner}</span>
<span className="col-actions" onClick={(e) => e.stopPropagation()}>
{!entry.is_dir && (
<button className="row-action" onClick={() => onDownload(entry)} title="Download">
diff --git a/frontend/src/components/file-manager/PreviewDrawer.jsx b/frontend/src/components/file-manager/PreviewDrawer.jsx
index 5f22f9da..4e275b2b 100644
--- a/frontend/src/components/file-manager/PreviewDrawer.jsx
+++ b/frontend/src/components/file-manager/PreviewDrawer.jsx
@@ -24,14 +24,18 @@ export default function PreviewDrawer({
onPermissions,
onDelete,
onCopyPath,
+ // When true, render as a flush inline pane (file-manager 3rd column)
+ // instead of a fixed-position drawer-over-scrim.
+ inline = false,
}) {
- // Lock body scroll while open
+ // Lock body scroll only for the overlay drawer; the inline pane scrolls
+ // within its own column and must not freeze the page.
useEffect(() => {
- if (!file) return;
+ if (!file || inline) return;
const prev = document.body.style.overflow;
document.body.style.overflow = 'hidden';
return () => { document.body.style.overflow = prev; };
- }, [file]);
+ }, [file, inline]);
if (!file) return null;
@@ -40,8 +44,12 @@ export default function PreviewDrawer({
return (
<>
- <div className="preview-drawer-backdrop" onClick={onClose} />
- <aside className="preview-drawer" role="dialog" aria-label="File preview">
+ {!inline && <div className="preview-drawer-backdrop" onClick={onClose} />}
+ <aside
+ className={inline ? 'preview-drawer file-preview-pane' : 'preview-drawer'}
+ role={inline ? 'complementary' : 'dialog'}
+ aria-label="File preview"
+ >
<header className="preview-drawer-header">
<FileIcon entry={file} size={20} />
<div className="preview-drawer-title">
diff --git a/frontend/src/pages/FileManager.jsx b/frontend/src/pages/FileManager.jsx
index da708360..d22ecf55 100644
--- a/frontend/src/pages/FileManager.jsx
+++ b/frontend/src/pages/FileManager.jsx
@@ -956,7 +956,7 @@ function FileManager() {
</div>
)}
- <div className="file-manager-body">
+ <div className={`file-manager-body ${previewFile ? 'has-preview' : ''}`}>
{sidebarVisible && (
<aside className="file-manager-sidebar left">
{/* Quick access (demo rail shortcuts) */}
@@ -1160,6 +1160,7 @@ function FileManager() {
<span className="col-size">Size</span>
<span className="col-modified">Modified</span>
<span className="col-permissions">Permissions</span>
+ <span className="col-owner">Owner</span>
<span className="col-actions">Actions</span>
</div>
{sortedFiltered.map((entry) => (
@@ -1181,6 +1182,23 @@ function FileManager() {
)}
</div>
</main>
+
+ <PreviewDrawer
+ inline
+ file={previewFile}
+ fileContent={fileContent}
+ setFileContent={setFileContent}
+ editing={editing}
+ onStartEdit={() => setEditing(true)}
+ onCancelEdit={() => setEditing(false)}
+ onSave={handleSaveFile}
+ onClose={() => { setPreviewFile(null); setEditing(false); }}
+ onDownload={(e) => api.downloadFile(e.path)}
+ onRename={openRenameModal}
+ onPermissions={openPermissionsModal}
+ onCopyPath={copyPathToClipboard}
+ onDelete={(e) => handleDelete(e)}
+ />
</div>
<div className="status-bar">
@@ -1232,22 +1250,6 @@ function FileManager() {
onDelete={(e) => handleDelete(selectedEntries.length > 1 ? selectedEntries : e)}
/>
- <PreviewDrawer
- file={previewFile}
- fileContent={fileContent}
- setFileContent={setFileContent}
- editing={editing}
- onStartEdit={() => setEditing(true)}
- onCancelEdit={() => setEditing(false)}
- onSave={handleSaveFile}
- onClose={() => { setPreviewFile(null); setEditing(false); }}
- onDownload={(e) => api.downloadFile(e.path)}
- onRename={openRenameModal}
- onPermissions={openPermissionsModal}
- onCopyPath={copyPathToClipboard}
- onDelete={(e) => handleDelete(e)}
- />
-
{/* Modals */}
{showNewFileModal && (
<div className="modal-overlay" onClick={() => setShowNewFileModal(false)}>
diff --git a/frontend/src/styles/pages/_file-manager.scss b/frontend/src/styles/pages/_file-manager.scss
index bc1afc71..411404ed 100644
--- a/frontend/src/styles/pages/_file-manager.scss
+++ b/frontend/src/styles/pages/_file-manager.scss
@@ -425,7 +425,9 @@ $ft-default: #646b7a;
}
}
- // ─── Body layout: left rail + main ─────────────────
+ // ─── Body layout: left rail + main (+ flush preview) ───
+ // A third "preview" column is appended only when a file is open for
+ // preview, so the listing keeps full width otherwise.
.file-manager-body {
display: grid;
grid-template-columns: 240px 1fr;
@@ -435,13 +437,17 @@ $ft-default: #646b7a;
overflow: hidden;
align-items: stretch;
+ &.has-preview { grid-template-columns: 240px minmax(0, 1fr) 380px; }
+
@media (max-width: $breakpoint-lg) {
grid-template-columns: 1fr;
+ &.has-preview { grid-template-columns: minmax(0, 1fr) 380px; }
}
}
&:not(.sidebar-open) .file-manager-body {
grid-template-columns: 1fr;
+ &.has-preview { grid-template-columns: minmax(0, 1fr) 380px; }
}
.file-manager-main {
@@ -452,6 +458,27 @@ $ft-default: #646b7a;
flex-direction: column;
}
+ // ─── Flush preview pane (demo `.fmgr-preview`) ──────
+ // Same element carries `.preview-drawer` so it reuses the drawer's
+ // inner-section styling, but here we strip the fixed/overlay chrome and
+ // dock it as the body's 3rd grid column joined by a 1px left border.
+ .file-preview-pane {
+ position: static;
+ inset: auto;
+ width: 100%;
+ max-width: none;
+ height: 100%;
+ min-height: 0;
+ min-width: 0;
+ border-left: 1px solid var(--border-soft);
+ box-shadow: none;
+ animation: none;
+ background: var(--bg-sidebar);
+ overflow: hidden;
+
+ @media (max-width: $breakpoint-sm) { width: 100%; }
+ }
+
// ─── Left rail ──────────────────────────────────────
.file-manager-sidebar.left {
display: flex;
@@ -1128,7 +1155,7 @@ $ft-default: #646b7a;
.file-list {
.file-list-header {
display: grid;
- grid-template-columns: 36px 1fr 110px 130px 130px 140px;
+ grid-template-columns: 36px 1fr 110px 130px 120px 110px 140px;
padding: 8px $space-4;
position: sticky;
top: 0;
@@ -1154,7 +1181,7 @@ $ft-default: #646b7a;
.file-item {
display: grid;
- grid-template-columns: 36px 1fr 110px 130px 130px 140px;
+ grid-template-columns: 36px 1fr 110px 130px 120px 110px 140px;
padding: 7px $space-4;
border-bottom: 1px solid var(--border-soft);
cursor: pointer;
@@ -1203,10 +1230,14 @@ $ft-default: #646b7a;
font-size: 12px;
color: var(--text-dim);
}
- .col-permissions {
+ .col-permissions,
+ .col-owner {
font-family: $font-mono;
font-size: 11.5px;
color: var(--text-faint);
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
}
.col-actions {
display: flex;
@@ -1686,7 +1717,7 @@ $drawer-width: 520px;
.file-list-header,
.file-item {
grid-template-columns: 36px 1fr 90px 110px;
- .col-permissions, .col-modified { display: none; }
+ .col-permissions, .col-modified, .col-owner { display: none; }
}
}