Skip to content

Commit 77c3cd3

Browse files
authored
Improve getting started Coder CTA (#5752)
* Improve getting started Coder CTA This wasn't very standout-ish before, and I think it's wise for us to experiment with directing users to Coder. * Update nix flake * Update diff * Add advert to code-server install * Fix patch to reset columns if getting started is disabled * Update text for advert
1 parent ff8ea36 commit 77c3cd3

File tree

5 files changed

+113
-31
lines changed

5 files changed

+113
-31
lines changed

flake.nix

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
in {
1313
devShells.default = pkgs.mkShell {
1414
nativeBuildInputs = with pkgs; [
15-
nodejs yarn' python pkg-config git rsync jq moreutils
15+
nodejs yarn' python pkg-config git rsync jq moreutils quilt bats
1616
];
1717
buildInputs = with pkgs; (lib.optionals (!stdenv.isDarwin) [ libsecret ]
1818
++ (with xorg; [ libX11 libxkbfile ])
19-
++ lib.optionals stdenv.isDarwin [
20-
AppKit Cocoa CoreServices Security cctools xcbuild
21-
]);
19+
++ lib.optionals stdenv.isDarwin (with pkgs.darwin.apple_sdk.frameworks; [
20+
AppKit Cocoa CoreServices Security xcbuild
21+
]));
2222
};
2323
}
2424
);

install.sh

+8
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@ Or, if you don't want/need a background service you can run:
131131
EOF
132132
}
133133

