Closes#1474https://github.com/user-attachments/assets/69fb51ca-225c-43c9-91c9-8f48375e39c4
- [x] I have disclosed use of any AI generated code in my commit
messages.
- If you are using an LLM, and do not fully understand the changes it is
making to the code base, do not create a PR.
- In our experience, AI generated code often results in overly complex
code that lacks enough context for a proper fix or feature inclusion.
This results in considerably longer code reviews. Due to this, AI
authored or partially authored PRs may be closed without comment.
- [x] I understand these changes in full and will be able to respond to
review comments.
- [x] My change is accurately described in the commit message.
- [x] My contribution is tested and working as described.
- [x] I have read the [Developer Certificate of
Origin](https://developercertificate.org/) and certify my contribution
under its conditions.
Address review feedback on the sidebar favorite renaming feature:
- Context menu item and dialog title now share the same
"change-sidebar-label" translation key
- Rename NavMenuAction::RenameFavorite and DialogPage::RenameFavorite
to ChangeSidebarLabel, with the dialog field renamed to "label"
- Rename Favorite::with_name to Favorite::with_label
- Dialog confirm button now uses the existing "save" key instead of
"rename-confirm"
- Replace the "rename-favorite"/"favorite-name" keys with
"sidebar-label" in en and pt-BR translations
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YRJDQDBKhCqipbcZm7U1v9
Modification time is doing an unchecked add. Files with bad mtime will
overflow and crash the app.
Use a checked add instead, returning None and displaying an empty mtime
instead.
This only affects mtimes via GVFS. Viewing local files works because it
interprets the mtime directly instead of relying on addition.
Fixes#1886
- [x] I have disclosed use of any AI generated code in my commit
messages.
- [x] I understand these changes in full and will be able to respond to
review comments.
- [x] My change is accurately described in the commit message.
- [x] My contribution is tested and working as described.
- [x] I have read the [Developer Certificate of
Origin](https://developercertificate.org/) and certify my contribution
under its conditions.
The "Open With" context menu item, which allows you to open a file, now
includes a search option by application name.
Demo:
https://github.com/user-attachments/assets/b4ff5da3-4bdf-4a0f-a20b-b6783f293fef
- [x] I have disclosed use of any AI generated code in my commit
messages.
- If you are using an LLM, and do not fully understand the changes it is
making to the code base, do not create a PR.
- In our experience, AI generated code often results in overly complex
code that lacks enough context for a proper fix or feature inclusion.
This results in considerably longer code reviews. Due to this, AI
authored or partially authored PRs may be closed without comment.
- [x] I understand these changes in full and will be able to respond to
review comments.
- [x] My change is accurately described in the commit message.
- [x] My contribution is tested and working as described.
- [x] I have read the [Developer Certificate of
Origin](https://developercertificate.org/) and certify my contribution
under its conditions.
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>
- Adds context menu to text input fields
- Adds selectable text to context drawer, but only to file name,
created/modified/accessed date. I'm sure more places could use the
selectable text.
- Also pulls the latest changes in Iced and libcosmic that removes
"redraw on any message", which means moving the cursor doesn't
automatically call a redraw, widgets need to ask for it. I have found
all places that previously was working normally because we were
redrawing almost unconditionally. But it is possible that a custom
widget somewhere still isn't asking for a redraw explicitly when its
state changes. So, for QA I'd keep an eye on that.
Depends on:
- [x] https://github.com/pop-os/libcosmic/pull/1288
- [x] https://github.com/pop-os/iced/pull/378
- [x] https://github.com/pop-os/libcosmic/pull/1384
- [x] https://github.com/pop-os/libcosmic/pull/1388https://github.com/user-attachments/assets/caf8f940-0793-4665-844a-b6153b35d7bb
___
- [x] I have disclosed use of any AI generated code in my commit
messages.
- If you are using an LLM, and do not fully understand the changes it is
making to the code base, do not create a PR.
- In our experience, AI generated code often results in overly complex
code that lacks enough context for a proper fix or feature inclusion.
This results in considerably longer code reviews. Due to this, AI
authored or partially authored PRs may be closed without comment.
- [x] I understand these changes in full and will be able to respond to
review comments.
- [x] My change is accurately described in the commit message.
- [x] My contribution is tested and working as described.
- [x] I have read the [Developer Certificate of
Origin](https://developercertificate.org/) and certify my contribution
under its conditions.
Selecting a broken network mount triggers an infinite loop of dialogs
that requires killing the app:
1. Click invalid network mount
2. Try to mount network path
3. Show failure dialog
4. Trigger `NetworkDriveOpenEntityAfterMount`
* BUG: This fires even if the mount failed or the user canceled the
dialog!
6. Goto 2
Fix by having `network_drive(...)` return a Boolean indicating whether
the mount actually happened and using that to break the infinite error
loop.
Fixes#1629
Sample broken network path that triggers the infinite dialog when
selected:
**~/.config/cosmic/com.system76.CosmicFiles/v1/favorites**
```ron
[
Home,
Documents,
Downloads,
Network(
uri: "sftp://myserver/shared",
name: "",
path: "/tmp/fake-network/sftp-host=myserver/mnt",
),
]
```
- [x] I have disclosed use of any AI generated code in my commit
messages.
- [x] I understand these changes in full and will be able to respond to
review comments.
- [x] My change is accurately described in the commit message.
- [x] My contribution is tested and working as described.
- [x] I have read the [Developer Certificate of
Origin](https://developercertificate.org/) and certify my contribution
under its conditions.
At the moment any directory anywhere named "files" is considered trash
by cosmic-files and shown as empty.
This tightens the check on what is a trash directory with a fallback
where it also expect an info directory next to the files directory(only
used if the system doesn't report any trash directory).
As an added bonus I fixed the let _ = THUMB_SEMAPHORE.acquire() that was
immediately discarded and thus dead code.
- [X] I have disclosed use of any AI generated code in my commit
messages.
- If you are using an LLM, and do not fully understand the changes it is
making to the code base, do not create a PR.
- In our experience, AI generated code often results in overly complex
code that lacks enough context for a proper fix or feature inclusion.
This results in considerably longer code reviews. Due to this, AI
authored or partially authored PRs may be closed without comment.
- [X] I understand these changes in full and will be able to respond to
review comments.
- [X] My change is accurately described in the commit message.
- [X] My contribution is tested and working as described.
- [X] I have read the [Developer Certificate of
Origin](https://developercertificate.org/) and certify my contribution
under its conditions.
- [x] I have disclosed use of any AI generated code in my commit
messages.
- If you are using an LLM, and do not fully understand the changes it is
making to the code base, do not create a PR.
- In our experience, AI generated code often results in overly complex
code that lacks enough context for a proper fix or feature inclusion.
This results in considerably longer code reviews. Due to this, AI
authored or partially authored PRs may be closed without comment.
- [x] I understand these changes in full and will be able to respond to
review comments.
- [x] My change is accurately described in the commit message.
- [x] My contribution is tested and working as described.
- [x] I have read the [Developer Certificate of
Origin](https://developercertificate.org/) and certify my contribution
under its conditions.
- [x] I have disclosed use of any AI generated code in my commit
messages.
- If you are using an LLM, and do not fully understand the changes it is
making to the code base, do not create a PR.
- In our experience, AI generated code often results in overly complex
code that lacks enough context for a proper fix or feature inclusion.
This results in considerably longer code reviews. Due to this, AI
authored or partially authored PRs may be closed without comment.
- [x] I understand these changes in full and will be able to respond to
review comments.
- [x] My change is accurately described in the commit message.
- [x] My contribution is tested and working as described.
- [x] I have read the [Developer Certificate of
Origin](https://developercertificate.org/) and certify my contribution
under its conditions.