# Adom Bridge in the background: the tray, the hidden window, and the taskbar tile

Adom Bridge is built to live quietly on your machine. Most of the time its
window is hidden and it sits in the system tray, still connected and still
serving, while costing very little. This page explains what closing the window
really does, why that is cheap, how to read Adom Bridge's mode from the taskbar alone,
and how to actually exit.

![The muted standalone taskbar tile](taskbar-standalone.png)
![The vivid Hydrogen Embedded taskbar tile](taskbar-embedded.png)

## What closing the window really does

Clicking the X on Adom Bridge's window hides the window. It does not exit the app. Adom Bridge
keeps running in the background: it stays connected to your relay, keeps its
bridges alive, and can still show notifications and approval prompts. That is
the point of the app; it is the always-reachable agent surface for your
machine, so "close" means "get out of my way", not "stop working".

You will not be left guessing. The first three times you close the window, Adom Bridge
shows a notification explaining that it moved to the tray. After that it
assumes you know and stays quiet.

If you launch Adom Bridge again while it is hidden, the existing instance simply shows
and focuses its window (there is never a second copy running).

## Why Adom Bridge in the tray costs very little

Adom Bridge is two things: a small native core process that does all the real work
(roughly 60 MB), and a web-technology window (WebView2) that only exists to
paint the user interface.

When the window is hidden, that UI layer is suspended: its renderer is marked
invisible, its memory target is dropped to low, and the page itself is put to
sleep. GPU compositing for the hidden UI is switched off as well. Work that
exists only to paint the screen (like the little health LEDs) is skipped
entirely while nothing is visible.

The native core is not throttled at all. Connections, bridges, notifications,
and approvals run at full speed whether the window is visible or not.

When you open the window again, the UI wakes up immediately and returns to
full power. Status LEDs refresh themselves within about 15 seconds of the
window appearing.

## Reading the mode from the taskbar tile

Adom Bridge runs in one of two modes, and the taskbar button tells you which without
opening anything:

- A MUTED teal tile named "Adom Bridge": Adom Bridge is running standalone, on its
  own. This is the default for a normal install.
- A VIVID teal tile named "Adom Bridge Hydrogen Embedded": Hydrogen
  launched Adom Bridge and is driving its lifecycle.

The swap is live: when the mode changes, the button's tile and name change
within about a second, with no restart and no flicker. Under the hood each
mode is a separate registered Windows app identity, and the window switches
between them.

Two things to know:

- A taskbar pin belongs to one identity. If you pin Adom Bridge in one mode, the
  running window shows as a separate button whenever Adom Bridge is in the other mode.
- The tray icon exists only in standalone mode. When Adom Bridge is embedded in
  Hydrogen, the tray icon is hidden, so the taskbar tile is the way
  to tell the modes apart.

The window title is also informative: it shows the running version, whether
the build is signed, and a HOST or SANDBOX marker.

## Launch on boot

Adom Bridge starts on login by default. The setting is a checkbox in Settings (checked
by default), and Adom Bridge keeps the actual Startup entry in sync with it on every
launch: if the checkbox is on and the Startup shortcut is missing, Adom Bridge
recreates it; if the checkbox is off, Adom Bridge removes it.

To turn it off, untick the launch-on-boot checkbox in Settings. If you have
disabled Adom Bridge under Task Manager's Startup apps instead, Adom Bridge respects
that choice and does not re-enable itself.

## How to actually exit Adom Bridge

Closing the window never exits. The supported way to stop Adom Bridge is the shutdown
command, for example from the CLI:

    adom-bridge-cli desktop_shutdown

or over the local API:

    curl -s -X POST 127.0.0.1:47200/command -d '{"command":"shutdown"}'

With launch on boot enabled, Adom Bridge will come back at the next login; untick the
Settings checkbox first if you want it to stay off.

One more lifecycle note: if Hydrogen dies while Adom Bridge is embedded, Adom Bridge
does not die with it. It reverts to standalone mode (tray icon back,
connections preserved) so the machine stays reachable.

## Updates never steal your focus

When Adom Bridge restarts itself to apply an automatic update, it comes back in the tray without showing or focusing the window. A window that appears in front of you always has a reason, and the Activity Log records it (look for foreground entries naming who asked and why).
