Files
Octop/tests/unit/api/test_dashboard_cache.py
liukewia 35abf52626 fix(dashboard): honor PWA safe-area insets and widen mobile chat bubbles (#666)
* refactor: update layout styles to support safe area insets

Modified padding and margin properties across various components to utilize environment variables for safe area insets, ensuring better compatibility with devices that have notches or rounded corners. This includes updates to index.html, offline.html, and several layout components to enhance the overall responsiveness and user experience.

* fix: update keyboard offset handling and layout styles

Refactored keyboard offset calculations in the useKeyboardOffset hook to improve handling of soft keyboard visibility. Adjusted layout styles across various components to utilize the largest viewport height (lvh) for better compatibility with devices featuring home indicators. This includes updates to padding, height properties, and background colors to enhance the user experience in chat and main layout components.

* refactor: update chat layout styles for improved responsiveness

Adjusted padding, width, and margin properties across various chat components to utilize environment variables for better responsiveness. This includes updates to the chat input, message list, and welcome components, ensuring consistent spacing and alignment across different screen sizes. Enhanced mobile styles to accommodate varying avatar sizes and maintain layout integrity.

* refactor: enhance chat component styles for consistency and responsiveness

Updated layout styles in chat components to ensure consistent spacing and alignment. Adjusted margin and gap properties to utilize environment variables, improving responsiveness across different screen sizes. Enhanced mobile styles for better alignment of avatars and message bubbles, ensuring a cohesive user experience.

* feat: implement theme management in index.html and update logo assets

Added a script to manage dashboard theme based on user preferences and system settings, ensuring the correct theme is applied before the first paint. Updated CSS to utilize data attributes for theme styling. Replaced existing logo assets with new vertical and horizontal versions for both light and dark themes, and updated references throughout the application. Removed outdated logo files to streamline asset management.

* refactor: update layout styles to improve safe area handling

Enhanced layout components by adjusting padding and margin properties to better utilize environment variables for safe area insets. This includes updates to the PageShell, Sidebar, MainLayout, Login, and Setup components, ensuring improved responsiveness and compatibility with devices featuring notches or rounded corners.
2026-09-22 22:02:18 +08:00

34 lines
1.2 KiB
Python

"""Cache-Control for dashboard SPA shell vs hashed Vite assets."""
from __future__ import annotations
from octop.api.app import dashboard_cache_control, is_dashboard_asset_path
def test_shell_files_are_revalidated() -> None:
assert dashboard_cache_control("") == "no-cache"
assert dashboard_cache_control("index.html") == "no-cache"
assert dashboard_cache_control("sw.js") == "no-cache"
assert dashboard_cache_control("manifest.json") == "no-cache"
def test_hashed_assets_are_immutable() -> None:
assert (
dashboard_cache_control("assets/index.abc123.js") == "public, max-age=31536000, immutable"
)
assert (
dashboard_cache_control("assets/vendor-utils.Xyz.css")
== "public, max-age=31536000, immutable"
)
def test_other_static_files_leave_cache_unset() -> None:
assert dashboard_cache_control("logo_vertical_dark.svg") is None
assert dashboard_cache_control("offline.html") is None
def test_only_hashed_assets_skip_the_spa_fallback() -> None:
assert is_dashboard_asset_path("assets/index.abc123.js") is True
assert is_dashboard_asset_path("chat") is False
assert is_dashboard_asset_path("") is False