Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ npm run desktop:test # 构建后执行桌面集成测试

正式对外发布 macOS 应用还需要配置开发者签名和 Apple 公证;仓库默认可生成本机测试包。Windows 签名同样需要自行提供证书。

图标源文件为 `apps/desktop/assets/icon.svg`。修改后运行 `npm run icons:generate`,生成桌面 PNG 和网页 favicon,并一起提交派生资源。`npm run icons:check` 检查资源是否同步,根构建和桌面构建也会执行此检查。

## AI 提交信息与设置中心

“设置”打开独立页面,统一管理 AI 服务商、提交生成、布局和版本更新;“返回工作区”恢复原仓库、面板和提交草稿。桌面窗口支持缩小到 320 px,窄窗口通过分类选择和服务商列表逐级进入详情。
Expand Down
Binary file modified apps/desktop/assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 16 additions & 18 deletions apps/desktop/assets/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion apps/desktop/electron-builder.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
artifactName: 'RemoteGit-${version}-${os}-${arch}.${ext}',
publish: { provider: 'github', owner: 'ShaoClean', repo: 'remote-git', private: false, releaseType: 'release' },
directories: { output: '../../release' },
files: ['*.cjs', 'server/**/*', 'web/**/*', 'packages/**/*', 'package.json'],
files: ['*.cjs', 'server/**/*', 'web/**/*', 'assets/icon.png', 'packages/**/*', 'package.json'],
asar: true,
asarUnpack: ['**/*.node'],
npmRebuild: false,
Expand Down
1 change: 1 addition & 0 deletions apps/desktop/scripts/stage.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ await mkdir(target, { recursive: true });
for (const [source, destination] of [
['apps/server/dist', 'server'],
['apps/web/dist', 'web'],
['apps/desktop/assets', 'assets'],
['packages/shared/dist', 'packages/shared/dist'],
['packages/ssh-client/dist', 'packages/ssh-client/dist'],
]) {
Expand Down
3 changes: 3 additions & 0 deletions apps/desktop/src/main.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ let updates;
let closingBackend;
const token = randomBytes(32).toString('hex');
const windowStatePath = path.join(app.getPath('userData'), 'window.json');
const iconPath = path.join(__dirname, 'assets', 'icon.png');

function createWindow() {
let state = {};
try { state = JSON.parse(readFileSync(windowStatePath, 'utf8')); } catch {}
window = new BrowserWindow({
title: 'RemoteGit',
icon: iconPath,
width: Number.isFinite(state.width) ? Math.max(320, Math.min(state.width, 3840)) : 1440,
height: Number.isFinite(state.height) ? Math.max(680, Math.min(state.height, 2160)) : 900,
minWidth: 320,
Expand Down Expand Up @@ -67,6 +69,7 @@ function createWindow() {
}

async function start() {
if (process.platform === 'darwin') app.dock.setIcon(iconPath);
const dataDir = app.getPath('userData');
mkdirSync(dataDir, { recursive: true, mode: 0o700 });
process.env.REMOTE_GIT_DATA_DIR = dataDir;
Expand Down
21 changes: 20 additions & 1 deletion apps/web/public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions apps/web/src/components/BrandIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/** The favicon and every in-app brand mark share the generated compact artwork. */
export function BrandIcon({ className = 'app-brand__mark' }: { className?: string }) {
return (
<img
className={className}
src="/favicon.svg"
alt=""
aria-hidden="true"
width={34}
height={34}
draggable={false}
/>
);
}
10 changes: 3 additions & 7 deletions apps/web/src/components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Button, Dropdown, Tooltip, message, notification } from 'antd';
import {
ApartmentOutlined,
CloudSyncOutlined,
CodeOutlined,
FolderOpenOutlined,
MenuFoldOutlined,
MenuUnfoldOutlined,
Expand All @@ -22,6 +21,7 @@ import { useWorkspaceStorageStatus } from '../stores/workspaceStorage';
import { useWorkspaceLayout } from '../hooks/useWorkspaceLayout';
import { PanelResizeHandle } from './PanelResizeHandle';
import { SettingsCenter } from './settings/SettingsCenter';
import { BrandIcon } from './BrandIcon';
import { SIDEBAR_MIN } from '../stores/workspaceLayout';

const navItems = [
Expand Down Expand Up @@ -227,9 +227,7 @@ export function Layout() {
aria-label="RemoteGit 首页"
onClick={() => navigate('/')}
>
<span className="app-brand__mark">
<CodeOutlined />
</span>
<BrandIcon />
<span className="app-brand__text">RemoteGit</span>
</button>
<Button
Expand Down Expand Up @@ -323,9 +321,7 @@ export function Layout() {
</Tooltip>
</div>
<div className="sidebar-footer__account">
<span className="sidebar-footer__avatar">
<CodeOutlined />
</span>
<BrandIcon className="sidebar-footer__avatar" />
<div className="sidebar-footer__account-copy">
<strong>RemoteGit</strong>
<span>工作区就绪</span>
Expand Down
6 changes: 2 additions & 4 deletions apps/web/src/components/settings/SettingsCenter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Alert, Button } from 'antd';
import {
ApartmentOutlined,
ArrowLeftOutlined,
CodeOutlined,
DesktopOutlined,
LayoutOutlined,
ReloadOutlined,
Expand All @@ -17,6 +16,7 @@ import { CommitSettings } from './CommitSettings';
import { LayoutSettingsContent } from '../LayoutSettings';
import { UpdatePanelContent } from '../UpdatePanel';
import { Sparkles } from '../Sparkles';
import { BrandIcon } from '../BrandIcon';
import '../../settings.css';

const categories = [
Expand Down Expand Up @@ -49,9 +49,7 @@ export function SettingsCenter({
<div className="settings-center">
<header className="settings-header">
<div className="settings-brand">
<span className="app-brand__mark">
<CodeOutlined />
</span>
<BrandIcon />
<strong>RemoteGit</strong>
</div>
<div className="settings-header__bar">
Expand Down
20 changes: 4 additions & 16 deletions apps/web/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -597,17 +597,11 @@ body,
}

.app-brand__mark {
display: grid;
display: block;
flex: 0 0 auto;
place-items: center;
width: 34px;
height: 34px;
color: #fff;
background: linear-gradient(145deg, #4b83f1 0%, #2563eb 100%);
border: 1px solid rgb(37 99 235 / 20%);
border-radius: 9px;
font-size: 16px;
box-shadow: 0 6px 16px rgb(37 99 235 / 30%), inset 0 1px rgb(255 255 255 / 18%);
object-fit: contain;
}

.app-brand__text {
Expand Down Expand Up @@ -934,17 +928,11 @@ body,
}

.sidebar-footer__avatar {
display: grid;
display: block;
flex: 0 0 auto;
place-items: center;
width: 28px;
height: 28px;
color: #dce8ff;
background: linear-gradient(145deg, #477bd0, #2b579c);
border: 1px solid rgb(37 99 235 / 22%);
border-radius: 8px;
font-size: 13px;
box-shadow: inset 0 1px rgb(255 255 255 / 14%);
object-fit: contain;
}

.sidebar-footer__account-copy {
Expand Down
Loading
Loading