web: shared modal focus controller (M1/M2) — work in progress
This commit is contained in:
+11
-3
@@ -254,7 +254,7 @@ export function readChatSeenStore() {
|
||||
}
|
||||
|
||||
export function createChatView(rt) {
|
||||
const { state, repo } = rt;
|
||||
const { state, repo, modal } = rt;
|
||||
let chatClock = null;
|
||||
let chatNow = Date.now();
|
||||
const renderContent = (...args) => rt.renderContent(...args);
|
||||
@@ -915,8 +915,6 @@ function openChatRename(session) {
|
||||
state.chatMenu = null;
|
||||
state.chatRename = session;
|
||||
renderContent();
|
||||
// Same re-render note as the menu: put the cursor in the Name field.
|
||||
document.getElementById("chatRenameInput")?.focus();
|
||||
}
|
||||
|
||||
function dismissChatRename() {
|
||||
@@ -2003,6 +2001,11 @@ function renderChatRenameDialog(session) {
|
||||
actions.append(save);
|
||||
panel.append(actions);
|
||||
overlay.append(panel);
|
||||
modal.stage("chat-rename", overlay, {
|
||||
onClose: () => dismissChatRename(),
|
||||
triggerSelector: `#chatRows .chat-row[data-session="${CSS.escape(String(session.id))}"] .chat-menu-button`,
|
||||
fallbackSelectors: ["#detailTitle", "#listTitle", "#pane-main"],
|
||||
});
|
||||
return overlay;
|
||||
}
|
||||
|
||||
@@ -3041,6 +3044,11 @@ function renderChatCloseDialog(session) {
|
||||
);
|
||||
panel.append(actions);
|
||||
overlay.append(panel);
|
||||
modal.stage("chat-close", overlay, {
|
||||
onClose: () => dismissChatClose(),
|
||||
triggerSelector: `#chatRows .chat-row[data-session="${CSS.escape(String(session.id))}"] .chat-menu-button`,
|
||||
fallbackSelectors: ["#detailTitle", "#listTitle", "#pane-main"],
|
||||
});
|
||||
return overlay;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user