Skip to content

fix(chat): stop the mobile toolbar staying hidden in notes after composing - #595

Merged
Leo310 merged 1 commit into
mainfrom
fix/mobile-toolbar-composing-leak
Nov 26, 2026
Merged

Leo310 merged 1 commit into
mainfrom
fix/mobile-toolbar-composing-leak

Conversation

@Leo310

@Leo310 Leo310 commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

What

On mobile the chat hides Obsidian's formatting toolbar while its composer has focus (#525), using a s2b-chat-composing class on <body>. Two paths could leave that class set after focus left the chat, so the toolbar disappeared in note editing as well:

  • Tab switch with the composer focused. syncActiveState hides the composer with display: none, and WebKit fires no focusout for that. It now ends composing when the leaf stops rendering.
  • Focus moving straight from the composer into a note. iOS often reports a null relatedTarget, so onFocusOut couldn't see that focus went to an editor and deferred until the keyboard closed, which never happens while the note is being edited. A document-level focusin listener now ends composing as soon as focus lands in any editor outside the composer. Non-editor targets (tapping the conversation) keep the deferral, so the composer still doesn't jump on blur.

How I tested it

bun run check, format, lint, test (2441 passing) and a dev build. Not yet tried on a device; needs a live check on iOS: focus the chat composer, then (a) switch to a note tab and (b) tap straight into a note's editor, and confirm the toolbar is there in both.

AI assistance: Claude Code diagnosed the leak from the maintainer's report and wrote the fix; the maintainer has not yet reviewed or tested it on-device.

Checklist

  • bun run check, bun run format, bun run lint, and bun run test pass locally
  • I tried the change in a real Obsidian vault (or explained above why that isn't applicable)
  • I read CONTRIBUTING.md, including the section on AI assistance
  • If this adds a provider, a bundled skill, a built-in tool, or changes manifest.json: I noted that the docs site needs updating (see "Documentation" in CONTRIBUTING.md)

…osing

The chat hides Obsidian's mobile toolbar via a body class while its composer
has focus. Two paths left that class set, so the toolbar disappeared in note
editing too:

- Switching to a note's tab hides the focused composer with display:none,
  which fires no focusout in WebKit. syncActiveState now ends composing when
  the leaf stops rendering.
- iOS often reports a null relatedTarget when focus moves from the composer
  straight into a note, so the blur was deferred until the keyboard closed,
  which never happens while the note is being edited. A document focusin
  listener now ends composing as soon as focus lands in any editor outside
  the composer; non-editor targets keep the deferral.

Co-Authored-By: Claude <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge; no actionable defects were found.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable defects were found.

Summary

Restores Obsidian's mobile toolbar when users leave the chat composer.

  • Leaving a chat for a note clears that chat's composing state.

No actionable issues were found. The mobile behavior was not verified in a running Obsidian app.

Reviews (1) · Last reviewed commit: "fix(chat): stop the mobile toolbar stayi..." · Reviewed by Greptile

@Leo310
Leo310 merged commit ed14489 into main Nov 26, 2026
3 checks passed
@Leo310
Leo310 deleted the fix/mobile-toolbar-composing-leak branch November 26, 2026 13:19
Leo310 added a commit that referenced this pull request Nov 26, 2026
Google Gemini (#584), Mistral (#585) and LM Studio (#583) as providers, a
directory of OpenAI-compatible services under More providers (#589), and a
per-agent reasoning effort (#582). Quoting chat text into the input (#593),
chats that open where the last one was (#592), model details read from each
provider instead of models.dev (#586), and mobile fixes for the sidebar
drawer, the Cupertino theme, the formatting toolbar and the empty-chat
greeting (#594, #595, #596).

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant