Ecdar / Ecdar/Ecdar-GUI-Web

Don't use JS-based prompts

Open
#146 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
2
Forks
0
PR merge metrics
No merged PRs in 30d

Description

JavaScript-based prompts like [`alert`](https://developer.mozilla.org/en-US/docs/Web/API/Window/alert), [`prompt`](https://developer.mozilla.org/en-US/docs/Web/API/Window/prompt) and [`confirm`](https://developer.mozilla.org/en-US/docs/Web/API/Window/confirm) are quick and easy to use, but are generally not a recommended way to interact with the user.

We cannot control how the browser displays them, or if the browser displays them at all. For example, a common annoyance with them is that the user can't close the browser while a prompt is being shown. They are also known to have accessibility issues. Another factor for us is that Tauri doesn't have full support for all prompt types, and we would like to only use browser features that we know works correctly in Tauri as well.

We should therefore build a few Svelte components that work on top of the standard `modal` component we are currently working on. We can make whatever prompt types that are necessary, and can then replace all native JS prompts with calls to open these custom modals. The API to do so can be modelled after the native JS API's if that is what we find to be the best developer experience.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.