No description
Find a file
chris-010 3c9a78ac9f fix: accept a URI typed into the location bar from any location
The location bar inherits its type from the tab's current location
(Message::EditLocationEnable), and the view has exactly two branches, next
to the existing "TODO: allow editing other locations": a Location::Network
is edited through with_uri, anything else through with_path. Typing
smb://server/share while standing in a local folder therefore produced
Path("smb://server/share"), which is not a directory, and the navigation
was dropped. The reverse direction was broken the same way: from the
Networks view a local path was passed to with_uri and became a bogus
network location.

EditLocationSubmit now decides by parsing the text instead of by the
location it came from:

  * parses as a URL with a scheme other than "file" and has a host
    -> Location::Network, using url::Url::as_str(), which also normalizes
       away surrounding whitespace.
  * fails to parse and the current location is a Network
    -> Location::Path, with the text untrimmed, because a directory name
       may legitimately end in a space.
  * anything else is left as it was, so network:/// and foo:bar keep
    behaving exactly as before.

The reliable indicator for "this is a path" is that parsing fails, not
that the host is missing: network:/// and file:///home both parse with
has_host() == false. Verified against url 2.5.8.

An unmounted share cannot be resolved, since Tab::resolve sends network
locations through mounter.dir_info, so resolve() returns None and the
navigation would be dropped again. Navigating there is what triggers the
mount, because Cmd::NetworkScan mounts the location it is asked to scan,
so the typed URI is used as a fallback. That fallback is restricted to
input recognised by the first rule above; applying it to any network
location would let unparseable text through, and because with_uri keeps
the display name and path of the previous location, the window would look
normal while the listing stayed empty.

Known cosmetic side effect: while the share is not mounted, resolve()
yields nothing and the tab shows the raw URI as its name. It is replaced
by the proper name as soon as the mount completes.

Drafted with AI assistance (Claude Code); the change was reviewed, built
and tested by me on real hardware as described.

Signed-off-by: chris-010 <10660568+chris-010@users.noreply.github.com>
2026-08-18 16:01:32 -06:00
.github Add pull request template 2026-02-13 12:35:27 -07:00
.zed chore: add rustfmt config 2026-04-29 00:53:57 +02:00
cosmic-files-applet Epoch 1.6.0 version update 2026-08-18 13:58:04 -06:00
debian Epoch 1.6.0 version update 2026-08-18 13:58:04 -06:00
examples chore: add rustfmt config 2026-04-29 00:53:57 +02:00
i18n i18n: translation updates from weblate 2026-08-18 05:51:50 +00:00
res Generate translated desktop and metainfo files with xdgen 2026-02-12 14:46:38 -07:00
samples Add mode samples 2025-02-12 10:44:53 -07:00
scripts Remove fs_extra (#655) 2024-11-13 14:36:11 -07:00
src fix: accept a URI typed into the location bar from any location 2026-08-18 16:01:32 -06:00
.gitignore Add just flamegraph target 2024-11-14 09:28:28 -07:00
build.rs chore: add rustfmt config 2026-04-29 00:53:57 +02:00
Cargo.lock Epoch 1.6.0 version update 2026-08-18 13:58:04 -06:00
Cargo.toml Epoch 1.6.0 version update 2026-08-18 13:58:04 -06:00
i18n.toml Basic implementation 2024-01-03 15:27:32 -07:00
justfile build: use cargo vendor --locked 2026-06-02 09:52:14 -04:00
LICENSE Initial commit 2024-01-03 13:34:32 -07:00
README.md Remove WIP note from readme 2026-01-13 10:07:50 -07:00
rust-toolchain.toml chore: add rust-toolchain to enforce 1.93 2026-05-01 19:10:23 +02:00
rustfmt.toml chore: add rustfmt config 2026-04-29 00:53:57 +02:00
TESTING.md docs (QA): Add file drag-and-drop to regression testing checklist 2025-12-19 13:36:31 -07:00

cosmic-files

File manager for the COSMIC desktop environment

Build the project from source

# Clone the project using `git`
git clone https://github.com/pop-os/cosmic-files
# Change to the directory that was created by `git`
cd cosmic-files
# Build an optimized version using `cargo`, this may take a while
cargo build --release
# Run the optimized version using `cargo`
cargo run --release

Community and Contributing

The COSMIC desktop environment is maintained by System76 for use in Pop!_OS. A list of all COSMIC projects can be found in the cosmic-epoch project's README. If you would like to discuss COSMIC and Pop!_OS, please consider joining the Pop!_OS Chat. More information and links can be found on the Pop!_OS Website.

License

This project is licensed under GPLv3