Skip to content

Commit 45480ba

Browse files
committed
Add Notifications on Button Interaction
1 parent 8e06033 commit 45480ba

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## Version 0.2.0
4+
- Add Notifications when copying to clipboard and exporting .env file
5+
36
## Version 0.1.3
47
- Bump Textual Version requirement to 0.55.1
58
- Fix Bad Identifier ID Naming

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ python_requires = >=3.8
4848
# new major versions. This works if the required packages follow Semantic Versioning.
4949
# For more information, check out https://semver.org/.
5050
install_requires =
51-
textual<=0.55.1
51+
textual
5252
platformdirs
5353
pyperclip
5454

src/dotenvhub/widgets/interactionpanel.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,26 @@ def compose(self):
5555
# Export Interactions
5656
@on(Button.Pressed, "#btn-copy-path")
5757
def copy_env_path(self):
58-
copy_path_to_clipboard(path=self.app.file_to_show_path)
58+
copy_str = copy_path_to_clipboard(path=self.app.file_to_show_path)
59+
self.notify(title="Copied to Clipboard", message=f"Path: [green]{copy_str}[/]")
5960

6061
@on(Button.Pressed, "#btn-file-export")
6162
def export_env_file(self):
6263
export_filename = self.query_one(Input).value
6364
create_copy_in_cwd(
6465
filename=export_filename, filepath=self.app.file_to_show_path
6566
)
67+
self.notify(title="Env File Created", message=f"Created: {export_filename}")
6668

6769
@on(Button.Pressed, "#btn-shell-export")
6870
def export_env_str_shell(self):
69-
create_shell_export_str(
71+
shell_str = create_shell_export_str(
7072
shell=self.app.current_shell, env_content=self.app.current_content
7173
)
74+
self.notify(
75+
title="Copied to Clipboard",
76+
message=f"Command: [green]{shell_str}[/]",
77+
)
7278

7379
# Shell Select Interactions
7480
@on(Button.Pressed, "#btn-shell-select")

src/dotenvhub/widgets/modals.py

+4
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ def pop_up_shell_select(self, event: Button.Pressed) -> None:
4343
cfg.shell = self.app.current_shell
4444

4545
self.app.query_one("#btn-shell-select").label = self.app.current_shell
46+
self.notify(
47+
title="Shell Selected",
48+
message=f"Current active Shell: [green]{self.app.current_shell}[/]",
49+
)
4650

4751

4852
class ModalSaveScreen(ModalScreen):

0 commit comments

Comments
 (0)