Skip to content

feat: File attachment progress bar#7942

Merged
qnixsynapse merged 3 commits into
janhq:mainfrom
dataCenter430:feat/file-attachment-progress-bar
Apr 14, 2026
Merged

feat: File attachment progress bar#7942
qnixsynapse merged 3 commits into
janhq:mainfrom
dataCenter430:feat/file-attachment-progress-bar

Conversation

@dataCenter430

Copy link
Copy Markdown
Contributor

Changes

Adds visible upload/indexing progress for multi-file flows in the web app: a linear progress bar with completed / total counts, instead of only spinners or ambiguous “processing” state.

UI

  • Project files (ProjectFiles.tsx): While ingesting multiple documents into a project, shows a progress bar and current / total under the files header.
  • Chat (ChatInput.tsx): While images or documents are being ingested after attach, shows a progress bar below the attachment chips with the same fraction.

Logic

  • attachmentProcessing.ts: Optional onIngestProgress?: ({ completed, total }) => void on processAttachmentsForSend, exported type AttachmentIngestProgress. Progress counts only attachments that actually run ingestion (skips already-processed / inline-only docs). Fires once at 0 / total, then after each successful step.

i18n

  • common.uploadingAttachments — chat progress label.
  • common.projects.uploadingFiles — project files progress label.
  • Strings added across all locale common.json files under web-app/src/locales/.
07.04.2026_18.30.42_REC.mp4

Self Checklist

  • Added relevant comments, esp in complex areas
  • Updated docs (for bug fixes / features)
  • Created issues for follow-up changes or refactoring needed

@tokamak-pm

tokamak-pm Bot commented Apr 11, 2026

Copy link
Copy Markdown

Code Review — first review

Summary

Adds a deterministic progress bar (completed / total) for file attachment ingestion in two places: ChatInput.tsx (paste/drop images + send-time processing) and ProjectFiles.tsx (batch file ingestion). Threads onIngestProgress callback through attachmentProcessing.ts.

Files changed: 18 | +174 / -47

Strengths

  • Clean opt-in API: onIngestProgress is optional, so existing call sites are unaffected.
  • finally blocks ensure progress state cleanup — no stuck progress bars on errors.
  • Pre-counts ingestable items correctly, skipping already-processed files.
  • Math.min(ingestCompleted, ingestTotal) guard prevents overflow.
  • Full locale coverage across all 15 existing locales.
  • Uses existing Radix Progress component — no new UI dependencies.

Issues

1. Redundant fallback string in ProjectFiles.tsx (inconsistency)

{t('common:projects.uploadingFiles') ?? 'Uploading files…'}

The ?? 'Uploading files…' is redundant since every locale has this key. ChatInput.tsx uses the key without a fallback. Pick one style and be consistent — recommend removing the fallback.

2. Inline-document fallthrough logic is non-obvious
When targetMode === 'inline' but parsedContent is undefined (parse failed), the code falls through to the embeddings path where bumpIngest() is also called. The count is exhausted correctly, but a comment would help future maintainers understand this is intentional.

3. Error path skips bumpIngest
When an image/document ingestion throws, bumpIngest for that item is never reached. The progress bar briefly appears "stuck" before the finally block cleans it up. Minor UX nit — acceptable but worth noting.

4. ProjectFiles.tsx vs ChatInput.tsx error recovery inconsistency
ChatInput continues processing remaining files after an individual failure; ProjectFiles propagates the error immediately and stops. This means a batch of 5 files where file 3 fails shows 2/5 then disappears in ProjectFiles, but would continue to 5/5 in ChatInput.

Recommendation: improve needed (minor)

Two small items before merge:

  1. Remove the ?? 'Uploading files…' fallback in ProjectFiles.tsx (or add the same in ChatInput.tsx for consistency).
  2. Add a brief inline comment in attachmentProcessing.ts near the if (targetMode === 'inline' && parsedContent) branch explaining the fallthrough logic.

Overall this is well-scoped, correct, and follows existing codebase patterns. Good work on the thorough locale coverage.

@tokamak-pm

tokamak-pm Bot commented Apr 12, 2026

Copy link
Copy Markdown

Follow-up Review — commit 6d63886

What changed

  • Removes unnecessary null coalescing (?? 'Uploading files…') from a t() call — correct since i18next always returns a string.
  • Adds clarifying comments in attachmentProcessing.ts explaining the embeddings-fallback path when inline parsing fails.

Both are minor cleanup items addressing previous review feedback.

Recommendation: can merge

Review feedback addressed. The progress bar feature is well-implemented with proper i18n support.

@qnixsynapse qnixsynapse force-pushed the feat/file-attachment-progress-bar branch from 6d63886 to ad3e309 Compare April 14, 2026 02:28

@qnixsynapse qnixsynapse left a comment

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.

Image

LGTM

@qnixsynapse qnixsynapse merged commit a41f294 into janhq:main Apr 14, 2026
17 checks passed
@github-project-automation github-project-automation Bot moved this to QA in Jan Apr 14, 2026
fansilas pushed a commit to fansilas/jan that referenced this pull request Apr 23, 2026
* feat: add progress bar for uploading status

* feat: implement i18n localization for the changes

* fix: address review comment
enjoyandlove added a commit to enjoyandlove/jan that referenced this pull request Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: QA

Development

Successfully merging this pull request may close these issues.

2 participants