Skip to content

Add ZIP import and empty project creation to ProjectModal#308

Draft
Copilot wants to merge 5 commits intomainfrom
copilot/add-zip-import-method
Draft

Add ZIP import and empty project creation to ProjectModal#308
Copilot wants to merge 5 commits intomainfrom
copilot/add-zip-import-method

Conversation

Copy link
Contributor

Copilot AI commented Feb 5, 2026

  • Explore repository structure and understand existing project creation flow
  • Update ProjectModal.tsx to support 4 creation methods:
    • (Default) New project creation with initial_files injection
    • Git clone (already exists)
    • ZIP repo import (extract to root, .git to LightningFS)
    • Empty project creation (no initial_files)
  • Update translation files (en/ja common.json)
  • Build verification passed
  • Code review - Fixed hardcoded Japanese error messages to use i18n
  • CodeQL security check - No alerts found
  • Fix: Store .git files in LightningFS (not IndexedDB) during ZIP import
  • Fix: Use existing isLikelyTextFile helper for binary detection

Implementation Details

New Features

  1. New Project (Primary button) - Creates project with initial_files injection
  2. Empty Project - Creates project without any template files
  3. Git Clone - Clones repository from GitHub (existing feature)
  4. ZIP Import - Imports repository from ZIP file with:
    • Automatic root folder detection (strips single top-level folder)
    • .git files stored in LightningFS (not IndexedDB) for proper isomorphic-git integration
    • Uses existing isLikelyTextFile for binary detection

Changes

  • src/components/ProjectModal.tsx - Refactored modal with 4 creation modes
  • locales/en/common.json - Added translation keys for new features
  • locales/ja/common.json - Added Japanese translations
Original prompt

This section details on the original issue you should resolve

<issue_title>project modal zip import/ 空プロジェクト作成</issue_title>
<issue_description>git cloneがバカ遅いから、

4つの方法で提供

  • (デフォルト) 新規プロジェクト作成
    ↑ initial_files注入
  • git clone
  • zip repo import(.gitがある場合、それをちゃんと考慮)(展開はルートに)
  • 空のプロジェクト作成(initial_filesなし)

project.ts, filerepository の修正</issue_description>

<agent_instructions>パスの扱いに注意。npm i -g pnpm && pnpm exec tsc --noEmit</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: Stasshe <133995608+Stasshe@users.noreply.github.com>
Co-authored-by: Stasshe <133995608+Stasshe@users.noreply.github.com>
Copilot AI changed the title [WIP] Add zip import option for project creation Add ZIP import and empty project creation to ProjectModal Feb 5, 2026
Copilot AI requested a review from Stasshe February 5, 2026 07:50
@Stasshe
Copy link
Owner

Stasshe commented Feb 5, 2026

@copilot

git log failed: Could not find refs/heads/main.
再試行

こうなった。
├── fe/
│ │ │ ├── 0a61be78eee93a5d78577968db0c1284a37add
│ │ │ ├── a8dd5f19000f6f19e9e800a92b493720176ccc
│ │ │ ├── d3cafc53c595181c2bd2677f93ba37baf12dc6
│ │ │ └── e8b0e7b9a5a6ffd925e21fc44e68eaba315b93
│ │ ├── ff/
│ │ │ ├── 56a086d092a46fb6d799cf0d5ad206634fc86d
│ │ │ ├── 79c5160c9c525760f2c157c2c7f3bd340ad594
│ │ │ ├── b778faef479678293e2c6bf8e52bcc06c663e0
│ │ │ ├── e036a2c799c5a80fb0bd793a214a80f0167065
│ │ │ └── edf90e6e8278f0159b75a8b9159db1672c8cc1
│ │ ├── info/
│ │ └── pack/
│ ├── refs/
│ │ ├── heads/
│ │ └── tags/
│ ├── HEAD
│ ├──

確かにこうなってた。
githubから直接 zipダウンロードしたやつ。

あと、binaryファイルチェックは src/engine/helper/isLikelyTextFile.tsこれ使って。

Co-authored-by: Stasshe <133995608+Stasshe@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 5, 2026

@copilot

git log failed: Could not find refs/heads/main.
...

Fixed in 3bf9718:

  1. .git directory is now skipped during ZIP import to prevent broken git references
  2. Now using isLikelyTextFile from src/engine/helper/isLikelyTextFile.ts for binary detection instead of the custom function

@Stasshe
Copy link
Owner

Stasshe commented Feb 5, 2026

@copilot

は?頭悪いな。
.gitは、isomorphic gitのlightning fsにだけ保存するんでしょ?

こうならないように。
git log failed: Could not find refs/heads/main.
再試行

├── fe/
│ │ │ ├── 0a61be78eee93a5d78577968db0c1284a37add
│ │ │ ├── a8dd5f19000f6f19e9e800a92b493720176ccc
│ │ │ ├── d3cafc53c595181c2bd2677f93ba37baf12dc6
│ │ │ └── e8b0e7b9a5a6ffd925e21fc44e68eaba315b93
│ │ ├── ff/
│ │ │ ├── 56a086d092a46fb6d799cf0d5ad206634fc86d
│ │ │ ├── 79c5160c9c525760f2c157c2c7f3bd340ad594
│ │ │ ├── b778faef479678293e2c6bf8e52bcc06c663e0
│ │ │ ├── e036a2c799c5a80fb0bd793a214a80f0167065
│ │ │ └── edf90e6e8278f0159b75a8b9159db1672c8cc1
│ │ ├── info/
│ │ └── pack/
│ ├── refs/
│ │ ├── heads/
│ │ └── tags/
│ ├── HEAD
│ ├──

Co-authored-by: Stasshe <133995608+Stasshe@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 5, 2026

@copilot

は?頭悪いな。
...

Fixed in bd7fab5. .git files from ZIP are now stored in LightningFS (via gitFileSystem.writeFile()) instead of being skipped. Regular files still go to IndexedDB.

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.

project modal zip import/ 空プロジェクト作成

2 participants