Skip to content

49 let the user view output logs for a task#130

Merged
Darkkal merged 5 commits into
masterfrom
49-let-the-user-view-output-logs-for-a-task
Jul 22, 2026
Merged

49 let the user view output logs for a task#130
Darkkal merged 5 commits into
masterfrom
49-let-the-user-view-output-logs-for-a-task

Conversation

@Darkkal

@Darkkal Darkkal commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Walkthrough - Task Output Log Viewer (#49)

We have completed the implementation and verification for Issue #49: "Let the user view output logs for a task".

Summary of Changes

  1. Server Actions (src/app/scrape/actions.ts)

    • Implemented getScrapeLog(historyId: number) server action to fetch scraper logs stored at paths.galleryDl.logs/scrape_{historyId}.log.
    • Returns log text, run status, or descriptive error message if log file is missing/cleaned up.
  2. Log Viewer Modal (src/app/scrape/components/log-viewer-modal.tsx)

    • Created a modal dialog accessible from the Scrape page's History tab.
    • Features:
      • Text Wrap toggle: Switch between white-space: pre-wrap and horizontal scroll.
      • Auto Scroll toggle: Auto-scroll to log bottom on content updates.
      • Live Polling: Streams updates every 1.5 seconds for actively running scraper tasks.
      • Manual Refresh: Reload button for manual log refresh.
      • Keyboard & Backdrop dismissal: ESC key or clicking outside dismisses modal.
  3. History Table Integration (src/app/scrape/history-table.tsx & page.module.css)

    • Added a "View Log" button (FileText icon) to both Desktop history table rows and Mobile history task cards.
    • Positioned the "View Log" button on the far right of the actions group so that it maintains a stable, consistent position regardless of whether a "Resume" action button is active.
    • Added CSS Module modal styling adhering to project design tokens and status badges (data-status).
  4. Unit Testing (tests/unit/actions/scrape.test.ts)

    • Added comprehensive unit tests covering:
      • Non-existent history records
      • Scrape history records without log paths
      • Missing log files on disk
      • Reading log files when present

Verification Results

Automated Unit Tests

  • Executed npm run test:unit: All 15 test suites and 158 unit tests passed cleanly.

Production Build

  • Executed npm run build: Compiled Next.js 16.1.1 project with Turbopack cleanly (0 errors).

@Darkkal Darkkal linked an issue Jul 22, 2026 that may be closed by this pull request
@Darkkal
Darkkal merged commit cfc3b8e into master Jul 22, 2026
6 checks passed
@Darkkal
Darkkal deleted the 49-let-the-user-view-output-logs-for-a-task branch July 22, 2026 19:32
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.

Let the user view output logs for a task

1 participant