fix: seeders-first default, compact footer, and folder-editor input isolation

Restore the seeders-desc default ordering that the new sort feature dropped,
so the healthiest torrents stay on top until `s` is pressed. Trim the
contextual footer (terse labels, folder key in the `?` overlay only) so the
added sort and folder keys never wrap it past one line. Gate the
download-folder editor on its own `editingFolder` flag instead of the shared
capture state, fixing the leak where `?`, `q`, and `m` fired through while
typing a path.
This commit is contained in:
bairon.dev
2026-06-30 00:14:05 -04:00
parent cc881aefc4
commit 7fa049ae9d
5 changed files with 19 additions and 13 deletions
+10 -1
View File
@@ -42,6 +42,15 @@ function dedupe(list: TorrentResult[]): TorrentResult[] {
return [...byHash.values()];
}
// torlink's default ordering: healthiest first. The results view can re-sort
// on demand (the `s` key), and its "none"/default state preserves this order.
function defaultOrder(list: TorrentResult[]): TorrentResult[] {
return list.sort((a, b) => {
if (b.seeders !== a.seeders) return b.seeders - a.seeders;
return (b.added ?? 0) - (a.added ?? 0);
});
}
function idleState(): ConcurrentSearchState {
return {
results: [],
@@ -98,7 +107,7 @@ export function useConcurrentSearch(query: string): ConcurrentSearchState {
if (!alive) return;
done += 1;
setState({
results: dedupe(collected.slice()),
results: defaultOrder(dedupe(collected.slice())),
perSource: { ...per },
loading: done < SOURCES.length,
done,