Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Submit feedback
    • Contribute to GitLab
  • Sign in
U
upgrade-data-crawler-fe
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • ThinhNC
  • upgrade-data-crawler-fe
  • Merge Requests
  • !11

Merged
Opened Sep 07, 2026 by ThinhNC@ThinhNC
  • Report abuse
Report abuse

fix(crawl-jobs): harmonize progress percentage, unlock export, and streamline crawled pages table

Summary of Changes

1. Harmonized Progress Percentage (Fix 99% Cap)

  • Problem: When a job was in RUNNING status, the progress formula artificially clamped progress to 99% via Math.min(isJobRunning ? 99 : 100, ...), displaying 52 / 52 pages (99%).
  • Solution:
    • Standardized progress calculation across recent-jobs-widget.tsx, crawler-task-table.tsx, and /crawl-jobs/[id]/page.tsx:
      const progressPercent = job?.status === "COMPLETED" || (targetPages > 0 && processedPages >= targetPages)
        ? 100
        : targetPages > 0
        ? Math.min(99, Math.round((processedPages / targetPages) * 100))
        : 0;
    • When all target pages are processed (processedPages >= targetPages), progress displays as 100%.

2. Export Button Unlock

  • Problem: The "Export Data" button was disabled whenever isJobRunning was true, locking users out even when data was ready.
  • Solution:
    • Updated disabled condition to disabled={(isJobRunning && processedPages < targetPages) || (job?.successPages || 0) === 0}, allowing users to export data immediately once target pages are finished.

3. Crawled Pages Table UX Enhancement (/crawl-jobs/[id])

  • Problem: Clicking through each page required targeting a small action button in the last column.
  • Solution:
    • Completely removed the "Actions" / "Thao tác" column from the Crawled Pages table.
    • Made each table row (<tr>) directly clickable to open the page preview modal (markdown, cleanText, html, json).
    • Added row hover styles and e.stopPropagation() on the source URL link so opening the URL in a new tab does not inadvertently trigger the preview modal.

4. Realtime Quota Cache Synchronization

  • Added USAGE_QUERY_KEYS.usage invalidation on job creation, rerun, cancel, and deletion.
  • Harmonized profile query keys (["auth", "me", "usage"]) for unified cache invalidation.

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch origin
git checkout -b fix/progress-calculation-and-crawled-pages-ux origin/fix/progress-calculation-and-crawled-pages-ux

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git fetch origin
git checkout origin/develop
git merge --no-ff fix/progress-calculation-and-crawled-pages-ux

Step 4. Push the result of the merge to GitLab

git push origin develop

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

  • Discussion 0
  • Commits 1
  • Changes 5
Assignee
No assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
0
Labels
None
Assign labels
  • View project labels
Reference: ThinhNC/upgrade-data-crawler-fe!11

Revert this merge request

This will create a new commit in order to revert the existing changes.

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.

Cherry-pick this merge request

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.