subspace-dashboard 0.10.1

Subspace Framework board kit: the Dashboard trait, shared widgets and design tokens. Internal crate; apps depend on `subspace-framework`.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Build GitHub navigation without knowing the responding board's identity.

use subspace_contracts::github::{OpenPullRequest, recognition::PullRequestLink};

use crate::BoardNavigation;

/// A requester declares `Declaration::requests::<OpenPullRequest>()`, then
/// emits `DashboardEvent::Navigate` with this value. With no running responder
/// the shell does nothing. Malformed or unsupported URLs produce no navigation.
// qual:api - Consumed by app crates through the Framework facade.
pub fn pull_request_navigation(url: &str) -> Option<BoardNavigation> {
    let link = PullRequestLink::parse(url)?;
    Some(BoardNavigation {
        responder: super::MessageKey::request::<OpenPullRequest>(),
        url: link.url().into(),
        origin: None,
    })
}