fix: upload failure, share dialog, shared view styling, dark mode fixes

- Fix 'folder_id is required' upload error by adding create_home_folder
  through the full hexagonal architecture (trait, service, repository, auth)
- Fix double upload issue with _isUploading concurrency guard
- Fix Share context menu doing nothing (ID collision between sharedView
  and main share dialog resolved with sv- prefix)
- Fix Compartidos tab duplicate headers and broken layout
- Add missing .shared-dialog CSS with dark mode support
- Fix dark mode white backgrounds on empty-state, shared-filters,
  trash-actions, action-btn, and header
- Fix i18n key mismatches in sharedView
- Bump version to 0.4.1

Closes #120
This commit is contained in:
Dionisio
2026-02-16 16:18:39 +01:00
parent b7bd656a43
commit f70890e884
14 changed files with 524 additions and 271 deletions
@@ -603,17 +603,11 @@ impl FolderRepository for FolderDbRepository {
}
Ok(())
}
}
// ── Extra helpers for blob-storage bootstrap ──
impl FolderDbRepository {
/// Creates a root-level home folder for a user.
/// This is called during user registration.
pub async fn create_home_folder(
async fn create_home_folder(
&self,
user_id: &str,
name: &str,
name: String,
) -> Result<Folder, DomainError> {
let row = sqlx::query_as::<_, (String, String, i64, i64)>(
r#"
@@ -626,14 +620,14 @@ impl FolderDbRepository {
EXTRACT(EPOCH FROM updated_at)::bigint
"#,
)
.bind(name)
.bind(&name)
.bind(user_id)
.fetch_optional(self.pool())
.await
.map_err(|e| DomainError::internal_error("FolderDb", format!("home folder: {e}")))?;
match row {
Some((id, path, ca, ma)) => Self::row_to_folder(id, name.to_string(), path, None, Some(user_id.to_string()), ca, ma),
Some((id, path, ca, ma)) => Self::row_to_folder(id, name.clone(), path, None, Some(user_id.to_string()), ca, ma),
None => {
// Already exists — fetch it
let existing = sqlx::query_as::<_, (String, String, i64, i64)>(
@@ -646,16 +640,20 @@ impl FolderDbRepository {
WHERE name = $1 AND user_id = $2 AND parent_id IS NULL
"#,
)
.bind(name)
.bind(&name)
.bind(user_id)
.fetch_one(self.pool())
.await
.map_err(|e| DomainError::internal_error("FolderDb", format!("home fetch: {e}")))?;
Self::row_to_folder(existing.0, name.to_string(), existing.1, None, Some(user_id.to_string()), existing.2, existing.3)
Self::row_to_folder(existing.0, name, existing.1, None, Some(user_id.to_string()), existing.2, existing.3)
}
}
}
}
// ── Extra helpers for blob-storage bootstrap ──
impl FolderDbRepository {
/// Returns user_id for a given folder. Used by file repositories.
pub async fn get_folder_user_id(&self, folder_id: &str) -> Result<String, DomainError> {
sqlx::query_scalar::<_, String>("SELECT user_id FROM storage.folders WHERE id = $1::uuid")