Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Improve startup prompt after workspace loss https://github.com/siyuan-note/siyuan/issues/14748

Daniel4dd4aa4c7738
diff --git a/app/electron/init.html b/app/electron/init.html
index e5fe68a0d2..ab789d7ba9 100644
--- a/app/electron/init.html
+++ b/app/electron/init.html
@@ -4,264 +4,7 @@
<title>SiYuan</title>
<meta charset="UTF-8">
<meta name="color-scheme" content="light dark">
- <style>
- body {
- margin: 0;
- background-color: #fff;
- text-align: center;
- color: #222;
- font-size: 16px;
- font-family: BlinkMacSystemFont, Helvetica, "PingFang SC", "Luxi Sans", "DejaVu Sans", arial, "Microsoft Yahei", "Hiragino Sans GB", "Source Han Sans SC", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Twemoji Mozilla", "Android Emoji", "EmojiSymbols";
- }
-
- .fn__flex-column {
- display: flex;
- flex-direction: column;
- width: 100%;
- margin: 0 auto;
- min-height: 100vh;
- box-sizing: border-box;
- padding: 0 calc((100vw - 608px) * 0.3);
- }
-
- .fn__flex-1 {
- flex: 1;
- min-height: 32px;
- flex-shrink: 0;
- min-width: 8px;
- }
-
- h2 {
- margin: 0 0 16px 0;
- font-size: 28px;
- }
-
- .b3-select {
- border-radius: 6px;
- color: #222;
- height: 28px;
- width: 96px;
- border: 0;
- padding: 4px 26px 4px 8px;
- box-sizing: border-box;
- line-height: 20px;
- transition: box-shadow 120ms 0ms cubic-bezier(0, 0, 0.2, 1), background-color 0.2s cubic-bezier(0, 0, 0.2, 1) 0ms;
- font-size: 14px;
- box-shadow: inset 0 0 0 0.6px rgba(0, 0, 0, .6);
- background: url("data:image/svg+xml;utf8,<svg fill='rgba(0, 0, 0, .4)' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>") no-repeat right 2px center #fff;
- appearance: none;
- cursor: pointer;
- overflow: hidden;
- }
-
- .b3-select:focus {
- box-shadow: inset 0 0 0 1px #3575f0, 0 0 0 3px rgba(53, 117, 240, .12);
- }
-
- .b3-button {
- cursor: pointer;
- color: #fff;
- border-radius: 6px;
- line-height: 20px;
- padding: 4px 8px;
- background-color: #3575f0;
- white-space: nowrap;
- display: inline-flex;
- align-items: center;
- justify-content: center;
- transition: box-shadow 280ms ease;
- border: 0;
- box-sizing: border-box;
- text-align: center;
- width: 96px;
- }
-
- .b3-button:hover, .b3-button:focus {
- text-decoration: none;
- box-shadow: 0 1px 2px 0 rgb(0 0 0 / .3), 0 1px 3px 1px rgb(0 0 0 /.15);
- }
-
- .b3-button:active {
- box-shadow: 0 2px 3px 1px rgb(0 0 0 / .3), 0 2px 4px 2px rgb(0 0 0 /.15);
- }
-
- .b3-label {
- padding: 16px 24px 0;
- margin-bottom: 16px;
- display: flex;
- text-align: left;
- box-shadow: 0 15px 0 0 #fff, 0 16px 0 0 #e0e0e0;
- }
-
- .b3-label__text {
- color: rgba(0, 0, 0, .6);
- font-size: 14px;
- margin-top: 4px;
- overflow: hidden;
- line-height: 1.65;
- }
-
- .fn__flex-center {
- align-self: center;
- }
-
- .svg {
- position: fixed;
- right: 32px;
- top: 0;
- width: 13px;
- fill: rgba(0, 0, 0, .6);
- padding: 9.5px;
- cursor: pointer;
- z-index: 1;
- }
-
- .svg:hover {
- background: #dfe0e1;
- fill: #222;
- }
-
- #close {
- right: 0;
- width: 10px;
- padding: 11px 11px;
- }
-
- #close:hover {
- background-color: #d23f31;
- fill: #fff;
- }
-
- a {
- text-decoration: none;
- color: #3575f0;
- }
-
- a:hover {
- text-decoration: underline;
- }
-
- .fn__none {
- display: none !important;
- }
-
- .slogan {
- color: rgba(0, 0, 0, .6);
- font-size: 15px;
- }
-
- .notice {
- font-size: 14px;
- color: rgba(0, 0, 0, .6);
- }
-
- .icon {
- width: 96px;
- margin: 0 auto 16px;
- }
-
- kbd {
- font: 75% SFMono-Regular, Consolas, "Liberation Mono";
- line-height: 1;
- border-radius: 6px;
- padding: 2px 4px;
- color: rgba(0, 0, 0, .6);
- vertical-align: middle;
- background-color: #f6f6f6;
- border: solid 1px #e0e0e0;
- box-shadow: inset 0 -1px 0 #e0e0e0;
- }
-
- .feedback {
- display: flex;
- justify-content: space-around;
- font-size: 14px
- }
-
- .drag {
- -webkit-app-region: drag;
- height: 32px;
- cursor: pointer;
- position: fixed;
- top: 0;
- left: 0;
- right: 64px;
- }
-
- .darwin #min,
- .darwin #close {
- display: none;
- }
-
- .darwin .drag {
- right: 0;
- }
-
- @media (prefers-color-scheme: dark) {
- body {
- background-color: #1e1e1e;
- color: #dadada;
- }
-
- .b3-select {
- color: #dadada;
- box-shadow: inset 0 0 0 0.6px #9aa0a6;
- background: url("data:image/svg+xml;utf8,<svg fill='rgba(154, 160, 166, .68)' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>") no-repeat right 2px center #1e1e1e;
- }
-
- .b3-select:focus {
- box-shadow: inset 0 0 0 1px #3573f0, 0 0 0 3px rgba(53, 115, 240, .24);
- }
-
- .b3-button {
- background-color: #3573f0;
- }
-
- .b3-button:hover, .b3-button:focus {
- box-shadow: 0 1px 2px 0 rgb(0 0 0 / .3), 0 1px 3px 1px rgb(255 255 255 /.15);
- }
-
- .b3-button:active {
- box-shadow: 0 2px 3px 1px rgb(0 0 0 / .3), 0 2px 4px 2px rgb(255 255 255 /.15);
- }
-
- .b3-label {
- box-shadow: 0 15px 0 0 #1e1e1e, 0 16px 0 0 #363636;
- }
-
- .b3-label__text {
- color: #9aa0a6;
- }
-
- .svg {
- fill: #9aa0a6;
- }
-
- .svg:hover {
- background: rgba(255, 255, 255, .075);
- fill: #dadada;
- }
-
- a {
- color: #3573f0;
- }
-
- .slogan {
- color: #9aa0a6;
- }
-
- .notice {
- color: #9aa0a6;
- }
-
- kbd {
- color: #9aa0a6;
- background-color: #262626;
- border: solid 1px rgba(230, 230, 230, .06);
- box-shadow: inset 0 -1px 0 rgba(230, 230, 230, .06);
- }
- }
- </style>
+ <link rel="stylesheet" href="window.css">
</head>
<body>
<div id="layout" class="fn__flex-column">
diff --git a/app/electron/missing-workspace.html b/app/electron/missing-workspace.html
index 2379c5352d..8dbbd46092 100644
--- a/app/electron/missing-workspace.html
+++ b/app/electron/missing-workspace.html
@@ -4,16 +4,9 @@
<title>SiYuan</title>
<meta charset="UTF-8">
<meta name="color-scheme" content="light dark">
+ <link rel="stylesheet" href="window.css">
<style>
- body {
- margin: 0;
- background-color: #fff;
- text-align: center;
- color: #222;
- font-size: 16px;
- font-family: BlinkMacSystemFont, Helvetica, "PingFang SC", "Luxi Sans", "DejaVu Sans", arial, "Microsoft Yahei", "Hiragino Sans GB", "Source Han Sans SC", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Twemoji Mozilla", "Android Emoji", "EmojiSymbols";
- }
-
+ /* missing-workspace.html 独有样式,公共样式在 window.css 中 */
.layout {
display: flex;
min-height: 100vh;
@@ -68,84 +61,11 @@
line-height: 1.5;
}
- .fn__flex-column {
- display: flex;
- flex-direction: column;
- width: 100%;
- margin: 0 auto;
- min-height: 100vh;
- box-sizing: border-box;
- padding: 0 calc((100vw - 608px) * 0.3);
- }
-
.right {
flex: 1;
padding: 0 32px;
}
- .fn__flex-1 {
- flex: 1;
- min-height: 32px;
- flex-shrink: 0;
- min-width: 8px;
- }
-
- h2 {
- margin: 0 0 16px 0;
- font-size: 28px;
- }
-
- .b3-select {
- border-radius: 6px;
- color: #222;
- height: 28px;
- width: 96px;
- border: 0;
- padding: 4px 26px 4px 8px;
- box-sizing: border-box;
- line-height: 20px;
- transition: box-shadow 120ms 0ms cubic-bezier(0, 0, 0.2, 1), background-color 0.2s cubic-bezier(0, 0, 0.2, 1) 0ms;
- font-size: 14px;
- box-shadow: inset 0 0 0 0.6px rgba(0, 0, 0, .6);
- background: url("data:image/svg+xml;utf8,<svg fill='rgba(0, 0, 0, .4)' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>") no-repeat right 2px center #fff;
- appearance: none;
- cursor: pointer;
- overflow: hidden;
- flex-shrink: 0;
- }
-
- .b3-select:focus {
- box-shadow: inset 0 0 0 1px #3575f0, 0 0 0 3px rgba(53, 117, 240, .12);
- }
-
- .b3-button {
- cursor: pointer;
- color: #fff;
- border-radius: 6px;
- line-height: 20px;
- padding: 4px 8px;
- background-color: #3575f0;
- white-space: nowrap;
- display: inline-flex;
- align-items: center;
- justify-content: center;
- transition: box-shadow 280ms ease;
- border: 0;
- box-sizing: border-box;
- text-align: center;
- width: 96px;
- flex-shrink: 0;
- }
-
- .b3-button:hover, .b3-button:focus {
- text-decoration: none;
- box-shadow: 0 1px 2px 0 rgb(0 0 0 / .3), 0 1px 3px 1px rgb(0 0 0 /.15);
- }
-
- .b3-button:active {
- box-shadow: 0 2px 3px 1px rgb(0 0 0 / .3), 0 2px 4px 2px rgb(0 0 0 /.15);
- }
-
.ws-open {
width: auto;
padding: 2px 12px;
@@ -172,77 +92,6 @@
box-shadow: inset 0 0 0 0.6px rgba(0, 0, 0, .4);
}
- .b3-label {
- padding: 16px 24px 0;
- margin-bottom: 16px;
- display: flex;
- text-align: left;
- box-shadow: 0 15px 0 0 #fff, 0 16px 0 0 #e0e0e0;
- }
-
- .b3-label__text {
- color: rgba(0, 0, 0, .6);
- font-size: 14px;
- margin-top: 4px;
- overflow: hidden;
- line-height: 1.65;
- }
-
- .fn__flex-center {
- align-self: center;
- }
-
- .svg {
- position: fixed;
- right: 32px;
- top: 0;
- width: 13px;
- fill: rgba(0, 0, 0, .6);
- padding: 9.5px;
- cursor: pointer;
- z-index: 1;
- }
-
- .svg:hover {
- background: #dfe0e1;
- fill: #222;
- }
-
- #close {
- right: 0;
- width: 10px;
- padding: 11px 11px;
- }
-
- #close:hover {
- background-color: #d23f31;
- fill: #fff;
- }
-
- a {
- text-decoration: none;
- color: #3575f0;
- }
-
- a:hover {
- text-decoration: underline;
- }
-
- .fn__none {
- display: none !important;
- }
-
- .slogan {
- color: rgba(0, 0, 0, .6);
- font-size: 15px;
- }
-
- .notice {
- font-size: 14px;
- color: rgba(0, 0, 0, .6);
- text-align: center;
- }
-
.missing-tip {
font-size: 18px;
color: #222;
@@ -262,54 +111,7 @@
word-break: break-all;
}
- kbd {
- font: 75% SFMono-Regular, Consolas, "Liberation Mono";
- line-height: 1;
- border-radius: 6px;
- padding: 2px 4px;
- color: rgba(0, 0, 0, .6);
- vertical-align: middle;
- background-color: #f6f6f6;
- border: solid 1px #e0e0e0;
- box-shadow: inset 0 -1px 0 #e0e0e0;
- }
-
- .icon {
- width: 96px;
- margin: 0 auto 16px;
- }
-
- .feedback {
- display: flex;
- justify-content: space-around;
- font-size: 14px
- }
-
- .drag {
- -webkit-app-region: drag;
- height: 32px;
- cursor: pointer;
- position: fixed;
- top: 0;
- left: 0;
- right: 64px;
- }
-
- .darwin #min,
- .darwin #close {
- display: none;
- }
-
- .darwin .drag {
- right: 0;
- }
-
@media (prefers-color-scheme: dark) {
- body {
- background-color: #1e1e1e;
- color: #dadada;
- }
-
.wsPanel {
background-color: #2c2c2c;
border-right: 1px solid #363636;
@@ -331,18 +133,6 @@
color: #9aa0a6;
}
- .b3-button {
- background-color: #3573f0;
- }
-
- .b3-button:hover, .b3-button:focus {
- box-shadow: 0 1px 2px 0 rgb(0 0 0 / .3), 0 1px 3px 1px rgb(255 255 255 /.15);
- }
-
- .b3-button:active {
- box-shadow: 0 2px 3px 1px rgb(0 0 0 / .3), 0 2px 4px 2px rgb(255 255 255 /.15);
- }
-
.ws-open {
color: #9aa0a6;
background-color: transparent;
@@ -359,45 +149,6 @@
box-shadow: inset 0 0 0 0.6px rgba(255, 255, 255, .4);
}
- .b3-select {
- color: #dadada;
- box-shadow: inset 0 0 0 0.6px #9aa0a6;
- background: url("data:image/svg+xml;utf8,<svg fill='rgba(154, 160, 166, .68)' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>") no-repeat right 2px center #1e1e1e;
- }
-
- .b3-select:focus {
- box-shadow: inset 0 0 0 1px #3573f0, 0 0 0 3px rgba(53, 115, 240, .24);
- }
-
- .b3-label {
- box-shadow: 0 15px 0 0 #1e1e1e, 0 16px 0 0 #363636;
- }
-
- .b3-label__text {
- color: #9aa0a6;
- }
-
- .svg {
- fill: #9aa0a6;
- }
-
- .svg:hover {
- background: rgba(255, 255, 255, .075);
- fill: #dadada;
- }
-
- a {
- color: #3573f0;
- }
-
- .slogan {
- color: #9aa0a6;
- }
-
- .notice {
- color: #9aa0a6;
- }
-
.missing-tip {
color: #dadada;
}
@@ -405,13 +156,6 @@
.missing-path {
color: #9aa0a6;
}
-
- kbd {
- color: #9aa0a6;
- background-color: #262626;
- border: solid 1px rgba(230, 230, 230, .06);
- box-shadow: inset 0 -1px 0 rgba(230, 230, 230, .06);
- }
}
</style>
</head>
diff --git a/app/electron/window.css b/app/electron/window.css
new file mode 100644
index 0000000000..c25e1b9be2
--- /dev/null
+++ b/app/electron/window.css
@@ -0,0 +1,261 @@
+/* 桌面端 pre-boot 窗口(init.html / missing-workspace.html)共享样式 */
+
+body {
+ margin: 0;
+ background-color: #fff;
+ text-align: center;
+ color: #222;
+ font-size: 16px;
+ font-family: BlinkMacSystemFont, Helvetica, "PingFang SC", "Luxi Sans", "DejaVu Sans", arial, "Microsoft Yahei", "Hiragino Sans GB", "Source Han Sans SC", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Twemoji Mozilla", "Android Emoji", "EmojiSymbols";
+}
+
+.fn__flex-column {
+ display: flex;
+ flex-direction: column;
+ width: 100%;
+ margin: 0 auto;
+ min-height: 100vh;
+ box-sizing: border-box;
+ padding: 0 calc((100vw - 608px) * 0.3);
+}
+
+.fn__flex-1 {
+ flex: 1;
+ min-height: 32px;
+ flex-shrink: 0;
+ min-width: 8px;
+}
+
+h2 {
+ margin: 0 0 16px 0;
+ font-size: 28px;
+}
+
+.b3-select {
+ border-radius: 6px;
+ color: #222;
+ height: 28px;
+ width: 96px;
+ border: 0;
+ padding: 4px 26px 4px 8px;
+ box-sizing: border-box;
+ line-height: 20px;
+ transition: box-shadow 120ms 0ms cubic-bezier(0, 0, 0.2, 1), background-color 0.2s cubic-bezier(0, 0, 0.2, 1) 0ms;
+ font-size: 14px;
+ box-shadow: inset 0 0 0 0.6px rgba(0, 0, 0, .6);
+ background: url("data:image/svg+xml;utf8,<svg fill='rgba(0, 0, 0, .4)' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>") no-repeat right 2px center #fff;
+ appearance: none;
+ cursor: pointer;
+ overflow: hidden;
+ flex-shrink: 0;
+}
+
+.b3-select:focus {
+ box-shadow: inset 0 0 0 1px #3575f0, 0 0 0 3px rgba(53, 117, 240, .12);
+}
+
+.b3-button {
+ cursor: pointer;
+ color: #fff;
+ border-radius: 6px;
+ line-height: 20px;
+ padding: 4px 8px;
+ background-color: #3575f0;
+ white-space: nowrap;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ transition: box-shadow 280ms ease;
+ border: 0;
+ box-sizing: border-box;
+ text-align: center;
+ width: 96px;
+ flex-shrink: 0;
+}
+
+.b3-button:hover, .b3-button:focus {
+ text-decoration: none;
+ box-shadow: 0 1px 2px 0 rgb(0 0 0 / .3), 0 1px 3px 1px rgb(0 0 0 /.15);
+}
+
+.b3-button:active {
+ box-shadow: 0 2px 3px 1px rgb(0 0 0 / .3), 0 2px 4px 2px rgb(0 0 0 /.15);
+}
+
+.b3-label {
+ padding: 16px 24px 0;
+ margin-bottom: 16px;
+ display: flex;
+ text-align: left;
+ box-shadow: 0 15px 0 0 #fff, 0 16px 0 0 #e0e0e0;
+}
+
+.b3-label__text {
+ color: rgba(0, 0, 0, .6);
+ font-size: 14px;
+ margin-top: 4px;
+ overflow: hidden;
+ line-height: 1.65;
+}
+
+.fn__flex-center {
+ align-self: center;
+}
+
+.svg {
+ position: fixed;
+ right: 32px;
+ top: 0;
+ width: 13px;
+ fill: rgba(0, 0, 0, .6);
+ padding: 9.5px;
+ cursor: pointer;
+ z-index: 1;
+}
+
+.svg:hover {
+ background: #dfe0e1;
+ fill: #222;
+}
+
+#close {
+ right: 0;
+ width: 10px;
+ padding: 11px 11px;
+}
+
+#close:hover {
+ background-color: #d23f31;
+ fill: #fff;
+}
+
+a {
+ text-decoration: none;
+ color: #3575f0;
+}
+
+a:hover {
+ text-decoration: underline;
+}
+
+.fn__none {
+ display: none !important;
+}
+
+.slogan {
+ color: rgba(0, 0, 0, .6);
+ font-size: 15px;
+}
+
+.notice {
+ font-size: 14px;
+ color: rgba(0, 0, 0, .6);
+ text-align: center;
+}
+
+.icon {
+ width: 96px;
+ margin: 0 auto 16px;
+}
+
+kbd {
+ font: 75% SFMono-Regular, Consolas, "Liberation Mono";
+ line-height: 1;
+ border-radius: 6px;
+ padding: 2px 4px;
+ color: rgba(0, 0, 0, .6);
+ vertical-align: middle;
+ background-color: #f6f6f6;
+ border: solid 1px #e0e0e0;
+ box-shadow: inset 0 -1px 0 #e0e0e0;
+}
+
+.feedback {
+ display: flex;
+ justify-content: space-around;
+ font-size: 14px
+}
+
+.drag {
+ -webkit-app-region: drag;
+ height: 32px;
+ cursor: pointer;
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 64px;
+}
+
+.darwin #min,
+.darwin #close {
+ display: none;
+}
+
+.darwin .drag {
+ right: 0;
+}
+
+@media (prefers-color-scheme: dark) {
+ body {
+ background-color: #1e1e1e;
+ color: #dadada;
+ }
+
+ .b3-select {
+ color: #dadada;
+ box-shadow: inset 0 0 0 0.6px #9aa0a6;
+ background: url("data:image/svg+xml;utf8,<svg fill='rgba(154, 160, 166, .68)' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>") no-repeat right 2px center #1e1e1e;
+ }
+
+ .b3-select:focus {
+ box-shadow: inset 0 0 0 1px #3573f0, 0 0 0 3px rgba(53, 115, 240, .24);
+ }
+
+ .b3-button {
+ background-color: #3573f0;
+ }
+
+ .b3-button:hover, .b3-button:focus {
+ box-shadow: 0 1px 2px 0 rgb(0 0 0 / .3), 0 1px 3px 1px rgb(255 255 255 /.15);
+ }
+
+ .b3-button:active {
+ box-shadow: 0 2px 3px 1px rgb(0 0 0 / .3), 0 2px 4px 2px rgb(255 255 255 /.15);
+ }
+
+ .b3-label {
+ box-shadow: 0 15px 0 0 #1e1e1e, 0 16px 0 0 #363636;
+ }
+
+ .b3-label__text {
+ color: #9aa0a6;
+ }
+
+ .svg {
+ fill: #9aa0a6;
+ }
+
+ .svg:hover {
+ background: rgba(255, 255, 255, .075);
+ fill: #dadada;
+ }
+
+ a {
+ color: #3573f0;
+ }
+
+ .slogan {
+ color: #9aa0a6;
+ }
+
+ .notice {
+ color: #9aa0a6;
+ }
+
+ kbd {
+ color: #9aa0a6;
+ background-color: #262626;
+ border: solid 1px rgba(230, 230, 230, .06);
+ box-shadow: inset 0 -1px 0 rgba(230, 230, 230, .06);
+ }
+}