Skip to content

Commit 5732d52

Browse files
committed
feat: remove don't show again button from toast notification
1 parent 92a26db commit 5732d52

File tree

3 files changed

+5
-46
lines changed

3 files changed

+5
-46
lines changed

src/LiveDevelopment/BrowserScripts/RemoteFunctions.js

Lines changed: 4 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -3843,12 +3843,9 @@ function RemoteFunctions(config = {}) {
38433843
}
38443844

38453845
// if element is not editable and user clicks on it, then we show a toast notification saying
3846-
// that this element is not editable (unless user dismissed it permanently)
3846+
// that this element is not editable
38473847
if (!element.hasAttribute("data-brackets-id")) {
3848-
const hideToast = localStorage.getItem('phoenix-hide-dynamic-toast');
3849-
if (!hideToast) {
3850-
showToast(config.strings.toastNotEditable);
3851-
}
3848+
showToast(config.strings.toastNotEditable);
38523849
}
38533850

38543851
// make sure that the element is actually visible to the user
@@ -4592,27 +4589,6 @@ function RemoteFunctions(config = {}) {
45924589
animation: slideUp 0.3s ease-out !important;
45934590
}
45944591
4595-
.toast-message {
4596-
margin-bottom: 6px !important;
4597-
}
4598-
4599-
.toast-button {
4600-
background: none !important;
4601-
border: none !important;
4602-
color: #A0A0A0 !important;
4603-
cursor: pointer !important;
4604-
font-size: 12px !important;
4605-
font-family: Arial, sans-serif !important;
4606-
text-decoration: none !important;
4607-
pointer-events: auto !important;
4608-
transition: opacity 0.2s !important;
4609-
}
4610-
4611-
.toast-button:hover {
4612-
opacity: 0.8 !important;
4613-
text-decoration: underline !important;
4614-
}
4615-
46164592
@keyframes slideUp {
46174593
from {
46184594
opacity: 0;
@@ -4628,34 +4604,19 @@ function RemoteFunctions(config = {}) {
46284604
const content = `
46294605
<div class="toast-container">
46304606
<div class="toast-message">${message}</div>
4631-
<button class="toast-button">${config.strings.toastDontShowAgain}</button>
46324607
</div>
46334608
`;
46344609

46354610
shadow.innerHTML = `<style>${styles}</style>${content}`;
46364611
window.document.body.appendChild(toast);
46374612

4638-
// add click handler to "Don't show again" button
4639-
const button = shadow.querySelector('.toast-button');
4640-
button.addEventListener('click', () => {
4641-
// save to localStorage to never show again and close toast rn
4642-
localStorage.setItem('phoenix-hide-dynamic-toast', 'true');
4643-
if (toast && toast.parentNode) {
4644-
toast.remove();
4645-
}
4646-
if (_toastTimeout) {
4647-
clearTimeout(_toastTimeout);
4648-
_toastTimeout = null;
4649-
}
4650-
});
4651-
4652-
// Auto-dismiss after 6 seconds
4613+
// Auto-dismiss after 3 seconds
46534614
_toastTimeout = setTimeout(() => {
46544615
if (toast && toast.parentNode) {
46554616
toast.remove();
46564617
}
46574618
_toastTimeout = null;
4658-
}, 6000);
4619+
}, 3000);
46594620
}
46604621

46614622
/**

src/LiveDevelopment/main.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@ define(function main(require, exports, module) {
121121
imageGalleryClose: Strings.LIVE_DEV_IMAGE_GALLERY_CLOSE,
122122
imageGallerySelectFromComputer: Strings.LIVE_DEV_IMAGE_GALLERY_SELECT_FROM_COMPUTER,
123123
imageGallerySelectFromComputerTooltip: Strings.LIVE_DEV_IMAGE_GALLERY_SELECT_FROM_COMPUTER_TOOLTIP,
124-
toastNotEditable: Strings.LIVE_DEV_TOAST_NOT_EDITABLE,
125-
toastDontShowAgain: Strings.LIVE_DEV_TOAST_DONT_SHOW_AGAIN
124+
toastNotEditable: Strings.LIVE_DEV_TOAST_NOT_EDITABLE
126125
}
127126
};
128127
// Status labels/styles are ordered: error, not connected, progress1, progress2, connected.

src/nls/root/strings.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ define({
202202
"LIVE_DEV_IMAGE_GALLERY_SELECT_FROM_COMPUTER_TOOLTIP": "Select an image from your device",
203203
"LIVE_DEV_IMAGE_GALLERY_SELECT_FROM_COMPUTER": "Select from device",
204204
"LIVE_DEV_TOAST_NOT_EDITABLE": "Element not editable - generated by script.",
205-
"LIVE_DEV_TOAST_DONT_SHOW_AGAIN": "Don't show again",
206205
"LIVE_DEV_IMAGE_FOLDER_DIALOG_TITLE": "Select Folder to Save Image",
207206
"LIVE_DEV_IMAGE_FOLDER_DIALOG_DESCRIPTION": "Choose where to download the image:",
208207
"LIVE_DEV_IMAGE_FOLDER_DIALOG_PLACEHOLDER": "Type folder path (e.g., assets/images/)",

0 commit comments

Comments
 (0)