Fix pull-to-refresh, header tint, sheet controls, and Shares tap

- Every tab's RefreshIndicator+CustomScrollView was missing an explicit
  AlwaysScrollableScrollPhysics, so pull-to-refresh silently couldn't be
  triggered once the list was short enough to fit the viewport (empty,
  or a single item) - the platform default physics only allows the
  overscroll drag RefreshIndicator listens for once content overflows.
- StickyHeaderDelegate (Files'/Photos'/Favorites' pinned controls row)
  painted its background from Theme.of(context).colorScheme.surface -
  Flutter's own Material 3 scheme, reseeded by the user's accent color
  choice - instead of context.nooColors.bg like the rest of the screen,
  showing as a stray colored cast behind the row.
- NooSegmentedControl gains onSurface: true wherever one sits inside a
  sheet (Files'/Photos' sort and type-filter controls) - it defaulted to
  the same surface fill as the sheet itself, so the control had no
  visible boundary showing it as a grouped unit.
- Shares tab: removed the per-row "..." overflow menu on every scope
  (With you/By you/Links); tapping a row now opens the full Share sheet
  for that item instead, fetched via the new
  FilesController.fetchItemAtPath (a share only carries enough metadata
  for its own row, not what the sheet's header needs).
- fetchShares() now reuses _shareFromJson instead of its own thinner
  inline parser, so url/token/permissions/expireDate are actually
  populated - a public-link share could never show "Copy link" before.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-29 10:45:05 -04:00
co-authored by Claude Sonnet 5
parent f9653bc0f2
commit b73f451fff
14 changed files with 140 additions and 113 deletions
+22 -3
View File
@@ -266,7 +266,8 @@ class FilesController extends ChangeNotifier
/// sort, cache policy) - hooked to `addAccountReadyListener` as well as
/// activation so the Offline tab, which reads these same prefs, respects
/// them even on a provisional/offline login where activation never fires.
Future<void> _restoreDisplayPrefs() => _prefsRestore ??= _doRestoreDisplayPrefs();
Future<void> _restoreDisplayPrefs() =>
_prefsRestore ??= _doRestoreDisplayPrefs();
/// Completes once this account's cache policy/display prefs have been
/// loaded from storage - lets `SyncStatusController` schedule background
@@ -334,7 +335,9 @@ class FilesController extends ChangeNotifier
defaultCacheIntervalMinutes;
notifyListeners();
} catch (e) {
debugPrint('[FilesController] Account-activation prefs restore failed: $e');
debugPrint(
'[FilesController] Account-activation prefs restore failed: $e',
);
}
}
}
@@ -401,7 +404,9 @@ class FilesController extends ChangeNotifier
notifyListeners();
}
debugPrint('[FilesController] Refreshing data for path: $_currentFolderPath');
debugPrint(
'[FilesController] Refreshing data for path: $_currentFolderPath',
);
try {
final items = await service.fetchDirectory(_currentFolderPath);
@@ -549,6 +554,20 @@ class FilesController extends ChangeNotifier
return session.service?.fetchDirectory(path) ?? Future.value([]);
}
/// Finds the single item at [path] by listing its parent folder and
/// matching on the exact path - there's no WebDAV call here for stat'ing
/// one path directly outside a directory PROPFIND. Used by the Shares tab
/// to open the full Share sheet for a [NextcloudShare], which only carries
/// enough metadata for its own row, not the size/dates `ShareSheet`'s
/// header needs.
Future<NextcloudItem?> fetchItemAtPath(String path) async {
final normalized = path.startsWith('/') ? path : '/$path';
final lastSlash = normalized.lastIndexOf('/');
final parent = lastSlash <= 0 ? '/' : normalized.substring(0, lastSlash);
final items = await fetchFolderListing(parent);
return items.where((i) => i.path == normalized).firstOrNull;
}
void invalidateCache() => _directoryCache.clear();
/// Persists a per-account browsing pref under its `acct_<id>_`-namespaced