# `MishkaDocument.WorkspaceScope`
[🔗](https://github.com/mishka-group/mishka_document/blob/v0.0.1/lib/mishka_document/workspace_scope.ex#L5)

Which workspaces the admin list shows: one row per document, not one per translation.

The rule and the reasoning are `MishkaCmsCore.LanguageEditions`', which every translatable admin list
shares. What is workspace-specific is what an edition chip reads: a variant is itself a workspace, so
its progress lives on its own `health_metrics`, and that has to be asked for through the variant
relationship — which the table's `preload` DSL cannot express, since it takes a name rather than a
nested load.

See `MishkaDocument.Workspace`, which declares both sibling relationships, and
`MishkaDocumentWeb.Templates.DocumentCard`, which draws the chips.

# `load_edition_progress`

```elixir
@spec load_edition_progress(Ash.Query.t(), map()) :: Ash.Query.t()
```

Loads how far along each of a workspace's sibling editions is, so a chip can read `FA · 76%`.

# `scope_to_masters`

```elixir
@spec scope_to_masters(Ash.Query.t(), map()) :: Ash.Query.t()
```

Narrows the list to master editions while it is collapsed — see
`MishkaCmsCore.LanguageEditions.collapsed?/1`.

The `on_load` contract is `fn query, state -> query`.

# `searching?`

```elixir
@spec searching?(map()) :: boolean()
```

Whether the table is currently showing search results.

# `shown?`

```elixir
@spec shown?(map(), :active | :archived, String.t()) :: boolean()
```

Whether a table action is drawn: the table shows `status` records (`:active` or `:archived`) and
its viewer holds `permission`. For a Gervaz `visible` function.

    visible fn _record, state ->
      MishkaDocument.WorkspaceScope.shown?(state, :active, "admin:dashboard:document:workspace")
    end

---

*Consult [api-reference.md](api-reference.md) for complete listing*
