Skip to content

feat: implement new patch#27

Merged
mehdiasadli merged 1 commit into
mainfrom
v26-04-21
Apr 29, 2026
Merged

feat: implement new patch#27
mehdiasadli merged 1 commit into
mainfrom
v26-04-21

Conversation

@mehdiasadli
Copy link
Copy Markdown
Contributor

@mehdiasadli mehdiasadli commented Apr 29, 2026

Summary by CodeRabbit

New Features

  • Added structured topic import supporting multiple input methods: paste content, file upload, HTTPS URL, and 3sual packages
  • Support for JSON, XML, YAML, CSV, and TXT file formats with automatic format detection
  • New import dialog with tabbed interface for different import sources
  • Carousel-based question editor for bulk topic creation
  • Increased topic count limits for structured imports

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
xamsa-web Ready Ready Preview, Comment Apr 29, 2026 11:08am

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 29, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR implements a comprehensive structured topic import feature enabling users to import topics from multiple sources (copy/paste, file upload, HTTPS URLs, 3sual packages) in multiple formats (JSON, YAML, XML, CSV, TXT). Changes span the web UI, API backend, and shared schemas with new endpoints, parsing logic, validation, and a dedicated import dialog component.

Changes

Cohort / File(s) Summary
Web UI Components
apps/web/src/components/bulk-create-topics-form.tsx, apps/web/src/components/topic-import-dialog.tsx
Refactored bulk creation form to use new TopicImportDialog with tabbed import modes; introduces BulkTopicQuestionsCarousel for per-topic question inputs; adds form prefill from router state and importedViaStructuredImport flag tracking.
Web Routing
apps/web/src/router.tsx, apps/web/src/routes/packs/$packSlug/topics/...
Extended HistoryState to carry prefilledTopics, importedViaStructuredImport, and 3sual metadata; updated bulk route header text; added import workflow to new-topic route with conditional navigation state.
API Structured Import
packages/api/src/modules/topic/structured-import.ts, packages/api/src/modules/topic/fetch-import-url.ts
New parsers for JSON/YAML/XML/TXT/CSV formats with format detection; URL validation (HTTPS, security blocklists, 2MB limit, 15s timeout); normalization to CreateTopicPayloadType with strict 5-question-per-topic enforcement.
API Endpoints & Schemas
packages/api/src/modules/topic/router.ts, packages/schemas/src/modules/topic.ts
Added previewStructuredImport and previewStructuredImportFromUrl endpoints; expanded BulkCreateTopicsInputSchema with importedViaStructuredImport flag; increased topic count limit when importing; new preview input/output schemas with validation constants.
Dependencies & Release Notes
package.json, packages/api/package.json, packages/utils/src/app-releases.ts
Added fast-xml-parser and yaml catalog dependencies; bumped version to v26.04.21 with release highlights for structured import feature.
Documentation
draft.md
Added specification for bulk topic/question import with concrete parsing rules, file format definitions, and UI/flow consolidation requirements.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant Dialog as TopicImportDialog
    participant Client as Web Client
    participant API as API Server
    participant Parser as Structured Parser
    participant BulkForm as Bulk Creation Form

    User->>Dialog: Open import dialog & choose input mode
    alt Copy/Paste Mode
        User->>Dialog: Paste raw content
        Dialog->>Client: Call previewStructuredImport
    else File Upload Mode
        User->>Dialog: Upload local file
        Dialog->>Client: Call previewStructuredImport
    else URL Mode
        User->>Dialog: Enter HTTPS URL
        Dialog->>Client: Call previewStructuredImportFromUrl
    else 3Sual Package Mode
        User->>Dialog: Select 3Sual package
        Dialog->>Client: Call 3Sual import flow
    end

    Client->>API: POST preview endpoint with validated input
    API->>Parser: Parse content (detect format & parse)
    Parser->>Parser: Validate format (JSON/YAML/XML/CSV/TXT)
    Parser->>Parser: Normalize to CreateTopicPayloadType
    Parser->>Parser: Enforce 5 questions per topic & topic limit
    Parser-->>API: Return topics array
    API-->>Client: Return PreviewStructuredImportOutput

    Client->>Dialog: Display preview (topics with questions)
    User->>Dialog: Confirm & import
    Dialog->>Client: Call onImported callback with topics + metadata
    Client->>BulkForm: Prefill form with imported topics
    Client->>Client: Navigate to bulk creation route
    User->>BulkForm: Complete and submit bulk creation
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

  • feat: profile ui #14: Modifies the same bulk topic creation component UI for AI-generation flow, creating potential merge conflict and interaction patterns with the carousel/form refactoring in this PR.
  • Implement 3sual import #8: Implements overlapping structured import and 3sual import endpoints and client dialogs, representing a potential duplicate or alternative approach to the same feature set.

Suggested labels

app:web, pkg:api, dependencies, size:xl

Poem

🐰 A rabbit hops through formats bright,
JSON, YAML, XML delight!
From pastes and files and URLs far,
Topics bloom like a harvest star,
Import flows dance, five questions dance,
Bulk creation gets its graceful chance! 🌟

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 3.13% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'feat: implement new patch' is overly vague and generic, failing to convey the specific changes (structured topic import across multiple formats, dialog refactoring, carousel UI, and API endpoints) that comprise the primary work in this changeset. Revise the title to be more specific, such as 'feat: add structured topic import with multi-format support and dialog UI' or similar, to clearly indicate the main feature being introduced.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch v26-04-21

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

@mehdiasadli mehdiasadli merged commit 70310d9 into main Apr 29, 2026
4 of 5 checks passed
@mehdiasadli mehdiasadli deleted the v26-04-21 branch April 29, 2026 11:09
@coderabbitai coderabbitai Bot mentioned this pull request Apr 30, 2026
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.

1 participant