Target branch: Please verify that the pull request targets the dev branch.
Description: Provide a concise description of the changes made in this pull request.
Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
Documentation: Have you updated relevant documentation Open WebUI Docs, or other documentation sources?
Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
Testing: Have you written and run sufficient tests to validate the changes?
Code review: Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?
Prefix: The prefix "feat" was used to categorize this pull request.
Changelog Entry
Description
I WILL FILL THIS OUT BETTER SOON!
Import/Export Chats as .zip functionality added.
Added
Feature to import and export chats as .zip files.
New dependency: jszip==10.8.2, for .zip file handling.
Functionality to import single .json files from exported & extracted chats .zip file
Better toast notifications (okay, not really streamlined, but I blame the LLMs I was working with and my non-coding skills to standardize how they act, look, and appear.
Changes
Changelog for Sidebar.svelte:
Added validation and type-checking for items parameter:
Added a check to ensure items is not null or undefined.
Added a check to verify items is iterable.
Added handling for cases where items is a single object instead of an array, converting it to an array.
Added a check to log an error if items is not iterable after the previous transformations.
Refactored importChatHandler function:
Added a new log entry to print items before processing.
Updated the loop to process each item in items.
Added a new condition to handle cases where the chat object is the item itself (not nested in .chat).
The importChatHandler function now ensures that items is valid and iterable before processing, and it handles both arrays of items and single item objects.
Deprecated
[List any deprecated functionality or features that have been removed]
Removed
[List any removed features, files, or functionalities]
Fixed
[List any fixes, corrections, or bug fixes]
Security
[List any new or updated security-related changes, including vulnerability fixes]
Breaking Changes
BREAKING CHANGE: [List any breaking changes affecting compatibility or functionality]
Additional Information
[Insert any additional context, notes, or explanations for the changes]
[Reference any related issues, commits, or other relevant information]
Screenshots or Videos
Before:
After:
The toast notifications have mostly been streamlined/standardized with an overhaul in the major refac commit of this PR!
Import Chats (.json):
Successful import of a single .json chat file that came from an exported .zip file (after the fact that the .zip file has been extracted and you are importing a chat from the Chats folder contained within the .zip):
Successful import of a .json file export of all chats:
after waiting for it to finish:
Failed attempt of importing an already exported .zip file for chats without using the Import Chats (.zip) option and instead having tried to use Import Chats (.json) option:
Import Chats (.zip):
Successful import of a .zip file of chats from an exported .zip file:
after waiting for it to finish:
Failed attempt at importing a .json file export of all chats without using the Import Chats (.json) option, but the Import Chats as .zip option instead:
Export Chats (.json):
Successful attempt at exporting a .json file of all chats as .json:
Followed by:
Export Chats (.zip):
Successful attempt at exporting a .zip file of all chats:
Followed by:
Followed by:
Lastly:
Bonus Notifications Added
Both Export Chats (.json) and Export Chats (.zip) options will fail with a toast notification displayed if there are no chats present to be exported:
The same logic also applies for trying to archive/delete chats when none exist.
You're now displayed a toast notification upon successfully archiving and deleting chats and their count.
Dynamic messages for import options
Chat options gray out if exporting chats
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/open-webui/open-webui/pull/12410
**Author:** [@silentoplayz](https://github.com/silentoplayz)
**Created:** 4/3/2025
**Status:** ❌ Closed
**Base:** `dev` ← **Head:** `export-chats-as-zip`
---
### 📝 Commits (6)
- [`37bea93`](https://github.com/open-webui/open-webui/commit/37bea93da39a78b59699a61dba2fcee317605146) push
- [`b056e67`](https://github.com/open-webui/open-webui/commit/b056e67bd97b214fb7ed7f7f72975fe99a5022da) chore: format
- [`693f2ef`](https://github.com/open-webui/open-webui/commit/693f2ef63dd3db158f91949a5c499bca3fef31c8) refac: huge refactor (hopefully for the better)
- [`e8d6898`](https://github.com/open-webui/open-webui/commit/e8d68989b41bd6fd27713b7c3b62af3e04756045) chore: remove comments
- [`debbe91`](https://github.com/open-webui/open-webui/commit/debbe9118d30a923c48ddd51b8b644050ef3e829) chore: format again
- [`98ebeaf`](https://github.com/open-webui/open-webui/commit/98ebeafd804ad79463c85f34dcddfbc593923229) headers added
### 📊 Changes
**5 files changed** (+740 additions, -175 deletions)
<details>
<summary>View changed files</summary>
📝 `package-lock.json` (+45 -12)
📝 `package.json` (+1 -0)
📝 `pyproject.toml` (+1 -0)
📝 `src/lib/components/chat/Settings/Chats.svelte` (+674 -163)
📝 `src/lib/components/layout/Sidebar.svelte` (+19 -0)
</details>
### 📄 Description
# Pull Request Checklist
- [x] **Target branch:** Please verify that the pull request targets the `dev` branch.
- [x] **Description:** Provide a concise description of the changes made in this pull request.
- [x] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description.
- [x] **Documentation:** Have you updated relevant documentation [Open WebUI Docs](https://github.com/open-webui/docs), or other documentation sources?
- [x] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation?
- [x] **Testing:** Have you written and run sufficient tests to validate the changes?
- [x] **Code review:** Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?
- [x] **Prefix:** The prefix "feat" was used to categorize this pull request.
# Changelog Entry
### Description
**I WILL FILL THIS OUT BETTER SOON!**
- Import/Export Chats as .zip functionality added.
### Added
- Feature to import and export chats as .zip files.
- New dependency: `jszip==10.8.2`, for .zip file handling.
- Functionality to import single .json files from exported & extracted chats .zip file
- Better toast notifications (okay, not really streamlined, but I blame the LLMs I was working with and my non-coding skills to standardize how they act, look, and appear.
### Changes
### Changelog for `Sidebar.svelte`:
- **Added validation and type-checking for `items` parameter**:
- Added a check to ensure `items` is not null or undefined.
- Added a check to verify `items` is iterable.
- Added handling for cases where `items` is a single object instead of an array, converting it to an array.
- Added a check to log an error if `items` is not iterable after the previous transformations.
- **Refactored `importChatHandler` function**:
- Added a new log entry to print `items` before processing.
- Updated the loop to process each item in `items`.
- Added a new condition to handle cases where the chat object is the item itself (not nested in `.chat`).
The `importChatHandler` function now ensures that `items` is valid and iterable before processing, and it handles both arrays of items and single item objects.
### Deprecated
- [List any deprecated functionality or features that have been removed]
### Removed
- [List any removed features, files, or functionalities]
### Fixed
- [List any fixes, corrections, or bug fixes]
### Security
- [List any new or updated security-related changes, including vulnerability fixes]
### Breaking Changes
- **BREAKING CHANGE**: [List any breaking changes affecting compatibility or functionality]
---
### Additional Information
- [Insert any additional context, notes, or explanations for the changes]
- [Reference any related issues, commits, or other relevant information]
### Screenshots or Videos
# `Before:`

# `After:`

# The toast notifications have *mostly* been streamlined/standardized with an overhaul in the [major refac commit](https://github.com/open-webui/open-webui/pull/12410/commits/693f2ef63dd3db158f91949a5c499bca3fef31c8) of this PR!
## `Import Chats (.json)`:
- **Successful import of a single .json chat file that came from an exported .zip file (after the fact that the .zip file has been extracted and you are importing a chat from the `Chats` folder contained within the .zip):**

- **Successful import of a .json file export of all chats:**

- **after waiting for it to finish:**

- **Failed attempt of importing an already exported .zip file for chats without using the `Import Chats (.zip)` option and instead having tried to use `Import Chats (.json)` option:**

## `Import Chats (.zip)`:
- **Successful import of a .zip file of chats from an exported .zip file:**

- **after waiting for it to finish:**

- **Failed attempt at importing a .json file export of all chats without using the `Import Chats (.json)` option, but the `Import Chats as .zip` option instead:**

# `Export Chats (.json)`:
- **Successful attempt at exporting a .json file of all chats as .json:**

- Followed by:

## `Export Chats (.zip)`:
- **Successful attempt at exporting a .zip file of all chats:**

- Followed by:

- Followed by:

- Lastly:

# Bonus Notifications Added
## Both `Export Chats (.json)` and `Export Chats (.zip)` options will fail with a toast notification displayed if there are no chats present to be exported:

## The same logic also applies for trying to archive/delete chats when none exist.

## You're now displayed a toast notification upon successfully archiving and deleting chats and their count.


## Dynamic messages for import options


## Chat options gray out if exporting chats



---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/12410
Author: @silentoplayz
Created: 4/3/2025
Status: ❌ Closed
Base:
dev← Head:export-chats-as-zip📝 Commits (6)
37bea93pushb056e67chore: format693f2efrefac: huge refactor (hopefully for the better)e8d6898chore: remove commentsdebbe91chore: format again98ebeafheaders added📊 Changes
5 files changed (+740 additions, -175 deletions)
View changed files
📝
package-lock.json(+45 -12)📝
package.json(+1 -0)📝
pyproject.toml(+1 -0)📝
src/lib/components/chat/Settings/Chats.svelte(+674 -163)📝
src/lib/components/layout/Sidebar.svelte(+19 -0)📄 Description
Pull Request Checklist
devbranch.Changelog Entry
Description
I WILL FILL THIS OUT BETTER SOON!
Added
jszip==10.8.2, for .zip file handling.Changes
Changelog for
Sidebar.svelte:Added validation and type-checking for
itemsparameter:itemsis not null or undefined.itemsis iterable.itemsis a single object instead of an array, converting it to an array.itemsis not iterable after the previous transformations.Refactored
importChatHandlerfunction:itemsbefore processing.items..chat).The
importChatHandlerfunction now ensures thatitemsis valid and iterable before processing, and it handles both arrays of items and single item objects.Deprecated
Removed
Fixed
Security
Breaking Changes
Additional Information
Screenshots or Videos
Before:After:The toast notifications have mostly been streamlined/standardized with an overhaul in the major refac commit of this PR!
Import Chats (.json):Successful import of a single .json chat file that came from an exported .zip file (after the fact that the .zip file has been extracted and you are importing a chat from the

Chatsfolder contained within the .zip):Successful import of a .json file export of all chats:

after waiting for it to finish:

Failed attempt of importing an already exported .zip file for chats without using the

Import Chats (.zip)option and instead having tried to useImport Chats (.json)option:Import Chats (.zip):Successful import of a .zip file of chats from an exported .zip file:

after waiting for it to finish:

Failed attempt at importing a .json file export of all chats without using the

Import Chats (.json)option, but theImport Chats as .zipoption instead:Export Chats (.json):Export Chats (.zip):Bonus Notifications Added
Both
Export Chats (.json)andExport Chats (.zip)options will fail with a toast notification displayed if there are no chats present to be exported:The same logic also applies for trying to archive/delete chats when none exist.
You're now displayed a toast notification upon successfully archiving and deleting chats and their count.
Dynamic messages for import options
Chat options gray out if exporting chats
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.