MCPcopy Create free account
hub / github.com/OpenAnonymity/oa-chat / createSidebarInterface

Function createSidebarInterface

chat/ui/appInterface.js:132–158  ·  view source on GitHub ↗
(app)

Source from the content-addressed store, hash-verified

130 const session = app.getCurrentSession();
131 const reservation = session ? app.beginSessionMutation?.(session.id) : null;
132 if (session && app.beginSessionMutation && !reservation) {
133 await app.acknowledgeSessionMutationBusy?.(session.id);
134 return { session, modelName: session.model, busy: true };
135 }
136 try {
137
138 await db.saveSetting('selectedModel', normalizedModelName);
139
140 if (!session) {
141 app.state.pendingModelName = normalizedModelName;
142 app.applyPersistedParallelPendingConfig?.(normalizedModelName);
143 app.renderCurrentModel();
144 return { session: null, modelName: normalizedModelName };
145 }
146
147 session.model = normalizedModelName;
148 await db.saveSession(session);
149 app.renderCurrentModel();
150 return { session, modelName: normalizedModelName };
151 } finally {
152 if (reservation) app.endSessionMutation(session.id, reservation);
153 }
154 },
155 async selectCouncilSecondaryModel(modelName) {
156 const normalizedModelName = app.normalizeModelName(modelName);
157 if (app.chatInput?.selectCouncilSecondaryModel) {
158 await app.chatInput.selectCouncilSecondaryModel(normalizedModelName);
159 }
160 return { session: app.getCurrentSession(), modelName: normalizedModelName };
161 },

Callers 2

createVanillaUiInterfaceFunction · 0.85

Calls 13

pickElementsFunction · 0.85
getFilteredSessionsMethod · 0.80
toggleSessionStarMethod · 0.80
switchSessionMethod · 0.80
shareCurrentSessionMethod · 0.80
copySessionLinkMethod · 0.80
exportChatToPdfMethod · 0.80
updateSessionTitleMethod · 0.80
updateToolbarDividerMethod · 0.80

Tested by

no test coverage detected