fix: reorganize settings tabs — merge notifications into sessions, move device-name to display, remove view-scope
This commit is contained in:
@@ -87,12 +87,15 @@
|
|||||||
<nav class="settings-tabs">
|
<nav class="settings-tabs">
|
||||||
<button class="settings-tab settings-tab--active" data-tab="display">Display</button>
|
<button class="settings-tab settings-tab--active" data-tab="display">Display</button>
|
||||||
<button class="settings-tab" data-tab="sessions">Sessions</button>
|
<button class="settings-tab" data-tab="sessions">Sessions</button>
|
||||||
<button class="settings-tab" data-tab="notifications">Notifications</button>
|
|
||||||
<button class="settings-tab" data-tab="new-session">Commands</button>
|
<button class="settings-tab" data-tab="new-session">Commands</button>
|
||||||
<button class="settings-tab" data-tab="devices">Multi-Device</button>
|
<button class="settings-tab" data-tab="devices">Multi-Device</button>
|
||||||
</nav>
|
</nav>
|
||||||
<div class="settings-content">
|
<div class="settings-content">
|
||||||
<div class="settings-panel" data-tab="display">
|
<div class="settings-panel" data-tab="display">
|
||||||
|
<div class="settings-field">
|
||||||
|
<label class="settings-label" for="setting-device-name">Device Name</label>
|
||||||
|
<input type="text" id="setting-device-name" class="settings-input" placeholder="This device" />
|
||||||
|
</div>
|
||||||
<div class="settings-field">
|
<div class="settings-field">
|
||||||
<label class="settings-label" for="setting-font-size">Font Size</label>
|
<label class="settings-label" for="setting-font-size">Font Size</label>
|
||||||
<select id="setting-font-size" class="settings-select">
|
<select id="setting-font-size" class="settings-select">
|
||||||
@@ -164,12 +167,6 @@
|
|||||||
<label class="settings-label" for="setting-auto-open">Auto-open created sessions</label>
|
<label class="settings-label" for="setting-auto-open">Auto-open created sessions</label>
|
||||||
<input type="checkbox" id="setting-auto-open" class="settings-checkbox" checked />
|
<input type="checkbox" id="setting-auto-open" class="settings-checkbox" checked />
|
||||||
</div>
|
</div>
|
||||||
<div class="settings-field settings-field--column">
|
|
||||||
<label class="settings-label">Hidden Sessions</label>
|
|
||||||
<div id="setting-hidden-sessions" class="settings-checkbox-list"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="settings-panel hidden" data-tab="notifications">
|
|
||||||
<div class="settings-field">
|
<div class="settings-field">
|
||||||
<label class="settings-label" for="setting-bell-sound">Bell Sound</label>
|
<label class="settings-label" for="setting-bell-sound">Bell Sound</label>
|
||||||
<input type="checkbox" id="setting-bell-sound" class="settings-checkbox" />
|
<input type="checkbox" id="setting-bell-sound" class="settings-checkbox" />
|
||||||
@@ -181,6 +178,10 @@
|
|||||||
<button id="notification-request-btn" class="settings-action-btn">Request Permission</button>
|
<button id="notification-request-btn" class="settings-action-btn">Request Permission</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="settings-field settings-field--column">
|
||||||
|
<label class="settings-label">Hidden Sessions</label>
|
||||||
|
<div id="setting-hidden-sessions" class="settings-checkbox-list"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="settings-panel hidden" data-tab="new-session">
|
<div class="settings-panel hidden" data-tab="new-session">
|
||||||
<div class="settings-field settings-field--column">
|
<div class="settings-field settings-field--column">
|
||||||
@@ -197,10 +198,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="settings-panel hidden" data-tab="devices">
|
<div class="settings-panel hidden" data-tab="devices">
|
||||||
<div class="settings-field">
|
|
||||||
<label class="settings-label" for="setting-device-name">Device Name</label>
|
|
||||||
<input type="text" id="setting-device-name" class="settings-input" placeholder="This device" />
|
|
||||||
</div>
|
|
||||||
<div class="settings-field">
|
<div class="settings-field">
|
||||||
<label class="settings-label" for="setting-multi-device-enabled">Enable multi-device support</label>
|
<label class="settings-label" for="setting-multi-device-enabled">Enable multi-device support</label>
|
||||||
<input type="checkbox" id="setting-multi-device-enabled" class="settings-checkbox" />
|
<input type="checkbox" id="setting-multi-device-enabled" class="settings-checkbox" />
|
||||||
@@ -214,13 +211,6 @@
|
|||||||
<option value="filtered">Filtered</option>
|
<option value="filtered">Filtered</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="settings-field">
|
|
||||||
<label class="settings-label" for="setting-view-scope">View Scope</label>
|
|
||||||
<select id="setting-view-scope" class="settings-select">
|
|
||||||
<option value="all">All Instances</option>
|
|
||||||
<option value="local">Local Only</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<div class="settings-field settings-field--column">
|
<div class="settings-field settings-field--column">
|
||||||
<label class="settings-label">Federation Key</label>
|
<label class="settings-label">Federation Key</label>
|
||||||
<div class="settings-federation-key">
|
<div class="settings-federation-key">
|
||||||
|
|||||||
@@ -434,7 +434,7 @@ def test_html_settings_dialog() -> None:
|
|||||||
|
|
||||||
|
|
||||||
def test_html_settings_tabs() -> None:
|
def test_html_settings_tabs() -> None:
|
||||||
"""settings-dialog must contain 5 tab buttons with correct data-tab values."""
|
"""settings-dialog must contain 4 tab buttons with correct data-tab values."""
|
||||||
soup = _SOUP
|
soup = _SOUP
|
||||||
dialog = soup.find(id="settings-dialog")
|
dialog = soup.find(id="settings-dialog")
|
||||||
assert dialog is not None, "Missing #settings-dialog"
|
assert dialog is not None, "Missing #settings-dialog"
|
||||||
@@ -442,12 +442,17 @@ def test_html_settings_tabs() -> None:
|
|||||||
assert tabs_container is not None, (
|
assert tabs_container is not None, (
|
||||||
"Missing nav.settings-tabs inside #settings-dialog"
|
"Missing nav.settings-tabs inside #settings-dialog"
|
||||||
)
|
)
|
||||||
expected_tabs = ["display", "sessions", "notifications", "new-session", "devices"]
|
expected_tabs = ["display", "sessions", "new-session", "devices"]
|
||||||
for tab_value in expected_tabs:
|
for tab_value in expected_tabs:
|
||||||
tab = tabs_container.find("button", attrs={"data-tab": tab_value})
|
tab = tabs_container.find("button", attrs={"data-tab": tab_value})
|
||||||
assert tab is not None, (
|
assert tab is not None, (
|
||||||
f"Missing tab button with data-tab='{tab_value}' in settings-tabs"
|
f"Missing tab button with data-tab='{tab_value}' in settings-tabs"
|
||||||
)
|
)
|
||||||
|
# Notifications tab must NOT exist (merged into Sessions)
|
||||||
|
notif_tab = tabs_container.find("button", attrs={"data-tab": "notifications"})
|
||||||
|
assert notif_tab is None, (
|
||||||
|
"Notifications tab button must not exist (content merged into Sessions tab)"
|
||||||
|
)
|
||||||
# Display tab must be active by default
|
# Display tab must be active by default
|
||||||
display_tab = tabs_container.find("button", attrs={"data-tab": "display"})
|
display_tab = tabs_container.find("button", attrs={"data-tab": "display"})
|
||||||
assert display_tab is not None
|
assert display_tab is not None
|
||||||
@@ -540,8 +545,8 @@ def test_html_settings_panels_use_data_tab() -> None:
|
|||||||
dialog = soup.find(id="settings-dialog")
|
dialog = soup.find(id="settings-dialog")
|
||||||
assert dialog is not None, "Missing #settings-dialog"
|
assert dialog is not None, "Missing #settings-dialog"
|
||||||
panels = dialog.find_all(class_="settings-panel")
|
panels = dialog.find_all(class_="settings-panel")
|
||||||
assert len(panels) == 5, (
|
assert len(panels) == 4, (
|
||||||
f"Expected 5 .settings-panel elements, found: {len(panels)}"
|
f"Expected 4 .settings-panel elements, found: {len(panels)}"
|
||||||
)
|
)
|
||||||
for panel in panels:
|
for panel in panels:
|
||||||
assert panel.get("data-tab") is not None, (
|
assert panel.get("data-tab") is not None, (
|
||||||
@@ -683,16 +688,16 @@ def test_html_sessions_panel_has_auto_open_checkbox_default_checked() -> None:
|
|||||||
|
|
||||||
|
|
||||||
def test_html_notifications_panel_has_bell_sound_checkbox() -> None:
|
def test_html_notifications_panel_has_bell_sound_checkbox() -> None:
|
||||||
"""Notifications panel must contain a #setting-bell-sound checkbox."""
|
"""Sessions panel must contain a #setting-bell-sound checkbox (notifications merged into sessions)."""
|
||||||
soup = _SOUP
|
soup = _SOUP
|
||||||
dialog = soup.find(id="settings-dialog")
|
dialog = soup.find(id="settings-dialog")
|
||||||
assert dialog is not None, "Missing #settings-dialog"
|
assert dialog is not None, "Missing #settings-dialog"
|
||||||
notif_panel = dialog.find(
|
sessions_panel = dialog.find(
|
||||||
class_="settings-panel", attrs={"data-tab": "notifications"}
|
class_="settings-panel", attrs={"data-tab": "sessions"}
|
||||||
)
|
)
|
||||||
assert notif_panel is not None, "Missing notifications settings-panel"
|
assert sessions_panel is not None, "Missing sessions settings-panel"
|
||||||
el = notif_panel.find(id="setting-bell-sound")
|
el = sessions_panel.find(id="setting-bell-sound")
|
||||||
assert el is not None, "Missing #setting-bell-sound inside notifications panel"
|
assert el is not None, "Missing #setting-bell-sound inside sessions panel"
|
||||||
assert el.name == "input", f"#setting-bell-sound must be an <input>, got: {el.name}"
|
assert el.name == "input", f"#setting-bell-sound must be an <input>, got: {el.name}"
|
||||||
assert el.get("type") == "checkbox", (
|
assert el.get("type") == "checkbox", (
|
||||||
f"#setting-bell-sound must be type='checkbox', got: {el.get('type')}"
|
f"#setting-bell-sound must be type='checkbox', got: {el.get('type')}"
|
||||||
@@ -704,17 +709,17 @@ def test_html_notifications_panel_has_bell_sound_checkbox() -> None:
|
|||||||
|
|
||||||
|
|
||||||
def test_html_notifications_panel_has_notification_status_text() -> None:
|
def test_html_notifications_panel_has_notification_status_text() -> None:
|
||||||
"""Notifications panel must contain #notification-status-text with class settings-status-text."""
|
"""Sessions panel must contain #notification-status-text with class settings-status-text (merged from notifications)."""
|
||||||
soup = _SOUP
|
soup = _SOUP
|
||||||
dialog = soup.find(id="settings-dialog")
|
dialog = soup.find(id="settings-dialog")
|
||||||
assert dialog is not None, "Missing #settings-dialog"
|
assert dialog is not None, "Missing #settings-dialog"
|
||||||
notif_panel = dialog.find(
|
sessions_panel = dialog.find(
|
||||||
class_="settings-panel", attrs={"data-tab": "notifications"}
|
class_="settings-panel", attrs={"data-tab": "sessions"}
|
||||||
)
|
)
|
||||||
assert notif_panel is not None, "Missing notifications settings-panel"
|
assert sessions_panel is not None, "Missing sessions settings-panel"
|
||||||
el = notif_panel.find(id="notification-status-text")
|
el = sessions_panel.find(id="notification-status-text")
|
||||||
assert el is not None, (
|
assert el is not None, (
|
||||||
"Missing #notification-status-text inside notifications panel"
|
"Missing #notification-status-text inside sessions panel"
|
||||||
)
|
)
|
||||||
classes = el.get("class") or []
|
classes = el.get("class") or []
|
||||||
assert "settings-status-text" in classes, (
|
assert "settings-status-text" in classes, (
|
||||||
@@ -723,17 +728,17 @@ def test_html_notifications_panel_has_notification_status_text() -> None:
|
|||||||
|
|
||||||
|
|
||||||
def test_html_notifications_panel_has_request_btn() -> None:
|
def test_html_notifications_panel_has_request_btn() -> None:
|
||||||
"""Notifications panel must contain #notification-request-btn with class settings-action-btn."""
|
"""Sessions panel must contain #notification-request-btn with class settings-action-btn (merged from notifications)."""
|
||||||
soup = _SOUP
|
soup = _SOUP
|
||||||
dialog = soup.find(id="settings-dialog")
|
dialog = soup.find(id="settings-dialog")
|
||||||
assert dialog is not None, "Missing #settings-dialog"
|
assert dialog is not None, "Missing #settings-dialog"
|
||||||
notif_panel = dialog.find(
|
sessions_panel = dialog.find(
|
||||||
class_="settings-panel", attrs={"data-tab": "notifications"}
|
class_="settings-panel", attrs={"data-tab": "sessions"}
|
||||||
)
|
)
|
||||||
assert notif_panel is not None, "Missing notifications settings-panel"
|
assert sessions_panel is not None, "Missing sessions settings-panel"
|
||||||
el = notif_panel.find(id="notification-request-btn")
|
el = sessions_panel.find(id="notification-request-btn")
|
||||||
assert el is not None, (
|
assert el is not None, (
|
||||||
"Missing #notification-request-btn inside notifications panel"
|
"Missing #notification-request-btn inside sessions panel"
|
||||||
)
|
)
|
||||||
classes = el.get("class") or []
|
classes = el.get("class") or []
|
||||||
assert "settings-action-btn" in classes, (
|
assert "settings-action-btn" in classes, (
|
||||||
@@ -1070,15 +1075,15 @@ def test_html_settings_close_btn_exists() -> None:
|
|||||||
|
|
||||||
|
|
||||||
def test_html_sessions_tab_device_name_input() -> None:
|
def test_html_sessions_tab_device_name_input() -> None:
|
||||||
"""Multi-Device tab must contain a #setting-device-name text input for the device name."""
|
"""Display tab must contain a #setting-device-name text input for the device name."""
|
||||||
soup = _SOUP
|
soup = _SOUP
|
||||||
el = soup.find(id="setting-device-name")
|
el = soup.find(id="setting-device-name")
|
||||||
assert el is not None, "Missing element with id='setting-device-name'"
|
assert el is not None, "Missing element with id='setting-device-name'"
|
||||||
# Must be inside the devices panel (not sessions)
|
# Must be inside the display panel (moved from devices)
|
||||||
devices_panel = soup.find("div", attrs={"data-tab": "devices"})
|
display_panel = soup.find("div", attrs={"data-tab": "display"})
|
||||||
assert devices_panel is not None, "Missing devices panel (data-tab='devices')"
|
assert display_panel is not None, "Missing display panel (data-tab='display')"
|
||||||
assert devices_panel.find(id="setting-device-name") is not None, (
|
assert display_panel.find(id="setting-device-name") is not None, (
|
||||||
"#setting-device-name must be inside the devices (Multi-Device) settings panel"
|
"#setting-device-name must be inside the display settings panel"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -1266,12 +1271,12 @@ def test_html_devices_panel_has_enable_checkbox() -> None:
|
|||||||
|
|
||||||
|
|
||||||
def test_html_devices_panel_has_device_name() -> None:
|
def test_html_devices_panel_has_device_name() -> None:
|
||||||
"""Multi-Device tab panel must contain #setting-device-name text input."""
|
"""Display tab panel must contain #setting-device-name text input (moved from Multi-Device)."""
|
||||||
soup = _SOUP
|
soup = _SOUP
|
||||||
devices_panel = soup.find("div", attrs={"data-tab": "devices"})
|
display_panel = soup.find("div", attrs={"data-tab": "display"})
|
||||||
assert devices_panel is not None, "Missing devices panel (data-tab='devices')"
|
assert display_panel is not None, "Missing display panel (data-tab='display')"
|
||||||
el = devices_panel.find(id="setting-device-name")
|
el = display_panel.find(id="setting-device-name")
|
||||||
assert el is not None, "Missing #setting-device-name inside devices panel"
|
assert el is not None, "Missing #setting-device-name inside display panel"
|
||||||
|
|
||||||
|
|
||||||
def test_html_devices_panel_has_remote_instances() -> None:
|
def test_html_devices_panel_has_remote_instances() -> None:
|
||||||
@@ -1306,14 +1311,11 @@ def test_html_devices_panel_has_view_mode() -> None:
|
|||||||
|
|
||||||
|
|
||||||
def test_html_devices_panel_has_view_scope() -> None:
|
def test_html_devices_panel_has_view_scope() -> None:
|
||||||
"""Multi-Device tab panel must contain #setting-view-scope select."""
|
"""#setting-view-scope must not exist (removed — view preference scope eliminated)."""
|
||||||
soup = _SOUP
|
soup = _SOUP
|
||||||
devices_panel = soup.find("div", attrs={"data-tab": "devices"})
|
el = soup.find(id="setting-view-scope")
|
||||||
assert devices_panel is not None, "Missing devices panel (data-tab='devices')"
|
assert el is None, (
|
||||||
el = devices_panel.find(id="setting-view-scope")
|
"#setting-view-scope must be removed from the HTML (view preference scope feature removed)"
|
||||||
assert el is not None, "Missing #setting-view-scope inside devices panel"
|
|
||||||
assert el.name == "select", (
|
|
||||||
f"#setting-view-scope must be a <select>, got: {el.name}"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user