Server logic for the modBrowse collection browsing module. Manages collection selection, artwork filtering, sorting, and card display. Designed to be embedded in `appPlatform` via `shiny::moduleServer()`.
The server coordinates: - Collection selection with artwork counts - Multi-criteria filtering (NFT, prints, variants, listed) - Sort controls (date, strokes, time) - Responsive filter synchronization between desktop/mobile views - Collection statistics via [enhancedStatsServer()]
Arguments
- id
Character. Shiny namespace ID for the module instance. Used by [shiny::NS()] to create unique element IDs. When embedding multiple browse instances in the same app (rare), use distinct IDs to prevent conflicts. Typically set to `"browse"` in production.
- r
Reactive list from parent app containing artist context:
- `r$artist`
Character. Artist UUID (format: `746bxxxx-...`). Set by parent app artist selection.
- `r$artwork`
Character. Currently selected artwork UUID. Updated by module when user clicks artwork card.
- `r$appdata`
List. Complete artist context from [artutils::get_appdata()]. Contains:
- `artist$info`
Artist profile data.
- `artist$collections`
Named vector of collection UUIDs.
- `artist$artDT`
data.table of all artworks with metadata.
Value
Invisible NULL. Called for side effects (Shiny server registration). The module updates `r$artwork` when user selects artwork cards.
See also
* [modBrowseUI()] for the corresponding UI function * [enhancedStatsUI()] and [enhancedStatsServer()] for statistics display * [artDisplayCard()] for card rendering
Other browse-core:
modBrowseUI()
Examples
if (FALSE) { # \dontrun{
server <- function(input, output, session) {
r <- reactiveValues(artist = "746b8207-72f5-4ab6-8d19-a91d03daec3d")
observe({
r$appdata <- artutils::get_appdata(r$artist, r$artwork)
})
modBrowseServer("browse", r)
}
} # }
