Skip to content

Commit

Permalink
Fix pinned properties view gets closed when switching tools
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeDoctorDE committed Aug 1, 2024
1 parent fbf541d commit 9d4ede0
Show file tree
Hide file tree
Showing 9 changed files with 219 additions and 210 deletions.
4 changes: 2 additions & 2 deletions api/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ packages:
dependency: transitive
description:
name: coverage
sha256: "3945034e86ea203af7a056d98e98e42a5518fff200d6e8e6647e1886b07e936e"
sha256: "576aaab8b1abdd452e0f656c3e73da9ead9d7880e15bdc494189d9c1a1baf0db"
url: "https://pub.dev"
source: hosted
version: "1.8.0"
version: "1.9.0"
crypto:
dependency: transitive
description:
Expand Down
6 changes: 4 additions & 2 deletions app/lib/cubits/current_index.dart
Original file line number Diff line number Diff line change
Expand Up @@ -767,8 +767,10 @@ class CurrentIndexCubit extends Cubit<CurrentIndex> {
emit(state.copyWith(selection: selection));
}

void resetSelection() {
emit(state.copyWith(selection: null));
void resetSelection({bool force = false}) {
if (force || !state.pinned) {
emit(state.copyWith(selection: null));
}
}

void setButtons(int buttons) {
Expand Down
6 changes: 6 additions & 0 deletions app/lib/views/files/view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,13 @@ class FilesViewState extends State<FilesView> {
prefixIcon:
const PhosphorIcon(PhosphorIconsLight.folder),
filled: true,
contentPadding: const EdgeInsets.only(
left: 16,
right: 16,
bottom: 6,
),
),
textAlignVertical: TextAlignVertical.center,
controller: _locationController,
onFieldSubmitted: (value) => reloadFileSystem(),
),
Expand Down
4 changes: 2 additions & 2 deletions app/lib/views/property.dart
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class _PropertyViewState extends State<PropertyView>
selection?.onDelete(context);
context
.read<CurrentIndexCubit>()
.resetSelection();
.resetSelection(force: true);
}),
if (help.isNotEmpty)
IconButton(
Expand Down Expand Up @@ -251,6 +251,6 @@ class _PropertyViewState extends State<PropertyView>
}

