Fix share copy-link, destination-picker filters, and type-filter UX
- SharesController's fetchShares() built NextcloudShare objects through its own thin inline parser instead of _shareFromJson, so url/token/ permissions/expireDate were always null - a public link share could never show "Copy link" in the Shares tab. Reuses _shareFromJson. - Upload/Move/Copy's destination picker hid External storage in its filter sheet (showStorageScope: false) unlike Files' own controls row, despite the design doc already calling for full parity. - Files' and Photos' type filter (All/Files/Folders, All/Photos/Videos) now render as one consistent style in both filter sheets: every icon always shown, label only on the selected segment (NooSegmentedControl's new labelOnlySelected), replacing Files' old checkmark list and Photos' own always-labelled track. - Fixes Photos' type filter only visually updating after closing and reopening the filter sheet - it lived on PhotosView's own State, so Listenable.merge([photos, files]) never rebuilt the sheet when it changed; a StatefulBuilder now gives it that trigger. - Replaces Settings' trailing section jump rail with per-section collapsible cards (NooGroupedList's new collapsible param, expanded by default) - one less parallel way to navigate a long screen. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1471,28 +1471,17 @@ class NextcloudService {
|
||||
final rawList = data['ocs']?['data'];
|
||||
if (rawList is! List) return [];
|
||||
|
||||
return rawList.map<NextcloudShare>((raw) {
|
||||
final path = (raw['path'] ?? '/').toString();
|
||||
final segments = path.split('/').where((s) => s.isNotEmpty).toList();
|
||||
final name = segments.isNotEmpty ? segments.last : path;
|
||||
final isFolder = (raw['item_type'] ?? '').toString() == 'folder';
|
||||
final mimeType = raw['mimetype'] as String?;
|
||||
|
||||
return NextcloudShare(
|
||||
id: (raw['id'] ?? '').toString(),
|
||||
path: path,
|
||||
name: name,
|
||||
itemType: NextcloudItem.deduceType(name, isFolder, mimeType),
|
||||
shareType: _mapShareType((raw['share_type'] as num?)?.toInt() ?? -1),
|
||||
ownerDisplayName: (raw['displayname_owner'] ?? raw['uid_owner'] ?? '')
|
||||
.toString(),
|
||||
sharedWithDisplayName: raw['share_with_displayname'] as String?,
|
||||
sharedAt: DateTime.fromMillisecondsSinceEpoch(
|
||||
((raw['stime'] as num?)?.toInt() ?? 0) * 1000,
|
||||
),
|
||||
sharedWithMe: sharedWithMe,
|
||||
);
|
||||
}).toList();
|
||||
// Shares out to `_shareFromJson` (the same parser `fetchSharesForPath`/
|
||||
// `fetchInheritedShares` use) rather than its own duplicated, thinner
|
||||
// inline parsing - that copy never set `url`/`token`/`permissions`/
|
||||
// `expireDate` at all, so a public-link share always came back with
|
||||
// `url: null` here and the Shares tab's own "Copy link" action could
|
||||
// never show up for it.
|
||||
return rawList
|
||||
.map<NextcloudShare>(
|
||||
(raw) => _shareFromJson(raw, sharedWithMe: sharedWithMe),
|
||||
)
|
||||
.toList();
|
||||
}
|
||||
|
||||
/// Creates a public link share for [path] and returns its share URL.
|
||||
|
||||
Reference in New Issue
Block a user