Comfy-Org / Comfy-Org/ComfyUI_frontend
[Feature Request]: Allow toast location to be moved
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues and checked the recent builds/commits
### What would your feature do ?
Make the location that toast notifications appear configurable.
### Proposed workflow
1. Go to settings
2. Click **Toast Location** dropdown (default: **Right**)
3. Select **Centre**
4. Toasts are now anchored to the centre of the top edge of the canvas, rather than the top-right corner
### Additional information
On a 32:9 screen, it is easy to miss small changes (e.g. toast notification) on one side of the display if you are looking at the opposite edge.
Below is the hard-coded override I cherry-pick locally.
```diff
diff --git a/src/components/toast/GlobalToast.vue b/src/components/toast/GlobalToast.vue
index 848ad15c..fc9925da 100644
--- a/src/components/toast/GlobalToast.vue
+++ b/src/components/toast/GlobalToast.vue
@@ -64,8 +64,9 @@ function updateToastPosition() {
styleElement.textContent = `
.p-toast.p-component.p-toast-top-right {
- top: ${rect.top + 20}px !important;
- right: ${window.innerWidth - (rect.left + rect.width) + 20}px !important;
+ top: 20px !important;
+ left: 50% !important;
+ transform: translateX(-50%);
}
`
}
```
┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-3581-Feature-Request-Allow-toast-location-to-be-moved-1de6d73d365081f29e27ddd98a54c2dd) by [Unito](https://www.unito.io)
Contributor guide
Assessment
This issue has not been assessed yet.