# Help4 Admin Workspace UI

Use this opt-in component family for staff-facing editors, calendars, queues, libraries, and operational dashboards. It is deliberately scoped to `.h4bs-workspace`; it does not restyle WordPress core screens.

## Load the shared stylesheet

The plugin registers `h4bs-admin-workspace` on every wp-admin request and automatically enqueues it for Help4 screens. A site-specific Help4 extension may opt in with:

```php
wp_enqueue_style('h4bs-admin-workspace');
```

## Required screen anatomy

1. Masthead: one task-oriented title, one sentence of context, no competing headings, and no more than three primary actions.
2. Status bar: connection or save state, last synchronization/update time, and a human-readable recovery instruction when degraded.
3. Metrics: optional and operational only. Never add decorative or vanity counts.
4. Command bar: search first, then a short set of mutually exclusive filters with `aria-pressed`.
5. Content: rows or a table for collection workflows; do not convert dense operational data into a card grid.
6. Editor: main form plus a narrow status/preview panel. Source-owned fields must read as source-owned; local overrides must read as optional.

## Staff workflow rules

- Use plain verbs: Add event, Edit display, Hide from website, Sync now, Preview.
- Keep the most common task in the first viewport.
- Make destructive and publishing actions visually distinct and never adjacent without spacing.
- Persist filters only when the user can visibly reset them.
- Provide an empty state that explains whether no records exist or filters removed them.
- Use native labels, field help, live status regions, keyboard-accessible controls, 44px touch targets, and visible focus.
- At 782px and below, rows become two-column summaries and secondary controls stack below the title rather than squeezing or overflowing.

## Calendar mapping

- Masthead actions: Add website event, Sync Google Calendar, View public calendar.
- Status bar: Google feed connected/degraded, last sync, next scheduled sync.
- Metrics: Visible, Hidden, Google, Website-only.
- Filters: All, Visible, Hidden, Google, Website-only, then category if necessary.
- Row: date tile, title and time/location, source badge, website visibility, Edit display.
- Editor: Google-owned values shown read-only; website title/description/category/button are explicit overrides; hide control is prominent and reversible.

Do not expose the default WordPress post list as the primary staff calendar interface. Keep it available only as an advanced recovery route for administrators.

## Register a site workspace

Register the real child page under `h4bs-settings` with WordPress first. Use a site-owned slug such as `bp-calendar-workspace`; capability checks remain authoritative for both the menu and direct route. Simplified staff mode automatically preserves capability-authorized child pages whose slugs do not use Help4's reserved `h4bs-` prefix.

Add a Work Home card with `h4bs_staff_workspaces`:

```php
add_filter('h4bs_staff_workspaces', static function (array $workspaces): array {
    $workspaces[] = [
        'slug' => 'bp-calendar-workspace',
        'label' => __('Calendar workspace', 'barclay-child'),
        'description' => __('Search events, review sync status, and edit website display.', 'barclay-child'),
        'capability' => 'edit_pages',
        'icon' => 'dashicons-calendar-alt',
        'priority' => 30,
    ];
    return $workspaces;
});
```

The descriptor does not create or authorize the page. The matching `add_submenu_page()` registration and its capability still control access. Optional descriptor keys are `url`, `icon`, and `priority`.

Extensions that intentionally use an `h4bs-*` slug must opt in with `h4bs_staff_workspaces` or append the slug through `h4bs_staff_menu_keep_slugs`. The latter preserves menu/direct-route visibility only; use `h4bs_staff_workspaces` when staff should also see a clear Work Home card. Core advanced Help4 tools remain hidden until an administrator enables advanced tools for their own account.
