Skip to content

feat: Combined fixes and improvements#51

Merged
jesposito merged 2 commits intomainfrom
feature/combined-fixes-and-improvements
Jan 7, 2026
Merged

feat: Combined fixes and improvements#51
jesposito merged 2 commits intomainfrom
feature/combined-fixes-and-improvements

Conversation

@jesposito
Copy link
Copy Markdown
Owner

Summary

This PR includes multiple improvements and bug fixes to shrinkray.

🔄 Cherry-picked Features from gwlsn/shrinkray

  • Tabbed Layout: Optional tabbed UI with configuration options
  • UI Polish: Tabbed layout scrolling fixes and settings overlay improvements
  • Settings: Allow settings tab to scroll, show overlay only on settings tab

🐛 Bug Fix: Running Jobs Disappear on Page Refresh (Critical)

  • Issue: Running jobs disappeared from "Now Processing" after page refresh
  • Root Cause: updateJobs() only indexed queue jobs in statusIndex, never running jobs
  • Fix: Also add running jobs to jobMap and statusIndex for status lookups
  • Testing: Added regression test to prevent this bug from reoccurring

🔧 Code Audit Fixes (High/Medium Severity)

  • HTTP Handling: Added 30s timeouts and response body draining for ntfy/pushover
  • Error Handling: Fixed ignored JSON encode error in writeJSON()
  • Logging: Replaced fmt.Printf with log.Printf for consistent logging
  • Dead Code: Removed unused stateCookieSameSite function
  • Typos: Fixed VAAAPIHealthCheckVAAPIHealthCheck

🧪 Testing

  • Added E2E regression test for running jobs refresh bug
  • Manual testing: start transcode, refresh page, verify running jobs still appear

Files Changed

File Change
web/templates/index.html Running jobs bug fix + tabbed layout
internal/api/handler.go JSON error handling
internal/auth/oidc/provider.go Dead code removal
internal/ffmpeg/hwaccel.go Typo fix
internal/jobs/queue.go Logging consistency
internal/ntfy/ntfy.go HTTP timeout + body drain
internal/pushover/pushover.go HTTP timeout + body drain
e2e/running-jobs-refresh.spec.ts Regression test (new)
docs/faq.md Documentation (new)
internal/logger/logger.go Logger package (new)

Testing Instructions

  1. Start shrinkray with video files
  2. Queue and start a transcode job
  3. While running (shows in "Now Processing"), refresh the page
  4. Verify running job still appears in "Now Processing" section

Breaking Changes

None - all changes are backwards compatible

This PR includes multiple improvements and bug fixes:

## Cherry-picked Features from gwlsn/shrinkray:
- Add optional tabbed layout with configuration options
- Tabbed layout UI fixes (scrolling, settings overlay)
- Allow settings tab to scroll in tabs layout
- Show settings overlay only on settings tab

## Code Audit Fixes (High/Medium Severity):
- handler.go: Handle ignored JSON encode error in writeJSON()
- oidc/provider.go: Remove dead code (unused stateCookieSameSite func)
- hwaccel.go: Fix typo VAAAPIHealthCheck → VAAPIHealthCheck
- queue.go: Replace fmt.Printf with log.Printf for consistent logging
- ntfy.go: Add HTTP client with 30s timeout, drain response body
- pushover.go: Add HTTP client with 30s timeout, drain response body

## Bug Fix: Running Jobs Disappear on Page Refresh
- Root cause: updateJobs() only added queue jobs to statusIndex, not running jobs
- Fix: Also index running jobs for status lookups in updateActivePanel()
- Includes regression test to prevent this bug from reoccurring

## Testing
- Added E2E regression test for running jobs refresh bug
- All changes verified with code analysis and LSP diagnostics
The function is used by clearStateCookie() and was mistakenly identified
as dead code during the audit.
@jesposito jesposito merged commit 01029e9 into main Jan 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant