Korbin de Man and Chris Biscardi
e4e656fb42
Add "Add to .gitignore" action in project_panel ( #47377 )
...
This PR adds a "Add to .gitignore" action to the project panel's
right-click context menu. Similar to the "Restore File" action that I
previously added, I frequently find myself wanting this in the project
panel.
<img width="380" height="391" alt="image"
src="https://github.com/user-attachments/assets/e4438fbe-b070-40c8-9e57-84b003fa5c15 "
/>
With the restore file option:
<img width="382" height="408" alt="image"
src="https://github.com/user-attachments/assets/84425de8-04e5-4969-8991-edc46e6420dc "
/>
Notes:
- **Implementation**: The `add_to_gitignore` function is essentially
copy-pasted from `git_panel.rs`.
- **Error handling**: Added toast notification on error, which is
consistent with `restore_file` in project_panel and `perform_checkout`
in git_panel.
Note that `add_to_gitignore` in git_panel does NOT show a toast (just
uses `detach_and_log_err`). I don't know if this is on purpose.
To follow up, I can either: match the project_panel implementation to
the git_panel one (no toast), or update the git_panel implementation to
also show a toast on error.
- **Menu grouping**: Previously "Restore File" and "View File History"
were in separate sections, but both relate to git. With this third git
action, I grouped all three together under a single separator (see
screenshot).
We could also keep "View File History" separate and only group "Restore
File" + "Add to .gitignore" together (both modify the working tree state
in some way), if we don't want to alter the existing UI too much.
Release Notes:
- Added "Add to .gitignore" option to the project panel context menu for
files in git repositories.
---------
Co-authored-by: Chris Biscardi <chris@christopherbiscardi.com >
2026-04-23 05:46:58 +00:00
..
2026-04-22 15:02:57 +00:00
2026-04-22 14:57:12 -07:00
2026-04-16 12:54:17 +00:00
2026-04-21 09:01:42 +00:00
2026-04-22 15:02:57 +00:00
2026-04-22 15:02:57 +00:00
2026-04-22 15:02:57 +00:00
2026-04-22 20:02:27 +03:00
2026-04-15 21:51:15 -03:00
2026-04-22 13:39:48 +00:00
2026-02-18 12:00:02 +01:00
2026-03-24 00:58:09 +01:00
2026-03-18 21:31:20 -04:00
2026-03-03 17:47:35 +01:00
2026-04-15 21:51:15 -03:00
2026-04-22 22:18:46 +00:00
2026-03-13 08:00:22 +00:00
2026-04-16 12:54:17 +00:00
2026-04-20 09:29:51 +00:00
2026-03-30 13:07:13 +00:00
2026-04-20 18:03:26 -07:00
2026-04-16 19:30:27 +02:00
2026-02-25 08:12:04 +01:00
2026-04-07 12:28:19 -03:00
2026-04-10 10:15:28 -04:00
2026-04-22 13:39:48 +00:00
2026-04-02 17:06:57 -03:00
2026-04-22 20:26:43 -04:00
2026-04-21 09:01:42 +00:00
2026-03-27 18:06:56 -07:00
2026-04-22 11:12:32 -06:00
2026-04-15 21:51:15 -03:00
2026-04-21 08:06:40 +00:00
2026-04-05 23:05:35 +01:00
2026-04-20 14:33:18 +02:00
2026-03-27 14:56:46 -07:00
2026-03-11 03:08:39 +00:00
2026-04-02 17:06:57 -03:00
2026-04-21 07:25:22 +00:00
2026-03-30 09:06:59 +00:00
2026-03-16 16:29:24 +00:00
2026-04-15 23:25:44 +00:00
2026-01-14 07:19:13 +00:00
2026-04-21 19:54:02 +00:00
2026-04-21 19:25:21 +00:00
2026-04-09 10:42:21 -03:00
2026-04-22 16:56:14 -07:00
2026-04-20 08:53:15 +00:00
2026-04-22 15:09:09 +01:00
2026-04-20 10:35:02 -04:00
2026-04-22 10:40:37 +00:00
2026-04-21 07:25:22 +00:00
2026-04-20 14:03:26 +03:00
2026-04-10 13:27:04 -04:00
2026-04-21 09:01:42 +00:00
2026-04-22 21:53:08 +02:00
2026-04-01 17:25:32 +00:00
2026-04-07 12:28:19 -03:00
2026-02-28 21:47:30 -05:00
2026-04-22 15:02:57 +00:00
2026-02-19 18:57:49 +01:00
2026-02-28 22:42:19 -05:00
2026-04-21 17:32:54 -04:00
2026-03-24 19:11:30 -04:00
2026-04-21 17:32:54 -04:00
2026-04-21 17:32:54 -04:00
2026-04-21 09:01:42 +00:00
2026-04-21 09:43:44 -07:00
2026-04-18 06:34:19 +00:00
2026-04-16 07:45:38 +00:00
2026-04-21 09:01:42 +00:00
2026-04-22 16:11:51 -04:00
2026-02-19 18:57:49 +01:00
2026-04-03 11:00:13 +00:00
2026-04-21 11:01:20 +02:00
2026-04-22 16:11:51 -04:00
2026-04-22 16:11:51 -04:00
2026-01-31 21:56:34 +00:00
2026-04-23 05:46:58 +00:00
2026-04-01 17:25:32 +00:00
2026-04-22 13:39:48 +00:00
2026-04-23 02:50:58 +00:00
2026-04-22 20:02:27 +03:00
2026-04-21 07:25:22 +00:00
2026-04-16 10:37:05 -04:00
2026-03-24 11:05:12 +00:00
2026-04-21 07:25:22 +00:00
2026-04-14 18:14:31 +02:00
2026-02-26 18:36:50 +01:00
2026-03-31 13:16:53 +00:00
2026-04-21 09:55:14 +02:00
2026-04-21 13:35:13 -04:00
2026-04-22 19:45:26 +00:00
2026-04-07 11:19:21 +05:30
2026-04-17 13:54:43 +02:00
2026-03-28 18:41:33 -04:00
2026-04-22 22:22:10 +00:00
2026-04-17 13:54:43 +02:00
2026-02-12 00:28:17 +00:00
2026-03-12 15:34:09 -07:00
2026-04-22 15:09:09 +01:00
2026-04-21 09:01:42 +00:00
2026-04-22 18:19:12 +00:00
2026-04-18 00:55:44 +02:00
2026-04-02 12:52:42 +00:00
2026-04-22 13:39:48 +00:00
2026-04-15 10:11:44 +02:00
2026-04-22 13:39:48 +00:00
2026-04-22 13:39:48 +00:00
2026-03-25 12:07:34 -06:00
2026-04-01 17:25:32 +00:00
2026-04-21 19:54:02 +00:00
2026-04-22 20:02:45 +03:00
2026-04-01 17:25:32 +00:00
2026-02-03 15:51:40 -05:00
2026-03-24 00:58:09 +01:00
2026-03-06 16:49:55 +00:00
2026-03-17 08:36:37 +01:00
2026-04-22 13:38:18 +00:00
2026-04-21 18:26:45 -07:00
2026-04-22 15:43:53 +05:30
2026-03-27 14:41:25 +01:00
2026-04-09 10:42:21 -03:00
2026-04-22 02:42:11 +00:00
2026-02-17 10:41:10 +00:00
2026-02-20 13:36:04 +00:00
2026-04-14 11:10:31 +00:00
2026-04-15 21:51:15 -03:00
2026-04-15 02:21:56 -04:00
2026-04-21 09:27:12 -03:00
2026-04-22 13:39:48 +00:00
2026-03-27 14:41:25 +01:00
2026-04-07 12:28:19 -03:00
2026-04-17 10:51:32 -04:00
2026-04-01 17:25:32 +00:00
2026-04-21 09:01:42 +00:00
2026-03-13 14:13:12 -03:00
2026-04-21 07:57:35 +02:00
2026-04-21 09:01:42 +00:00
2026-04-08 00:34:54 +00:00
2026-03-31 12:48:22 +03:00
2026-04-23 05:46:58 +00:00
2026-02-19 18:57:49 +01:00
2026-04-23 05:46:58 +00:00
2026-04-09 16:38:07 +00:00
2026-03-26 13:48:18 +00:00
2026-04-22 20:26:43 -04:00
2026-04-21 20:39:06 -03:00
2026-04-15 23:25:44 +00:00
2026-04-21 07:44:24 +00:00
2026-04-16 16:36:09 -07:00
2026-04-22 20:02:45 +03:00
2026-04-21 23:39:53 +00:00
2026-03-09 13:22:12 +01:00
2026-03-21 14:05:30 +01:00
2026-04-13 09:07:09 +00:00
2026-04-22 13:39:48 +00:00
2026-03-07 04:11:45 +00:00
2026-03-27 14:41:25 +01:00
2026-04-22 10:47:52 -06:00
2026-03-18 12:05:57 -07:00
2026-04-22 20:02:45 +03:00
2026-04-22 20:02:45 +03:00
2026-03-25 12:07:34 -06:00
2026-04-02 00:44:53 +00:00
2026-04-22 20:02:45 +03:00
2026-03-16 23:49:34 -04:00
2026-04-22 15:02:57 +00:00
2026-01-26 13:49:26 +00:00
2026-02-12 00:28:17 +00:00
2026-03-10 20:25:12 +00:00
2026-03-21 14:05:30 +01:00
2026-03-29 14:43:05 +00:00
2026-03-31 08:06:37 -06:00
2026-04-20 14:41:29 +02:00
2026-04-02 13:09:29 +00:00
2026-04-07 06:14:00 +00:00
2026-01-28 16:36:44 -08:00
2026-04-21 08:11:30 +00:00
2026-04-21 19:54:02 +00:00
2026-04-01 17:25:32 +00:00
2026-04-20 12:51:10 +02:00
2026-03-27 14:41:25 +01:00
2026-03-27 14:41:25 +01:00
2026-04-07 23:41:34 +00:00
2026-04-10 09:20:38 +00:00
2026-02-28 21:47:30 -05:00
2026-04-21 09:14:10 -03:00
2026-04-01 17:25:32 +00:00
2026-04-21 23:16:56 -03:00
2026-03-13 19:37:18 -03:00
2026-03-27 15:31:49 +00:00
2026-03-27 14:41:25 +01:00
2026-04-22 18:19:40 +00:00
2026-04-09 10:42:21 -03:00
2026-04-22 16:40:49 +00:00
2026-03-19 12:53:26 -04:00
2026-03-09 13:22:12 +01:00
2026-04-07 12:28:19 -03:00
2026-03-27 14:41:25 +01:00
2026-04-22 17:03:34 +00:00
2026-04-22 17:43:16 +02:00
2026-02-19 18:57:49 +01:00
2026-04-22 13:39:48 +00:00
2026-04-22 22:22:10 +00:00
2026-04-21 19:54:02 +00:00
2026-04-02 17:06:57 -03:00
2026-04-02 17:06:57 -03:00
2026-04-22 12:48:01 +00:00
2026-03-03 08:37:58 +00:00
2026-02-11 11:24:04 +00:00