Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #901; this is the implementation of what I proposed there, see
#901 (comment) (demo video there). Draft
because the design question raised there is still open — happy to adjust before this lands.
Double-click (and Enter) on a file does nothing today. Rather than deciding "edit" or "download" for everybody in
code, the first gesture asks the user once, remembers the answer, and applies it to that file: Download /
Prefer editor / Ask.
The intent was to stay inside the conventions this repo already has instead of inventing new ones: the preference
is plain
localStoragelike the show-hidden and sort settings, the dialogs use the existingdialogs.run()idiom,every string goes through gettext, and a
test/check-applicationcase covers the behavior. The UI is unobtrusiveby design: no settings page to discover and nothing happens on first load — the chooser appears only when a gesture
would otherwise do nothing, and once it is answered the gesture just works.
menu.tsxintoeditor_supports()so themenu, the gesture and the ask dialog read one gate; files it rejects download. dialogs: Check file content before opening files in the editor #1525 goes on to weigh the bytes
before the editor opens anything.
when there are unsaved edits.
localStorageis per browser profile like the other view preferences (invalid values degrade to"not set"), symlinks stay no-ops as in the context menu, and Enter/ArrowDown ignore key auto-repeat now that the
gesture does something.
editor-modal-changed*andeditor-modal-read-only*(all layouts), so
testEditorwill fail the first CI run. I'll grab the new images withtest/common/pixel-tests fetchfrom that run's log dir and add thetest/referencebump as its own commit,which looks like the intended flow for a pixel-changing PR.
The new
TestFiles.testDefaultFileActionpasses on fedora-44 / chromium in the nested-VM harness — worth stating,as a draft PR gets no CI until a maintainer runs it.
I wrote this with an AI coding assistant (opencode + Qwen); I reviewed, tested, and carry every line myself.
Files: Configurable default file action
Files can now answer a double-click (or Enter) the way their user wants: download, open in the editor when the file
looks editable, or ask each time. The answer is given once in a first-run dialog and lives in the ⋮ menu afterwards.
The file editor also gained a Download button that works even with unsaved changes.