mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
feat: add info icon with filter logic popover to For You feed
Adds a clickable info icon next to the "For You" title that displays a popover explaining the feed's filtering logic ("Most Recent Video - Disinterests Tags - Watch History + Interests Tags"). Implemented as a reusable helper `attachFeedInfoPopover` in `js/ui/components/FeedInfoPopover.js` to support future use on other feed pages. Updated `views/for-you.html` and `js/forYouView.js` to integrate the new component. Verified with Playwright.
This commit is contained in:
1 parent
933841bb0e
commit
bae4020682
5 files changed
+132
-1
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 43 KiB |
@@ -0,0 +1,54 @@
|
||||
import sys
|
||||
import os
|
||||
import time
|
||||
from playwright.sync_api import sync_playwright
|
||||
|
||||
def verify_feed_info(page):
|
||||
print("Pre-seeding localStorage...")
|
||||
page.goto("http://localhost:8000") # Go to root first to set storage origin
|
||||
page.evaluate("window.localStorage.setItem('hasSeenDisclaimer', 'true')")
|
||||
|
||||
print("Navigating to For You view...")
|
||||
page.goto("http://localhost:8000/#view=for-you")
|
||||
|
||||
print("Waiting for feed info trigger...")
|
||||
trigger = page.locator("#feedInfoTrigger")
|
||||
try:
|
||||
trigger.wait_for(state="visible", timeout=10000)
|
||||
except Exception:
|
||||
page.screenshot(path="verification/debug_not_found.png")
|
||||
raise
|
||||
|
||||
# Ensure no modals are blocking
|
||||
# We can try to force click or wait for potential overlays to disappear
|
||||
# But pre-seeding should handle the main one.
|
||||
|
||||
print("Clicking trigger...")
|
||||
trigger.click()
|
||||
|
||||
print("Waiting for popover...")
|
||||
popover = page.locator(".popover-panel")
|
||||
popover.wait_for(state="visible", timeout=5000)
|
||||
|
||||
text = popover.inner_text()
|
||||
print(f"Popover text: {text}")
|
||||
|
||||
expected = "Most Recent Video - Disinterests Tags - Watch History + Interests Tags"
|
||||
if expected not in text:
|
||||
raise Exception(f"Unexpected text: {text}")
|
||||
|
||||
page.screenshot(path="verification/feed_info.png")
|
||||
print("Screenshot saved to verification/feed_info.png")
|
||||
|
||||
if __name__ == "__main__":
|
||||
with sync_playwright() as p:
|
||||
browser = p.chromium.launch(headless=True)
|
||||
context = browser.new_context()
|
||||
page = context.new_page()
|
||||
try:
|
||||
verify_feed_info(page)
|
||||
except Exception as e:
|
||||
print(f"Error: {e}")
|
||||
sys.exit(1)
|
||||
finally:
|
||||
browser.close()
|
||||
Reference in new issue
Block a user