forge
Explore
Log in

Don't you dare go Hollow

Runner register command reads one flag per line and the branch sheet gets a backdrop

Browse files at this commit

a39364b61236fd7037afc4d5b1ec63ac1501e9aeAhmet Kaan GümüşParent: 20b2c50
  • style
    • runner register command reads one flag per line and the branch sheet gets a backdrop
Show full message
💄 style: runner register command reads one flag per line and the branch sheet gets a backdrop

The register command is shown one flag per line with shell line
continuations, so it reads well and still pastes as one command. Its
Copy button copies the same text, since the code box keeps newlines.

On phones the branch switcher sheet casts the popover's shadow on its
top edge and dims the page behind it. Its filter, tabs and note keep
the 16px side gutter.
crates/forge-web/src/pages/admin_runners.rsmodified+6 -5
@@ -264,10 +264,11 @@ fn back_to_list(notice: &str) -> SeeOther {
264 see_other(format!("/admin/runners?notice={}", enc(notice)))264 see_other(format!("/admin/runners?notice={}", enc(notice)))
265 }265 }
266 266
267-/// The command a new runner runs. The base URL comes from the server config.267+/// The command a new runner runs, one flag per line with shell line continuations so it reads well
268+/// and still pastes as a single command. The base URL comes from the server config.
268 fn register_command(base_url: &str, token: &str) -> String {269 fn register_command(base_url: &str, token: &str) -> String {
269 format!(270 format!(
270- "forge runner register --url {} --token {token} --name <name> --labels linux,x86_64 --config ~/.config/forge-runner/runner.toml",271+ "forge runner register \\\n --url {} \\\n --token {token} \\\n --name <name> \\\n --labels linux,x86_64 \\\n --config ~/.config/forge-runner/runner.toml",
271 base_url.trim_end_matches('/')272 base_url.trim_end_matches('/')
272 )273 )
273 }274 }
@@ -1523,7 +1524,7 @@ mod tests {
1523 let cmd = register_command("https://forge.example/", "tok123");1524 let cmd = register_command("https://forge.example/", "tok123");
1524 assert_eq!(1525 assert_eq!(
1525 cmd,1526 cmd,
1526- "forge runner register --url https://forge.example --token tok123 --name <name> --labels linux,x86_64 --config ~/.config/forge-runner/runner.toml"1527+ "forge runner register \\\n --url https://forge.example \\\n --token tok123 \\\n --name <name> \\\n --labels linux,x86_64 \\\n --config ~/.config/forge-runner/runner.toml"
1527 );1528 );
1528 }1529 }
1529 1530
@@ -1623,9 +1624,9 @@ mod tests {
1623 .await;1624 .await;
1624 assert_eq!(status, 200);1625 assert_eq!(status, 200);
1625 let token = token_from(&created);1626 let token = token_from(&created);
1626- assert!(created.contains("forge runner register --url"));1627+ assert!(created.contains("forge runner register \\\n --url"));
1627 assert!(1628 assert!(
1628- created.contains("--name &lt;name&gt; --labels linux,x86_64 --config ~/.config/forge-runner/runner.toml"),1629+ created.contains("--name &lt;name&gt; \\\n --labels linux,x86_64 \\\n --config ~/.config/forge-runner/runner.toml"),
1629 "placeholder is escaped"1630 "placeholder is escaped"
1630 );1631 );
1631 assert_eq!(1632 assert_eq!(
style/main.scssmodified+11 -0
@@ -1942,6 +1942,17 @@ code {
1942 max-width: none;1942 max-width: none;
1943 max-height: 75vh;1943 max-height: 75vh;
1944 border-radius: var(--radius-lg) var(--radius-lg) 0 0;1944 border-radius: var(--radius-lg) var(--radius-lg) 0 0;
1945+ // The top edge casts the same shadow as the desktop popover; the huge spread dims the page
1946+ // behind the sheet while it is open. Clicks outside still close it through the dropdown handler.
1947+ box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12), 0 0 0 100vmax rgba(0, 0, 0, 0.4);
1948+ }
1949+
1950+ .ref-top {
1951+ padding: 8px 16px;
1952+ }
1953+
1954+ .ref-note {
1955+ margin: 8px 16px;
1945 }1956 }
1946 1957
1947 .ref-filter {1958 .ref-filter {