Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show currently-computed path on saveinput if valid #232

Closed
tconbeer opened this issue Apr 11, 2024 · 1 comment · Fixed by #235
Closed

Show currently-computed path on saveinput if valid #232

tconbeer opened this issue Apr 11, 2024 · 1 comment · Fixed by #235
Labels
enhancement New feature or request

Comments

@tconbeer
Copy link
Owner

re-use space used by the validation error label

Show fully-resolved path, but try to show it relative to ~ if that works.

e.g.:

  • user types ./foo, show ~/projects/data_project/foo if cwd is ~/projects/data_project
  • user types ./foo, show /tmp/abc123/foo if cwd is /tmp/abc123

see tconbeer/harlequin#511

@tconbeer tconbeer added the enhancement New feature or request label Apr 11, 2024
@tconbeer
Copy link
Owner Author

see this event handler:

@on(Input.Changed)
def update_validation_label(self, message: Input.Changed) -> None:
if message.input.id in ("textarea__save_input", "textarea__open_input"):
label = self.footer.query_one(Label)
if message.validation_result and not message.validation_result.is_valid:
label.update(";".join(message.validation_result.failure_descriptions))
else:
label.update("")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant