App

Main app; handles project management

Constructor

new App()

Initializes the App, wiring up the server and workspace.
Properties
NameTypeDescription
serverProjectsobjectA list of projects that are saved on the server
localProjectsobjectA list of projects that are available locally and not saved to the server
workspaceWorkspaceThe app workspace which handles project editing
loginDialogLoginDialogThe login dialog
activeCtxMenuProjectContextMenuThe currently open Context Menu, if there is one
sidebarCollapsedboolTrue, 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:
NameTypeDescription
optionsobjectoptions for the close operation
Properties
NameTypeAttributesDescription
onClosedfunction<optional>
called after the project is closed
onCancelfunction<optional>
called if the user cancels

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:
NameTypeDescription
projectobjectThe 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:
NameTypeAttributesDefaultDescription
namestring<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:
NameTypeDescription
folderobjectfolder 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:
NameTypeDefaultDescription
projectobjectThe project to be deleted
bypassWarningboolfalseIf 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:
NameTypeDescription
originalProjectobjectThe project that should be duplicated

getProject(projectId) → {object|null}

Looks up a project by id in both registries (server takes priority).
Parameters:
NameTypeDescription
projectIdstringthe 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:
NameTypeDescription
projectIdstringthe 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:
NameTypeDescription
projectobjectthe project to move
Navigates the server section to the given folder path.
Parameters:
NameTypeDescription
folderPathstringrelative folder path ('' for root)
Navigates the shared section to the given folder path.
Parameters:
NameTypeDescription
folderPathstringrelative folder path ('' for root)

openFolderCtxMenu(x, y, folder, item)

Opens a small context menu for a folder with Rename and Delete actions.
Parameters:
NameTypeDescription
xnumberviewport x position
ynumberviewport y position
folderobjectfolder descriptor {name, path}
itemHTMLElementthe 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:
NameTypeAttributesDefaultDescription
filepathFile | null<optional>
nullpre-selected file to open; if null, shows a file picker

(async) openProject(project)

Opens a project and resets the workspace.
Parameters:
NameTypeDescription
projectobjectThe 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:
NameTypeDefaultDescription
xfloatThe x coordinate at which to place the context menu
yfloatThe y coordinate at which to place the context menu
projectobjectnullThe project context for the context menu

(async) pushProjectToServer(project) → {Promise.<void>}

Uploads a local project to the connected server, streaming progress updates.
Parameters:
NameTypeDescription
projectobjectThe 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:
NameTypeDescription
folderobjectfolder descriptor {name, path}
itemHTMLElementthe 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:
NameTypeDescription
projectobjectThe project to rename