anchor.diff:    bool get wantKeepAlive => true;
   }
   
  +enum ViewMode {
  +  explorer,
  +  discography,
  +}
  +
   class BrowserLocation extends StatefulWidget {
     final String location;
     final void Function(dto.Directory) onDirectoryTapped;
  
positive.code: import 'package:polaris/platform/api.dart';
  import 'package:polaris/platform/dto.dart' as dto;
  import 'package:polaris/ui/collection/album_details.dart';
  import 'package:polaris/ui/utils/format.dart';
  import 'package:polaris/ui/utils/thumbnail.dart';
  
  
negative.code:     });
    }
  
    ViewMode _getViewMode() {
      if (_files == null || _files.length == 0) {
        return ViewMode.explorer;
      }
  
      var onlyDirectories = true;
      var hasAnyPicture = false;
      var allHaveAlbums = true;
      for (var file in _files) {
        onlyDirectories &= file.isDirectory();
        hasAnyPicture |= file.asDirectory()?.artwork != null;
        allHaveAlbums &= file.asDirectory()?.album != null;
      }
  
      if (onlyDirectories && hasAnyPicture && allHaveAlbums) {
        return ViewMode.discography;
      }
      return ViewMode.explorer;
    }
  
    @override
    Widget build(BuildContext context) {
      if (_files == null) {
        return Center(child: CircularProgressIndicator());
      }
      // TODO handle zero files
      if (_getViewMode() == ViewMode.discography) {
        final albums = _files.map((f) => f.asDirectory()).toList();
        return AlbumGrid(albums);
      } else {
        return ListView.builder(
          physics: BouncingScrollPhysics(),
          itemCount: _files.length,
          itemBuilder: (context, index) {
            final file = _files[index];
            if (file.isDirectory()) {
              final directory = file.asDirectory();
              return Directory(directory, onTap: () => widget.onDirectoryTapped(directory));
            } else {
              assert(file.isSong());
              return Song(file.asSong());
            }
          },
        );
      }
    }
  }
  
  