Constructor
new App()
Initializes the App, wiring up the server and workspace.
Properties| Name | Type | Description |
|---|---|---|
serverProjects | object | A list of projects that are saved on the server |
localProjects | object | A list of projects that are available locally and not saved to the server |
workspace | Workspace | The app workspace which handles project editing |
loginDialog | LoginDialog | The login dialog |
activeCtxMenu | ProjectContextMenu | The currently open Context Menu, if there is one |
sidebarCollapsed | bool | True, if the sidebar is in a collapsed state |
Methods
_maybeReopenLastProject()
Opens the last-viewed project on startup, if the preference is set and the project is available in the current session's server project list.
(async) _syncThemeToServer()
Syncs the current theme selection to the server, merging into existing preferences.
_updateUserDisplay()
Updates the sidebar user section to reflect the current login state. Shows name, avatar, and appropriate dropdown items.
closeActiveProject(options)
Closes the currently active project, prompting the user to confirm if there are unsaved changes. Calls onClosed on success or onCancel if the user dismisses the confirmation dialog.
Parameters:
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | options for the close operationProperties
|
closeCtxMenu()
Closes the active context menu
(async) compressProject(project)
Shows a dialog explaining project compression, then compresses the project on confirm. Compression deletes the original audio file and keeps only the generated MP3.
Parameters:
| Name | Type | Description |
|---|---|---|
project | object | The server project to compress |
(async) createProject(nameopt) → {Promise.<string>}
Creates a new project. When connected, creates on the server first; falls back to local on failure. When offline, creates locally.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
name | string | <optional> | 'Untitled Project' | display name for the new project |
Returns:
the new project's id
- Type:
- Promise.<string>
createServerFolder()
Prompts the user for a name and creates a new server folder at the current path.
(async) deleteFolder(folder)
Deletes a server folder after confirmation. Shows a warning with the count of contents and offers the option to merge contents into the parent instead.
Parameters:
| Name | Type | Description |
|---|---|---|
folder | object | folder descriptor {name, path} |
(async) deleteProject(project, bypassWarning)
Deletes a project after confirmation. For server projects, also removes it from the server via the API. Resets the workspace if the deleted project was the currently active one.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
project | object | The project to be deleted | |
bypassWarning | bool | false | If true, the delete confirm dialog will be auto-accepted |
(async) duplicateProject(originalProject)
Duplicates the given project and handles it based on whether it is a local or server project.
Parameters:
| Name | Type | Description |
|---|---|---|
originalProject | object | The project that should be duplicated |
getProject(projectId) → {object|null}
Looks up a project by id in both registries (server takes priority).
Parameters:
| Name | Type | Description |
|---|---|---|
projectId | string | the project's unique identifier |
Returns:
project object, or null if not found
- Type:
- object |
null
isServerProject(projectId) → {boolean}
Returns true if the project with the given id is stored on the server.
Parameters:
| Name | Type | Description |
|---|---|---|
projectId | string | the project's unique identifier |
Returns:
- Type:
- boolean
(async) moveProjectToFolder(project)
Shows a folder picker dialog and moves the given project to the chosen folder.
Parameters:
| Name | Type | Description |
|---|---|---|
project | object | the project to move |
(async) navigateToFolder(folderPath)
Navigates the server section to the given folder path.
Parameters:
| Name | Type | Description |
|---|---|---|
folderPath | string | relative folder path ('' for root) |
(async) navigateToSharedFolder(folderPath)
Navigates the shared section to the given folder path.
Parameters:
| Name | Type | Description |
|---|---|---|
folderPath | string | relative folder path ('' for root) |
openFolderCtxMenu(x, y, folder, item)
Opens a small context menu for a folder with Rename and Delete actions.
Parameters:
| Name | Type | Description |
|---|---|---|
x | number | viewport x position |
y | number | viewport y position |
folder | object | folder descriptor {name, path} |
item | HTMLElement | the folder's DOM element (for inline rename) |
(async) openPackagedProject(filepathopt)
Opens a file picker for .wfs project archives, unpacks the selected file, registers it as a local project, and opens it in the workspace.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
filepath | File | | <optional> | null | pre-selected file to open; if null, shows a file picker |
(async) openProject(project)
Opens a project and resets the workspace.
Parameters:
| Name | Type | Description |
|---|---|---|
project | object | The project to be opened |
openProjectCtxMenu(x, y, project)
Opens a new project context menu. If the provided project is null, it will open a truncated general menu with only options for non-project-dependant tasks like creating a new project
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
x | float | The x coordinate at which to place the context menu | |
y | float | The y coordinate at which to place the context menu | |
project | object | null | The project context for the context menu |
(async) pushProjectToServer(project) → {Promise.<void>}
Uploads a local project to the connected server, streaming progress updates.
Parameters:
| Name | Type | Description |
|---|---|---|
project | object | The local project to push. |
Returns:
- Type:
- Promise.<void>
(async) refreshCurrentFolderFolders()
Fetches and stores the list of immediate subfolders at currentFolderPath.
(async) refreshServerProjects()
Fetches the full project list from the server and rebuilds the server project registry. Updates the sidebar when complete.
(async) refreshSharedFolderItems()
Fetches root-level folders accessible in the Shared section. When sharedFolderPath is non-empty, fetches that folder's contents instead.
(async) refreshSharedProjects()
Fetches the list of projects shared with the current user and updates the sidebar.
renderSidebar()
Fully re-renders the project sidebar list from the current registry state. Shows server projects first (sorted by modified desc), then local projects. Shows the "No projects yet" empty state when both registries are empty.
startFolderRename(folder, item)
Activates inline rename editing for a folder item in the sidebar.
Parameters:
| Name | Type | Description |
|---|---|---|
folder | object | folder descriptor {name, path} |
item | HTMLElement | the folder's DOM element |
startSidebarRename(project)
Activates inline rename editing for a project's sidebar item. Replaces the name span with a text input; commits on blur/Enter, cancels on Escape.
Parameters:
| Name | Type | Description |
|---|---|---|
project | object | The project to rename |