void _closeView() {
context.read<CurrentIndexCubit>().resetSelection();
context.read<CurrentIndexCubit>().resetSelection(force: true);
}
}
44 changes: 22 additions & 22 deletions app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,8 @@ packages:
dependency: "direct main"
description:
path: "."
ref: "6b34ee7d2efcf0d964163e925ba946a7bf454d72"
resolved-ref: "6b34ee7d2efcf0d964163e925ba946a7bf454d72"
ref: e33c22a3e6f2326e73830b3d6e6442e8bef5ad9f
resolved-ref: e33c22a3e6f2326e73830b3d6e6442e8bef5ad9f
url: "https://github.com/rydmike/flex_color_scheme"
source: git
version: "8.0.0-dev.1"
Expand Down Expand Up @@ -975,10 +975,10 @@ packages:
dependency: "direct main"
description:
name: path_provider
sha256: c9e7d3a4cd1410877472158bee69963a4579f78b68c65a2b7d40d1a7a88bb161
sha256: fec0d61223fba3154d87759e3cc27fe2c8dc498f6386c6d6fc80d1afdd1bf378
url: "https://pub.dev"
source: hosted
version: "2.1.3"
version: "2.1.4"
path_provider_android:
dependency: transitive
description:
Expand Down Expand Up @@ -1208,58 +1208,58 @@ packages:
dependency: "direct main"
description:
name: shared_preferences
sha256: d3bbe5553a986e83980916ded2f0b435ef2e1893dfaa29d5a7a790d0eca12180
sha256: c272f9cabca5a81adc9b0894381e9c1def363e980f960fa903c604c471b22f68
url: "https://pub.dev"
source: hosted
version: "2.2.3"
version: "2.3.1"
shared_preferences_android:
dependency: transitive
description:
name: shared_preferences_android
sha256: "3d4571b3c5eb58ce52a419d86e655493d0bc3020672da79f72fa0c16ca3a8ec1"
sha256: "041be4d9d2dc6079cf342bc8b761b03787e3b71192d658220a56cac9c04a0294"
url: "https://pub.dev"
source: hosted
version: "2.2.4"
version: "2.3.0"
shared_preferences_foundation:
dependency: transitive
description:
name: shared_preferences_foundation
sha256: "0a8a893bf4fd1152f93fec03a415d11c27c74454d96e2318a7ac38dd18683ab7"
sha256: "671e7a931f55a08aa45be2a13fe7247f2a41237897df434b30d2012388191833"
url: "https://pub.dev"
source: hosted
version: "2.4.0"
version: "2.5.0"
shared_preferences_linux:
dependency: transitive
description:
name: shared_preferences_linux
sha256: "9f2cbcf46d4270ea8be39fa156d86379077c8a5228d9dfdb1164ae0bb93f1faa"
sha256: "2ba0510d3017f91655b7543e9ee46d48619de2a2af38e5c790423f7007c7ccc1"
url: "https://pub.dev"
source: hosted
version: "2.3.2"
version: "2.4.0"
shared_preferences_platform_interface:
dependency: transitive
description:
name: shared_preferences_platform_interface
sha256: "034650b71e73629ca08a0bd789fd1d83cc63c2d1e405946f7cef7bc37432f93a"
sha256: "57cbf196c486bc2cf1f02b85784932c6094376284b3ad5779d1b1c6c6a816b80"
url: "https://pub.dev"
source: hosted
version: "2.4.0"
version: "2.4.1"
shared_preferences_web:
dependency: transitive
description:
name: shared_preferences_web
sha256: "9aee1089b36bd2aafe06582b7d7817fd317ef05fc30e6ba14bff247d0933042a"
sha256: "3a293170d4d9403c3254ee05b84e62e8a9b3c5808ebd17de6a33fe9ea6457936"
url: "https://pub.dev"
source: hosted
version: "2.3.0"
version: "2.4.0"
shared_preferences_windows:
dependency: transitive
description:
name: shared_preferences_windows
sha256: "841ad54f3c8381c480d0c9b508b89a34036f512482c407e6df7a9c4aa2ef8f59"
sha256: "398084b47b7f92110683cac45c6dc4aae853db47e470e5ddcd52cab7f7196ab2"
url: "https://pub.dev"
source: hosted
version: "2.3.2"
version: "2.4.0"
shelf:
dependency: transitive
description:
Expand Down Expand Up @@ -1437,10 +1437,10 @@ packages:
dependency: transitive
description:
name: url_launcher_android
sha256: "678979703e10d7862c551c736fe6b9f185261bddf141b46672063b99790bc700"
sha256: "94d8ad05f44c6d4e2ffe5567ab4d741b82d62e3c8e288cc1fcea45965edf47c9"
url: "https://pub.dev"
source: hosted
version: "6.3.7"
version: "6.3.8"
url_launcher_ios:
dependency: transitive
description:
Expand Down Expand Up @@ -1581,10 +1581,10 @@ packages:
dependency: transitive
description:
name: win32
sha256: a79dbe579cb51ecd6d30b17e0cae4e0ea15e2c0e66f69ad4198f22a6789e94f4
sha256: "015002c060f1ae9f41a818f2d5640389cc05283e368be19dc8d77cecb43c40c9"
url: "https://pub.dev"
source: hosted
version: "5.5.1"
version: "5.5.3"
win32_registry:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ dependencies:
flex_color_scheme:
git:
url: https://github.com/rydmike/flex_color_scheme
ref: 6b34ee7d2efcf0d964163e925ba946a7bf454d72
ref: e33c22a3e6f2326e73830b3d6e6442e8bef5ad9f
json_annotation: ^4.9.0
path: ^1.8.3
printing: ^5.12.0
Expand Down
6 changes: 3 additions & 3 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/check": "^0.8.3",
"@astrojs/react": "^3.6.0",
"@astrojs/check": "^0.9.1",
"@astrojs/react": "^3.6.1",
"@astrojs/starlight": "^0.25.3",
"@phosphor-icons/react": "^2.1.7",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"astro": "^4.12.2",
"astro": "^4.13.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"remark-gemoji": "^8.0.0",
Expand Down
Loading

0 comments on commit 9d4ede0

Please sign in to comment.