Repository navigation
Studio: restore markdown chat import and bulk export - #12513
mahiatlinux merged 8 commits into
Conversation
Allow .md/.markdown in the Data settings and native import pickers, parse Studio transcript headings back into threads, and add Markdown to Library bulk export (combined and per-chat zip).
Bulk markdown export should match single-chat export and omit sibling branches.
|
|
|
@codex review |
|
Markdown already existed for individual chats and project sources. This PR closes the import and bulk-export gaps. The original implementation needed fixes before it was ready. Pushed fixes to the contributor branch:
Verification on
The browser check used the real Settings component with a memory-backed API fixture. Separate frontend installs and browser contexts compared merge base Review and landing use mirror PR #85 through |
mahiatlinux
left a comment
There was a problem hiding this comment.
LGTM! Ready to merge, all manually checked.
…lothai#17652) Fixes unslothai#17651 ## What this changes On the Projects page in the web UI, **Import chats…** opened a file dialog filtered to `.json, .jsonl, .ndjson, .csv`. Markdown chat exports were hidden there, although the importer behind that dialog reads them, and Settings > Data and the desktop picker both offer them. The page's hidden file input had its own copy of the extension list, which was not updated when Markdown import came back in unslothai#12513. - `projects-page.tsx` now takes its `accept` list from `CHAT_IMPORT_ACCEPT` (`features/chat/utils/import-chats.ts`), the list `pickAndImportChats` already uses. - `data-tab.tsx` (Settings > Data) uses the same constant in place of its own literal copy, so the three browser pickers cannot drift apart again. The constant is exported from the chat feature index next to `pickAndImportChats`. The desktop app is unchanged: it uses the native picker, which already lists `md` and `markdown`. ## Testing **Real Studio in Chromium (Windows 11):** I ran the backend (`run.py --api-only`) with the vite frontend, opened Projects, chose **Import chats…** from the import/export menu and read the file chooser the page opened. | | picker filter | `holiday notes.md` selectable | | --- | --- | --- | | main (d58508d) | `.json,.jsonl,.ndjson,.csv` | no | | this branch | `.json,.jsonl,.ndjson,.csv,.md,.markdown` | yes | On this branch I then picked a Markdown chat (`## User` / `## Assistant` sections), confirmed the import dialog, and the chat was saved as "holiday notes" (checked through `GET /api/chat/threads`). Settings > Data still shows `.json,.jsonl,.ndjson,.csv,.md,.markdown` on its import inputs. The visible difference is only in the operating system's file dialog, which a headless browser cannot capture, so there are no before/after screenshots. **Tests:** new `tests/chat-import-picker-accept.test.ts` checks that the Projects page and Settings > Data pickers use `CHAT_IMPORT_ACCEPT`, and that the list matches the desktop picker's `CHAT_IMPORT_EXTENSIONS` and covers the extensions the importer routes by name. The first test fails on main. Full frontend suite on this branch: 15884 tests, 15873 pass, 0 fail (the rest are skips). `node scripts/typecheck.mjs --tests` and eslint on the changed files are clean. ## Before / after Projects > import/export > Import chats... on the merge base (d58508d) and this branch (b2fb4f7), two separate Studio installs. The OS file dialog is not drawn by a headless browser, so the caption is drawn by the harness from the file chooser's `accept` attribute that each build opened.  Before: `.json,.jsonl,.ndjson,.csv`, a `.md` export is not selectable. After: `.json,.jsonl,.ndjson,.csv,.md,.markdown`, it is. --------- Co-authored-by: Daniel Han <[email protected]>


Summary
Fixes #12297 (import/export parity).
.md/.markdownand parse Studio## Roletranscripts back into chat threads (including combined bulk exports separated by---).Settings tab consolidation (Library vs Data overlap, API vs Remote & LAN) is intentionally out of scope for this PR and can follow in a separate UX pass.
Test plan
node --experimental-strip-types --test tests/conversation-markdown-import.test.ts tests/message-jsonl-import.test.ts