← All posts

Windows on the frontend

JustZix floating button — 3-letter drop with hover state, snap, popup menu

The floating button is the small 3-letter drop you see on every page where JustZix has an active rule. It's the entrance to the whole JustZix UI — click opens a popup with toggles, drag lets you reposition it, snap links it with action bars. Small visually, but it condenses a lot of functionality. This post opens it up.

3-letter label per folder

Each folder in JustZix (the main rule-grouping unit) has an optional icon — max 3 chars, auto-UPPERCASE. The float btn shows the icon of the first matching folder (by URL prefix):

folder.icon = 'qa'      → label "QA"
folder.icon = 'dev'     → label "DEV"
folder.icon = '🐛'      → label "🐛" (emoji sliced to 3 chars)
folder.icon = (empty)   → label "ZIX" (default)

Idea: a power user has 5-10 folders per project, each with a different 3-letter marker. Seeing "QA" on the floating btn means QA rules are active. Visual feedback before any interaction.

4 visual states — colour + opacity

StateCSS classWhenLook
jz-onall matching folders enabledFull colourFolder accent colour (or default teal)
jz-mixedsome folders on, others offSemi-transparentFaded — signals "watch out, not everything active"
jz-offall matching folders disabledGreyLow contrast — "inactive"
jz-globally-offextension globally disabledReddish / loud"Whole extension off"

State auto-updates on storage onChanged — toggle a rule anywhere (options page, popup widget, chrome context menu) → the float btn changes appearance immediately.

Anatomy of a click — popup widget

Left-click on the float btn → a popup widget opens next to it. The widget contains:

Click outside closes the popup (document-level event listener). Clicking a checkbox triggers setBarHidden / setCssPaneEnabled / setFolderEnabled — all chained via Promise to avoid race conditions.

Snap connections with bars and panes

The float btn participates in snap connections as a pseudo-element with the ID '__float'. Mechanics identical to panes:

  1. Drag the float btn close to an action bar (≤20px) → snap, the two elements = a group
  2. Drag any element of the group → the whole group moves together
  3. Right-click on the float btn → context menu with "Disconnect from X" options

Use case: floating btn as an "anchor handle" for the entire group. Bars + Output Console snapped to the float btn → drag the float btn = you move the whole dashboard.

Right-click = context menu

Same mechanism as for bars / CSS panes — context menu per element. Float btn has:

No font/size — the float btn is fixed-size (32×32px). No text to customise besides the 3-letter label (which comes from folder.icon).

Use case 1 — Visual scope indicator

You have 3 folders: "ALL" (works everywhere), "GHB" (only github), "GMA" (only gmail). Each with a different colour (green, black, red) and 3-letter icon. Visit github.com → float btn shows black "GHB". Visit gmail.com → red "GMA". Without checking the popup widget you see the scope.

Use case 2 — Quick global pause

Skype call, demoing a new feature to someone in production, JustZix might get in the way. Click float btn → "Global pause" toggle → the extension deactivates all rules. After the demo → click again → enabled. Without going into chrome://extensions.

Use case 3 — Per-page hide until reload

The "Force dark mode" rule also matches your bank's site — which already has its own dark mode. The float btn covers the bank's logo. Right-click on float btn → "Hide until reload" → float btn disappears only on this tab, until F5. The rules still run, only the UI is hidden.

Use case 4 — Position per domain

The float btn's position is persistent in chrome.storage.sync. Default in the bottom-right (BR anchor). Drag → save → next visit to that domain returns it where you left it. Position is per-element-id, but all pages share id '__float' — so the position is global across domains. If you want per-page → use snap with a bar that is scope-specific.

Pitfalls

What's next

Float btn is the "entry point" for the whole JustZix UI — all other elements (bars, panes) are more contextual. Check also:

Install JustZix — the float btn will appear by itself as soon as you add your first rule.

Rate this post

No ratings yet — be the first.

Try it yourself

Install JustZix and paste any snippet from this article. Two minutes from zero to a working rule across all your devices.

Get JustZix

Features · How it works · Examples · Use cases