134+
echo_coder_postinstall() {
135+
echoh
136+
echoh "Deploy code-server for your team with Coder: https://github.com/coder/coder"
137+
}
138+
134139
main() {
135140
if [ "${TRACE-}" ]; then
136141
set -x
@@ -243,6 +248,7 @@ main() {
243248
if [ "$METHOD" = standalone ]; then
244249
if has_standalone; then
245250
install_standalone
251+
echo_coder_postinstall
246252
exit 0
247253
else
248254
echoerr "There are no standalone releases for $ARCH"
@@ -286,6 +292,8 @@ main() {
286292
npm_fallback install_standalone
287293
;;
288294
esac
295+
296+
echo_coder_postinstall
289297
}
290298

291299
parse_arg() {

patches/getting-started.diff

+92-18
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
1010
===================================================================
1111
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.ts
1212
+++ code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.ts
13-
@@ -62,7 +62,7 @@ import { GettingStartedIndexList } from
13+
@@ -62,7 +62,7 @@ import { GettingStartedIndexList } from
1414
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
1515
import { KeyCode } from 'vs/base/common/keyCodes';
1616
import { getTelemetryLevel } from 'vs/platform/telemetry/common/telemetryUtils';
@@ -19,32 +19,106 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
1919
import { OpenFolderViaWorkspaceAction } from 'vs/workbench/browser/actions/workspaceActions';
2020
import { OpenRecentAction } from 'vs/workbench/browser/actions/windowActions';
2121
import { Toggle } from 'vs/base/browser/ui/toggle/toggle';
22-
@@ -753,11 +753,24 @@ export class GettingStartedPage extends
23-
onShowOnStartupChanged();
24-
}));
25-
26-
- const header = $('.header', {},
27-
+ let header = $('.header', {},
28-
$('h1.product-name.caption', {}, this.productService.nameLong),
22+
@@ -758,6 +758,72 @@ export class GettingStartedPage extends
2923
$('p.subtitle.description', {}, localize({ key: 'gettingStarted.editingEvolved', comment: ['Shown as subtitle on the Welcome page.'] }, "Editing evolved"))
3024
);
3125

26+
+ let gettingStartedCoder: HTMLElement = $('.header', {});
3227
+ if (this.contextService.contextMatchesRules(IsEnabledCoderGettingStarted)) {
33-
+ header = $('.header', {},
34-
+ $('h1.product-name.caption', {}, this.productService.nameLong),
35-
+ $('p.subtitle.description.coder', {},
36-
+ "Using code-server on a team?",
37-
+ ),
38-
+ $('p.subtitle.description.coder-coder', {},
39-
+ "Check out: ",
40-
+ $('a', { href: "https://github.com/coder/coder" }, "coder/coder")
41-
+ ),
42-
+ );
28+
+ gettingStartedCoder = $('.gettingStartedCategory', {},
29+
+ $('h2', {
30+
+ style: 'margin-bottom: 12px',
31+
+ }, 'Next Up'),
32+
+ $('a', {
33+
+ href: 'https://cdr.co/code-server-to-coder',
34+
+ target: '_blank',
35+
+ },
36+
+ $('button', {
37+
+ style: [
38+
+ 'padding: 10px 16px ',
39+
+ 'border-radius: 4px',
40+
+ 'background: linear-gradient(94.04deg, #7934DA 0%, #4D52E0 101.2%)',
41+
+ 'color: white',
42+
+ 'overflow: hidden',
43+
+ 'margin-right: 14px',
44+
+ ].join(';'),
45+
+ },
46+
+ $('h3', {
47+
+ style: [
48+
+ 'margin: 0px 0px 6px',
49+
+ 'font-weight: 500',
50+
+ ].join(';'),
51+
+ }, 'Deploy code-server for your team'),
52+
+ $('p', {
53+
+ style: [
54+
+ 'margin: 0',
55+
+ 'font-size: 13px',
56+
+ 'color: #dcdee2',
57+
+ ].join(';'),
58+
+ }, 'Provision remote development environments on your infrastructure with Coder.'),
59+
+ $('p', {
60+
+ style: [
61+
+ 'margin-top: 8px',
62+
+ 'font-size: 13px',
63+
+ 'color: #dcdee2',
64+
+ ].join(';'),
65+
+ }, 'Coder is a self-service portal which provisions via Terraform—Linux, macOS, Windows, x86, ARM, and, of course, Kubernetes based infrastructure.'),
66+
+ $('p', {
67+
+ style: [
68+
+ 'margin: 0',
69+
+ 'margin-top: 8px',
70+
+ 'font-size: 13px',
71+
+ 'display: flex',
72+
+ 'align-items: center',
73+
+ ].join(';'),
74+
+ }, 'Get started ', $('span', {
75+
+ class: Codicon.arrowRight.classNames,
76+
+ style: [
77+
+ 'color: white',
78+
+ 'margin-left: 8px',
79+
+ ].join(';'),
80+
+ })),
81+
+ $('img', {
82+
+ src: './_static/src/browser/media/templates.png',
83+
+ style: [
84+
+ 'margin-bottom: -65px',
85+
+ ].join(';'),
86+
+ }),
87+
+ ),
88+
+ ),
89+
+ );
4390
+ }
4491
+
4592

4693
const leftColumn = $('.categories-column.categories-column-left', {},);
4794
const rightColumn = $('.categories-column.categories-column-right', {},);
95+
@@ -775,13 +841,23 @@ export class GettingStartedPage extends
96+
const layoutLists = () => {
97+
if (gettingStartedList.itemCount) {
98+
this.container.classList.remove('noWalkthroughs');
99+
- reset(leftColumn, startList.getDomElement(), recentList.getDomElement());
100+
- reset(rightColumn, gettingStartedList.getDomElement());
101+
+ if (this.contextService.contextMatchesRules(IsEnabledCoderGettingStarted)) {
102+
+ reset(leftColumn, startList.getDomElement(), recentList.getDomElement(), gettingStartedList.getDomElement());
103+
+ reset(rightColumn, gettingStartedCoder);
104+
+ } else {
105+
+ reset(leftColumn, startList.getDomElement(), recentList.getDomElement());
106+
+ reset(rightColumn, gettingStartedList.getDomElement());
107+
+ }
108+
+
109+
recentList.setLimit(5);
110+
}
111+
else {
112+
this.container.classList.add('noWalkthroughs');
113+
- reset(leftColumn, startList.getDomElement());
114+
+ if (this.contextService.contextMatchesRules(IsEnabledCoderGettingStarted)) {
115+
+ reset(leftColumn, startList.getDomElement(), gettingStartedCoder);
116+
+ } else {
117+
+ reset(leftColumn, startList.getDomElement());
118+
+ }
119+
reset(rightColumn, recentList.getDomElement());
120+
recentList.setLimit(10);
121+
}
48122
Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/media/gettingStarted.css
49123
===================================================================
50124
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/media/gettingStarted.css

src/browser/media/templates.png

45.7 KB
Loading

test/scripts/install.bats

+9-9
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ function should-use-deb() {
1111
DISTRO=$1 ARCH=$2 OS=linux run "$SCRIPT" --dry-run
1212
[ "$status" -eq 0 ]
1313
[ "${lines[1]}" = "Installing v$VERSION of the $2 deb package from GitHub." ]
14-
[ "${lines[-5]}" = "deb package has been installed." ]
14+
[ "${lines[-6]}" = "deb package has been installed." ]
1515
}
1616

1717
function should-use-rpm() {
1818
DISTRO=$1 ARCH=$2 OS=linux run "$SCRIPT" --dry-run
1919
[ "$status" -eq 0 ]
2020
[ "${lines[1]}" = "Installing v$VERSION of the $2 rpm package from GitHub." ]
21-
[ "${lines[-5]}" = "rpm package has been installed." ]
21+
[ "${lines[-6]}" = "rpm package has been installed." ]
2222
}
2323

2424
function should-fallback-npm() {
@@ -27,21 +27,21 @@ function should-fallback-npm() {
2727
[ "${lines[1]}" = "No standalone releases for $2." ]
2828
[ "${lines[2]}" = "Falling back to installation from npm." ]
2929
[ "${lines[3]}" = "Installing latest from npm." ]
30-
[ "${lines[-5]}" = "npm package has been installed." ]
30+
[ "${lines[-6]}" = "npm package has been installed." ]
3131
}
3232

3333
function should-use-npm() {
3434
YARN_PATH=true DISTRO=$1 ARCH=$2 OS=linux run "$SCRIPT" --dry-run
3535
[ "$status" -eq 0 ]
3636
[ "${lines[1]}" = "Installing latest from npm." ]
37-
[ "${lines[-5]}" = "npm package has been installed." ]
37+
[ "${lines[-6]}" = "npm package has been installed." ]
3838
}
3939

4040
function should-use-aur() {
4141
DISTRO=$1 ARCH=$2 OS=linux run "$SCRIPT" --dry-run
4242
[ "$status" -eq 0 ]
4343
[ "${lines[1]}" = "Installing latest from the AUR." ]
44-
[ "${lines[-5]}" = "AUR package has been installed." ]
44+
[ "${lines[-6]}" = "AUR package has been installed." ]
4545
}
4646

4747
function should-fallback-npm-brew() {
@@ -52,21 +52,21 @@ function should-fallback-npm-brew() {
5252
[ "${lines[3]}" = "No standalone releases for $1." ]
5353
[ "${lines[4]}" = "Falling back to installation from npm." ]
5454
[ "${lines[5]}" = "Installing latest from npm." ]
55-
[ "${lines[-5]}" = "npm package has been installed." ]
55+
[ "${lines[-6]}" = "npm package has been installed." ]
5656
}
5757

5858
function should-use-brew() {
5959
BREW_PATH=true OS=macos ARCH=$1 run "$SCRIPT" --dry-run
6060
[ "$status" -eq 0 ]
6161
[ "${lines[1]}" = "Installing latest from Homebrew." ]
62-
[ "${lines[-3]}" = "Brew release has been installed." ]
62+
[ "${lines[-4]}" = "Brew release has been installed." ]
6363
}
6464

6565
function should-use-standalone() {
6666
DISTRO=$1 ARCH=$2 OS=$3 run "$SCRIPT" --method standalone --dry-run
6767
[ "$status" -eq 0 ]
6868
[ "${lines[1]}" = "Installing v$VERSION of the $2 release from GitHub." ]
69-
[[ "${lines[-5]}" = "Standalone release has been installed"* ]]
69+
[[ "${lines[-6]}" = "Standalone release has been installed"* ]]
7070
}
7171

7272
@test "$SCRIPT_NAME: usage with --help" {
@@ -141,7 +141,7 @@ function should-use-standalone() {
141141
[ "${lines[1]}" = "Homebrew not installed." ]
142142
[ "${lines[2]}" = "Falling back to standalone installation." ]
143143
[ "${lines[3]}" = "Installing v$VERSION of the amd64 release from GitHub." ]
144-
[[ "${lines[-5]}" = "Standalone release has been installed"* ]]
144+
[[ "${lines[-6]}" = "Standalone release has been installed"* ]]
145145
}
146146
@test "$SCRIPT_NAME: macos i386 (no brew)" {
147147
should-fallback-npm-brew "i386"

0 commit comments

Comments
 (0)