mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
Remove legacy Direct Message privacy UI
Removes the "Direct message privacy" section from the profile modal's Messages tab, as these settings are now managed via the AppShell (gear icon). - Removed privacy section HTML from `components/profile-modal.html`. - Updated `js/ui/profileModalController.js` to remove legacy DOM references and event listeners. - Preserved `handleReadReceiptsToggle` and `handleTypingIndicatorsToggle` methods for AppShell integration. - Updated `syncDmPrivacySettingsUi` to be a no-op to prevent errors in existing call sites.
This commit is contained in:
1 parent
a126bc2d0e
commit
ac4d087f3e
4 files changed
+56
-47
No files matched your search
@@ -1088,36 +1088,6 @@
|
||||
role="tabpanel"
|
||||
aria-labelledby="profileNavMessages"
|
||||
>
|
||||
<div class="card flex flex-col gap-4 p-4">
|
||||
<div class="space-y-1">
|
||||
<h3 class="text-sm font-semibold text-text">Direct message privacy</h3>
|
||||
<p class="text-xs text-muted">
|
||||
Control read receipts and typing indicators for direct messages.
|
||||
</p>
|
||||
</div>
|
||||
<div class="flex flex-col gap-3">
|
||||
<label class="flex items-center justify-between gap-3 text-sm text-text">
|
||||
<span>Read receipts</span>
|
||||
<input
|
||||
id="profileMessagesReadReceiptsToggle"
|
||||
type="checkbox"
|
||||
class="switch"
|
||||
role="switch"
|
||||
aria-label="Enable read receipts"
|
||||
/>
|
||||
</label>
|
||||
<label class="flex items-center justify-between gap-3 text-sm text-text">
|
||||
<span>Typing indicators</span>
|
||||
<input
|
||||
id="profileMessagesTypingToggle"
|
||||
type="checkbox"
|
||||
class="switch"
|
||||
role="switch"
|
||||
aria-label="Enable typing indicators"
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div id="dmAppShellMount"></div>
|
||||
</section>
|
||||
<section
|
||||
|
||||
@@ -1297,8 +1297,6 @@ export class ProfileModalController {
|
||||
this.profileMessagesRelayAddButton = null;
|
||||
this.profileMessagesRelayPublishButton = null;
|
||||
this.profileMessagesRelayStatus = null;
|
||||
this.profileMessagesReadReceiptsToggle = null;
|
||||
this.profileMessagesTypingToggle = null;
|
||||
this.profileMessagesUnreadDot = null;
|
||||
this.dmAppShellContainer = null;
|
||||
this.dmAppShell = null;
|
||||
@@ -1616,10 +1614,6 @@ export class ProfileModalController {
|
||||
document.getElementById("profileMessagesRelayPublish") || null;
|
||||
this.profileMessagesRelayStatus =
|
||||
document.getElementById("profileMessagesRelayStatus") || null;
|
||||
this.profileMessagesReadReceiptsToggle =
|
||||
document.getElementById("profileMessagesReadReceiptsToggle") || null;
|
||||
this.profileMessagesTypingToggle =
|
||||
document.getElementById("profileMessagesTypingToggle") || null;
|
||||
this.profileMessagesUnreadDot =
|
||||
document.getElementById("profileMessagesUnreadDot") || null;
|
||||
this.dmAppShellContainer =
|
||||
@@ -2133,17 +2127,9 @@ export class ProfileModalController {
|
||||
}
|
||||
|
||||
syncDmPrivacySettingsUi() {
|
||||
const settings = this.getDmPrivacySettingsSnapshot();
|
||||
|
||||
if (this.profileMessagesReadReceiptsToggle instanceof HTMLInputElement) {
|
||||
this.profileMessagesReadReceiptsToggle.checked =
|
||||
settings.readReceiptsEnabled;
|
||||
}
|
||||
|
||||
if (this.profileMessagesTypingToggle instanceof HTMLInputElement) {
|
||||
this.profileMessagesTypingToggle.checked =
|
||||
settings.typingIndicatorsEnabled;
|
||||
}
|
||||
// Legacy UI toggles removed.
|
||||
// This method is kept for backwards compatibility with call sites that might expect it,
|
||||
// though the settings are now managed via AppShell.
|
||||
}
|
||||
|
||||
handleReadReceiptsToggle(enabled) {
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 146 KiB |
@@ -0,0 +1,53 @@
|
||||
|
||||
from playwright.sync_api import sync_playwright
|
||||
|
||||
def verify_profile_modal():
|
||||
with sync_playwright() as p:
|
||||
browser = p.chromium.launch(headless=True)
|
||||
context = browser.new_context(viewport={'width': 1280, 'height': 720})
|
||||
page = context.new_page()
|
||||
|
||||
# Navigate to the app
|
||||
page.goto("http://localhost:8000")
|
||||
|
||||
# Wait for the page to load
|
||||
page.wait_for_load_state("networkidle")
|
||||
|
||||
# Make the profile modal visible
|
||||
page.evaluate("""() => {
|
||||
const modal = document.getElementById('profileModal');
|
||||
if (modal) {
|
||||
modal.classList.remove('hidden');
|
||||
modal.setAttribute('aria-hidden', 'false');
|
||||
}
|
||||
}""")
|
||||
|
||||
# Force the Messages pane to be visible
|
||||
page.evaluate("""() => {
|
||||
const pane = document.getElementById('profilePaneMessages');
|
||||
if (pane) {
|
||||
pane.classList.remove('hidden');
|
||||
pane.removeAttribute('hidden');
|
||||
// Ensure other panes are hidden if needed, but not strictly necessary for content check
|
||||
}
|
||||
}""")
|
||||
|
||||
# Wait for the pane to become active/visible
|
||||
page.wait_for_selector("#profilePaneMessages:not(.hidden)")
|
||||
|
||||
# Take a screenshot
|
||||
page.screenshot(path="verification_profile_messages.png")
|
||||
|
||||
content = page.content()
|
||||
if "Direct message privacy" in content:
|
||||
print("FAILURE: 'Direct message privacy' text found in the page source.")
|
||||
else:
|
||||
print("SUCCESS: 'Direct message privacy' text NOT found.")
|
||||
|
||||
if "Read receipts" in content and "Direct message privacy" in content:
|
||||
print("FAILURE: 'Read receipts' text found.")
|
||||
|
||||
browser.close()
|
||||
|
||||
if __name__ == "__main__":
|
||||
verify_profile_modal()
|
||||
Reference in new issue
Block a user