Skip to content

[TAN-7380] Formsync better progress indicator#13606

Merged
AchrafGoVocal merged 40 commits intoTAN-7201-add-new-output-schema-and-promptfrom
TAN-7380-formsync-better-progress-indicator
Apr 24, 2026
Merged

[TAN-7380] Formsync better progress indicator#13606
AchrafGoVocal merged 40 commits intoTAN-7201-add-new-output-schema-and-promptfrom
TAN-7380-formsync-better-progress-indicator

Conversation

@AchrafGoVocal
Copy link
Copy Markdown
Contributor

@AchrafGoVocal AchrafGoVocal commented Apr 8, 2026

Description

Added a better progress indicator while importing so that users can see the progression of their import and already see ideas as they get processed.
Note: There are some improvements to error handling that I kept in a seperate PR TAN-7519 for clarity.

  • Refactored the bulk import flow to use the existing with_tracking + enqueue_child_job pattern.
  • Added a new IdeaImportJob that orchestrates the child jobs and sets the tracker total.
  • PDF files are now imported immediately after each file gets parsed by the AI model, so draft ideas appear one by one instead of all at once at the end of a batch.
  • Added a ProgressBar component to the component library.
  • New ImportStatus component showing a live progress bar ("Importing 3/6") during import.
  • Cleaned up dead code in api/background_jobs/ that was no longer used after switching to tracker-based progress polling.

Changelog

Changed

  • [TAN-7380] Improved progress indicator for bulk imports — users now see real-time progress and draft ideas appear as they are processed.

For translators

image

@notion-workspace
Copy link
Copy Markdown

@AchrafGoVocal AchrafGoVocal changed the title Tan 7380 formsync better progress indicator [TAN-7380] Formsync better progress indicator Apr 8, 2026
@cl-dev-bot
Copy link
Copy Markdown
Collaborator

cl-dev-bot commented Apr 8, 2026

Messages
📖 Changelog provided 🎉
📖 Notion issue: TAN-7380
📖

Run the e2e tests

📖 Check translation progress

Generated by 🚫 dangerJS against 6accec1

@AchrafGoVocal AchrafGoVocal added this to the FormSync milestone Apr 13, 2026
@AchrafGoVocal AchrafGoVocal marked this pull request as ready for review April 14, 2026 07:49
@@ -0,0 +1,45 @@
import React from 'react';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In our components/UI folder we also have a ProgressBar component - not sure how that looks/if it would work for FormSync as well instead? :

/front/app/components/UI/ProgressBar/index.tsx

If it doesn't, I'd just check with Rob first before adding anything new in our component library :)

@amanda-anderson amanda-anderson self-requested a review April 14, 2026 09:36
Comment thread front/app/containers/Admin/projects/project/inputImporter/ReviewSection/index.tsx Outdated
Copy link
Copy Markdown
Contributor

@adessy adessy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the wait! Good job, it's looking good 💯 I'm just challenging a few decisions, but nothing blocking on my end. It might be worth adding a few more tests to the back end though.

I didn't check the front-end part since Amanda already reviewed it.

Comment thread back/app/concerns/jobs/trackable_job.rb Outdated
Comment thread back/app/concerns/jobs/trackable_job.rb Outdated
Comment thread back/app/controllers/web_api/v1/jobs_controller.rb

file = bulk_create_params[:file]
job_ids = file_parser_service.parse_file_async file
files = file_parser_service.create_files(file)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should make sure it's okay to do this synchronously for reasonably large files.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we're doing this sync to make error reporting easier, but would it make sense to split the file in IdeaImportJob at the same time as batching?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should make sure it's okay to do this synchronously for reasonably large files.

I double checked and the file splitting has always been done synchronously before launching the jobs. Since we haven't had any issue with it up until now, it should be fine.

I guess we're doing this sync to make error reporting easier, but would it make sense to split the file in IdeaImportJob at the same time as batching?

Hmm I'm not sure. Since the file splitting doesn't take that long, it feels better to have it be done synchronously and get immediate feedback on what went wrong (for example the user might enter a number_of_pages_per_form that cannot divide the actual number of pages of the pdf evenly)
Another solution would be to split the validation from the file splitting itself but that would require more changes in the code and I am not sure it's worth it for now since it doesn't take long to do the splitting anyway.

Comment thread front/app/api/background_jobs/useBackgroundJobs.ts Outdated
SideFxBulkImportService.new.after_failure(import_user, phase, 'idea', 'pdf', e.to_s)
remaining = idea_import_files.count - files_processed
track_progress_and_complete!(remaining, remaining)
raise e
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want the job to fail if a BulkImportIdeas::Error is raised? I mean, you could argue that aborting on an ill-formed file is just normal, expected behavior. It really depends on when and why those errors are used though.

SideFxBulkImportService.new.after_success(import_user, phase, 'idea', 'pdf', ideas, users)
SideFxBulkImportService.new.after_success(import_user, phase, 'idea', 'pdf', all_ideas, import_service.imported_users)
complete_if_done!
rescue StandardError => e
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want the rescue at the batch-level or file-level?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if we really need a parent job here, or if IdeaPdfImportJob and IdeaXlsxImportJob could just handle batching themselves (using a recursive job, for instance). That would eliminate the need for the FORMAT_CONFIG hash, but it might not be any better than what you have. Anyway, just food for thought, not blocking at all.

@AchrafGoVocal AchrafGoVocal merged commit 33215cf into TAN-7201-add-new-output-schema-and-prompt Apr 24, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants