Skip to content

Refactor Analysis#190

Open
itsmohmans wants to merge 39 commits into
developmentfrom
refactor/analysis-result
Open

Refactor Analysis#190
itsmohmans wants to merge 39 commits into
developmentfrom
refactor/analysis-result

Conversation

@itsmohmans
Copy link
Copy Markdown
Member

@itsmohmans itsmohmans commented Feb 28, 2026

This pull request introduces a significant refactor of the analysis workflow, moving from immediate analysis and result passing to a job-based system. Now, when a user submits text or a file for analysis, an analysis job is created and tracked by its ID. Subsequent result retrieval and downloads are performed using this job ID, for a scalable, paginated, and an async processing, along with a better UX for the user since the results page shows up immediately and shows the analysis processing as it progresses. The frontend and backend have been updated to support this new approach, with several new API endpoints and changes to data flow.

Backend: Job-based analysis and new endpoints

  • Introduced an AnalysisQueue system to manage analysis jobs, including creation, status tracking using Redis, result pagination, and background processing. New endpoints have been added for job creation, overview, results retrieval, and batch analysis (server/api/analyze/[id]/analyze.post.ts, server/api/analyze/[id]/overview.get.ts, server/api/analyze/[id]/results.get.ts).
  • Refactored analysis submission endpoints (comment.post.ts, file.post.ts) to create jobs instead of returning immediate results, and updated response formats to return job metadata (analysis ID, total comments) rather than analysis data.
  • Refactored Redis service into a unified utility to manage both magic link creation and analysis store (and anything that may use redis in the future)

Frontend: Data flow and download modal updates

  • Updated the frontend to use jobId for result retrieval and downloads, replacing direct use of analysis data. The DownloadModal.vue and Form.vue components now handle job IDs and route users to results pages with job IDs in query parameters.

Download/export endpoints: Job-based result fetching

  • Refactored CSV, JSON, and XLSX export endpoints to fetch results by job_id from the analysis queue, and updated export metadata to include job information and progress. Improved error handling and data formatting for these endpoints.

Other improvements

  • Added analysis progress indicators in the results page
  • Added share functionality to results page

Note: some of this PR description was generated by GitHub Copilot which I've proofread or edited.

itsmohmans and others added 30 commits February 2, 2026 15:25
- make the table width and columns width fixed

- add expand/collapse functionality for comments in results table
- highlight using xlsx over csv
- use table styling in print similar to mobile styling

- show all comments when printing

- make the default browser printing and the print button's behaviours consistent
Signed-off-by: Mohamad Berjawi <mohamad.fberjawi@gmail.com>
@itsmohmans itsmohmans self-assigned this Feb 28, 2026
@thread-koder thread-koder force-pushed the development branch 3 times, most recently from 217aa72 to 76f1b90 Compare April 23, 2026 09:05
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.

3 participants