feat: add logo/branding, WOL network-host suggestions, favicons, and … - #41
Conversation
…auto-load logs - Add logo marks (light/dark/mark SVGs) to sidebar and README, replacing the simple accent dot - Add favicons (16x16, 32x32, .ico), apple-touch-icon, and PWA webmanifest with 192x192/512x512 icons - Add GET /api/wol/network-hosts endpoint that parses the ARP cache (ip neigh show), resolves hostnames via threaded reverse DNS, and returns discovered hosts so the WOL target form can offer MAC-address dropdown suggestions from the local network - Auto-fill target name from reverse-DNS hostname on MAC selection - Remove manual "Load Recent" button; logs now auto-load recent entries on component mount - Bump version references from v1.1.0 to v1.1.1 - Add frontend & backend tests for all new functionality
|
Warning Review limit reached
More reviews will be available in 36 minutes and 11 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThis PR adds ARP-cache-based MAC address suggestions with optional reverse-DNS hostname auto-fill to the WakeOnLan target modal, backed by a new ChangesWOL Network Host Discovery & MAC Suggestions
v1.1.1 Release Housekeeping and UI Polish
Sequence Diagram(s)sequenceDiagram
participant Browser as Browser (WakeOnLan Modal)
participant FrontendAPI as Frontend API Layer
participant WolRoute as GET /api/wol/network-hosts
participant WolService as wol_service.scan_network_hosts()
participant IpNeigh as ip neigh show
participant DNS as socket.gethostbyaddr
Browser->>FrontendAPI: fetch(API.WOL_NETWORK_HOSTS)
FrontendAPI->>WolRoute: GET /api/wol/network-hosts
WolRoute->>WolService: scan_network_hosts()
WolService->>IpNeigh: subprocess run
IpNeigh-->>WolService: ARP neighbor lines
WolService->>DNS: concurrent reverse DNS per IP
DNS-->>WolService: hostname or OSError → ""
WolService-->>WolRoute: [{ip, mac, hostname}, ...]
WolRoute-->>FrontendAPI: {"hosts": [...]}
FrontendAPI-->>Browser: networkHosts list
Browser->>Browser: render datalist options, auto-fill Name from hostname
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/backend/services/wol.py`:
- Around line 191-194: The subprocess.run call in the wol.py file bypasses the
project's required command wrapper. Replace the direct subprocess.run invocation
(which calls the "ip neigh show" command with a 5-second timeout and text
output) with a call to run_cmd from utils.py, ensuring you pass the command list
and timeout parameter appropriately to the wrapper function. Make sure to import
run_cmd from utils.py if not already imported in the file.
- Around line 204-214: The ThreadPoolExecutor context manager calls
shutdown(wait=True) on exit, which blocks until all submitted futures complete.
Even though as_completed() with timeout=2.0 raises FutureTimeoutError after 2
seconds, the pending hostname resolution futures continue running and the
context manager exit waits for them to finish, defeating the timeout purpose.
Fix this by canceling any remaining futures after the timeout exception is
caught. Within the FutureTimeoutError except block, iterate through the futures
dictionary and call cancel() on each future that is still running to prevent the
context manager from blocking on slow DNS queries. This ensures the timeout is
truly respected and slow hostname resolutions don't block the request beyond 2
seconds.
In `@src/frontend/public/site.webmanifest`:
- Line 16: The `start_url` property in the web manifest is currently set to
"/static/" which points to the static asset directory, but PWAs should launch at
the actual application entry route. Change the `start_url` value from "/static/"
to "/" to match the main app route served by the backend (`@app.route("/")`).
This ensures PWA installations correctly open the application at the correct URL
instead of the static assets directory.
In `@src/frontend/src/components/Logs.tsx`:
- Line 24: The `loadRecent()` function is being called before it is declared,
which causes a CI lint failure. Move the `loadRecent` function definition to
appear before the line where it is invoked at line 24, or define it as a
callback using useCallback before the effect that calls it. Ensure the
declaration of `loadRecent` precedes its usage in the effect.
In `@src/frontend/src/components/Sidebar.tsx`:
- Around line 89-99: The LogoMark SVG component has hardcoded dimensions of
50x50 pixels, but its container (.brand-logo) is 44x44 pixels, which can cause
clipping or overflow. Modify the LogoMark function to remove the hardcoded width
and height attributes or adjust them to match the container's 44x44 size, making
the SVG responsive to its parent container's dimensions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: ce56ca84-585c-49eb-ad42-d115251d5fb7
⛔ Files ignored due to path filters (20)
assets/icons/apple-touch-icon.pngis excluded by!**/*.pngassets/icons/favicon-16x16.pngis excluded by!**/*.pngassets/icons/favicon-32x32.pngis excluded by!**/*.pngassets/icons/favicon.icois excluded by!**/*.icoassets/icons/icon-192.pngis excluded by!**/*.pngassets/icons/icon-48.pngis excluded by!**/*.pngassets/icons/icon-512.pngis excluded by!**/*.pngassets/icons/logo-dark.svgis excluded by!**/*.svgassets/icons/logo-light.svgis excluded by!**/*.svgassets/icons/logo-mark.svgis excluded by!**/*.svgsrc/frontend/public/apple-touch-icon.pngis excluded by!**/*.pngsrc/frontend/public/favicon-16x16.pngis excluded by!**/*.pngsrc/frontend/public/favicon-32x32.pngis excluded by!**/*.pngsrc/frontend/public/favicon.icois excluded by!**/*.icosrc/frontend/public/icon-192.pngis excluded by!**/*.pngsrc/frontend/public/icon-48.pngis excluded by!**/*.pngsrc/frontend/public/icon-512.pngis excluded by!**/*.pngsrc/frontend/public/logo-dark.svgis excluded by!**/*.svgsrc/frontend/public/logo-light.svgis excluded by!**/*.svgsrc/frontend/public/logo-mark.svgis excluded by!**/*.svg
📒 Files selected for processing (16)
README.mdscripts/setup.shsrc/backend/routes/wol.pysrc/backend/services/wol.pysrc/backend/tests/test_routes.pysrc/backend/tests/test_services_wol.pysrc/frontend/index.htmlsrc/frontend/package.jsonsrc/frontend/public/site.webmanifestsrc/frontend/src/__tests__/components/WakeOnLan.test.tsxsrc/frontend/src/components/Logs.tsxsrc/frontend/src/components/Sidebar.tsxsrc/frontend/src/components/WakeOnLan.tsxsrc/frontend/src/constants/index.tssrc/frontend/src/styles/components.cssvm/nut-vm.sh
The loadRecent function was defined after the useEffect that calls it, relying on hoisting which works for function declarations but not for the assigned arrow function. Moving it above the useEffect ensures the function is defined before it is referenced, improving readability and avoiding any temporal dead zone confusion for future readers.
Replace subprocess.run with run_cmd in WOL ARP scanning, and cancel non-completed futures on timeout to prevent resource leaks. Update tests to mock run_cmd instead of monkey-patching subprocess. Fix PWA start_url from /static/ to / for correct installed-app launch. Enlarge brand logo from 44px to 50px for visual polish.
…auto-load logs
Summary by CodeRabbit
New Features
Chores