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:
google-labs-jules[bot] committed 2026-01-20 02:46:04 +00:00
1 parent a126bc2d0e
commit ac4d087f3e
4 files changed
+56 -47

No files matched your search

-30
View File
@@ -1088,36 +1088,6 @@
role="tabpanel" role="tabpanel"
aria-labelledby="profileNavMessages" 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> <div id="dmAppShellMount"></div>
</section> </section>
<section <section
+3 -17
View File
@@ -1297,8 +1297,6 @@ export class ProfileModalController {
this.profileMessagesRelayAddButton = null; this.profileMessagesRelayAddButton = null;
this.profileMessagesRelayPublishButton = null; this.profileMessagesRelayPublishButton = null;
this.profileMessagesRelayStatus = null; this.profileMessagesRelayStatus = null;
this.profileMessagesReadReceiptsToggle = null;
this.profileMessagesTypingToggle = null;
this.profileMessagesUnreadDot = null; this.profileMessagesUnreadDot = null;
this.dmAppShellContainer = null; this.dmAppShellContainer = null;
this.dmAppShell = null; this.dmAppShell = null;
@@ -1616,10 +1614,6 @@ export class ProfileModalController {
document.getElementById("profileMessagesRelayPublish") || null; document.getElementById("profileMessagesRelayPublish") || null;
this.profileMessagesRelayStatus = this.profileMessagesRelayStatus =
document.getElementById("profileMessagesRelayStatus") || null; document.getElementById("profileMessagesRelayStatus") || null;
this.profileMessagesReadReceiptsToggle =
document.getElementById("profileMessagesReadReceiptsToggle") || null;
this.profileMessagesTypingToggle =
document.getElementById("profileMessagesTypingToggle") || null;
this.profileMessagesUnreadDot = this.profileMessagesUnreadDot =
document.getElementById("profileMessagesUnreadDot") || null; document.getElementById("profileMessagesUnreadDot") || null;
this.dmAppShellContainer = this.dmAppShellContainer =
@@ -2133,17 +2127,9 @@ export class ProfileModalController {
} }
syncDmPrivacySettingsUi() { syncDmPrivacySettingsUi() {
const settings = this.getDmPrivacySettingsSnapshot(); // Legacy UI toggles removed.
// This method is kept for backwards compatibility with call sites that might expect it,
if (this.profileMessagesReadReceiptsToggle instanceof HTMLInputElement) { // though the settings are now managed via AppShell.
this.profileMessagesReadReceiptsToggle.checked =
settings.readReceiptsEnabled;
}
if (this.profileMessagesTypingToggle instanceof HTMLInputElement) {
this.profileMessagesTypingToggle.checked =
settings.typingIndicatorsEnabled;
}
} }
handleReadReceiptsToggle(enabled) { handleReadReceiptsToggle(enabled) {
Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

+53
View File
@@ -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()