Restructure into Cargo workspace with Tauri desktop GUI (#1)

Split the bridge into a tutabridge-core crate, a Tauri v2 desktop app
(src-tauri) and a React/TS UI (ui), keeping the CLI entrypoint at the
workspace root.

Add encrypted local storage (SQLCipher metadata index + encrypted .eml
files) so mail persists across launches and only the delta is fetched.

Wire the bridge to the Tuta Rust SDK via the tuta-repo submodule
(batch loading, MailDetailsBlob reading, interactive 2FA login).

Implement SMTP sending: build the draft and send it through Tuta's
DraftService/SendDraftService, mirroring the web client (body in
compressedBodyText, non-empty sender/recipient names, populated
SendDraftParameters). Add unit tests for the draft/send payload building.
This commit is contained in:
Anthony M
2026-05-27 14:03:15 +02:00
committed by GitHub
parent 128772bb21
commit e58ee86bed
62 changed files with 15841 additions and 384 deletions
+515
View File
@@ -0,0 +1,515 @@
.app {
display: flex;
flex-direction: column;
height: 100vh;
overflow: hidden;
background: var(--surface);
}
/* ── Header ── */
.app-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 16px;
background: var(--surface-container);
border-bottom: 1px solid var(--outline-variant);
flex-shrink: 0;
}
.header-left {
display: flex;
align-items: center;
gap: 14px;
}
.app-header h1 {
font-family: var(--brand);
font-size: 16px;
font-weight: 600;
margin: 0;
color: var(--on-surface);
letter-spacing: 0.2px;
}
.header-status {
display: flex;
align-items: center;
gap: 6px;
padding: 3px 10px 3px 8px;
background: var(--surface-container-high);
border-radius: 20px;
}
.header-status-text {
font-size: 11px;
font-weight: 500;
color: var(--on-surface-variant);
}
/* ── Tabs ── */
.tabs {
display: flex;
gap: 2px;
}
.tabs button {
background: none;
border: 1px solid transparent;
border-radius: 8px;
padding: 5px 12px;
font-size: 13px;
color: var(--on-surface-variant);
cursor: pointer;
transition: all 0.15s;
font-family: var(--sans);
}
.tabs button:hover {
background: var(--surface-container-high);
}
.tabs button.active {
background: var(--primary-container);
color: var(--on-primary-container);
border-color: transparent;
font-weight: 500;
}
/* ── Content ── */
.app-content {
flex: 1;
overflow-y: auto;
padding: 24px;
}
/* ── Shared ── */
.status-dot {
width: 8px;
height: 8px;
border-radius: 50%;
flex-shrink: 0;
display: inline-block;
}
.muted {
color: var(--on-surface-variant);
font-size: 13px;
}
.error-text {
font-size: 13px;
color: var(--error);
margin: 0;
padding: 10px 12px;
background: color-mix(in srgb, var(--error) 8%, transparent);
border-radius: 8px;
line-height: 1.4;
}
/* ── Dashboard ── */
.dashboard {
display: flex;
flex-direction: column;
gap: 16px;
}
.status-hero {
display: flex;
align-items: center;
gap: 14px;
padding: 18px 20px;
border-radius: 14px;
border: 1px solid var(--outline-variant);
background: var(--surface-container);
transition: all 0.3s;
}
.status-hero.running {
border-color: color-mix(in srgb, var(--green) 40%, transparent);
background: color-mix(in srgb, var(--success-container) 30%, var(--surface-container));
}
.status-hero.starting {
border-color: color-mix(in srgb, var(--orange) 40%, transparent);
}
.hero-indicator {
position: relative;
width: 36px;
height: 36px;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.pulse-ring {
position: absolute;
width: 36px;
height: 36px;
border-radius: 50%;
border: 2px solid var(--green);
opacity: 0;
animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.pulse-ring.orange {
border-color: var(--orange);
}
.pulse-dot {
width: 12px;
height: 12px;
border-radius: 50%;
background: var(--green);
animation: breathe 2s ease-in-out infinite;
}
.pulse-dot.orange {
background: var(--orange);
}
.static-dot {
width: 12px;
height: 12px;
border-radius: 50%;
}
@keyframes ping {
0% { transform: scale(0.8); opacity: 0.6; }
75%, 100% { transform: scale(1.4); opacity: 0; }
}
@keyframes breathe {
0%, 100% { opacity: 1; }
50% { opacity: 0.5; }
}
.hero-text {
flex: 1;
display: flex;
flex-direction: column;
gap: 2px;
}
.hero-text strong {
font-size: 15px;
color: var(--on-surface);
}
.hero-uptime {
font-size: 12px;
color: var(--on-surface-variant);
}
.hero-action {
padding: 6px 16px;
font-size: 12px;
flex-shrink: 0;
}
.start-section {
display: flex;
flex-direction: column;
gap: 12px;
}
.start-btn {
align-self: flex-start;
}
.stats-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 12px;
}
.stat-card {
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
padding: 20px 16px;
border-radius: 12px;
border: 1px solid var(--outline-variant);
background: var(--surface-container);
transition: border-color 0.2s;
}
.stat-card:hover {
border-color: color-mix(in srgb, var(--primary) 30%, var(--outline-variant));
}
.stat-value {
font-size: 28px;
font-weight: 600;
color: var(--on-surface);
font-family: var(--brand);
line-height: 1;
}
.stat-label {
font-size: 11px;
font-weight: 500;
text-transform: uppercase;
letter-spacing: 0.5px;
color: var(--on-surface-variant);
}
/* ── Connection Panel ── */
.connection-panel {
display: flex;
flex-direction: column;
gap: 16px;
}
.panel-subtitle {
font-size: 13px;
color: var(--on-surface-variant);
margin: 0;
}
.settings-card {
border: 1px solid var(--outline-variant);
border-radius: 14px;
background: var(--surface-container);
overflow: hidden;
}
.settings-section {
padding: 16px 20px;
}
.settings-section h3 {
font-size: 11px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
color: var(--on-surface-variant);
margin: 0 0 10px;
}
.settings-divider {
height: 1px;
background: var(--outline-variant);
}
.settings-grid {
display: grid;
grid-template-columns: 72px 1fr;
gap: 6px 12px;
align-items: center;
}
.setting-key {
font-size: 12px;
color: var(--on-surface-variant);
}
.setting-val {
font-size: 14px;
font-family: var(--mono);
color: var(--on-surface);
background: none;
padding: 0;
}
.setting-val.copyable {
cursor: pointer;
border-radius: 4px;
transition: background 0.15s;
}
.setting-val.copyable:hover {
background: var(--surface-container-high);
}
.password-field-inline {
display: flex;
align-items: center;
gap: 8px;
}
.password-mono {
font-size: 13px;
letter-spacing: 0.3px;
}
.inline-btn {
padding: 2px 8px;
font-size: 11px;
font-weight: 500;
border: 1px solid var(--outline-variant);
border-radius: 6px;
background: var(--surface-container-high);
color: var(--on-surface-variant);
cursor: pointer;
font-family: var(--sans);
transition: all 0.15s;
flex-shrink: 0;
}
.inline-btn:hover {
background: var(--surface-container-highest);
color: var(--on-surface);
}
.regen-btn {
align-self: flex-start;
}
.settings-note {
font-size: 12px;
color: var(--on-surface-variant);
padding: 10px 14px;
background: color-mix(in srgb, var(--orange) 8%, transparent);
border-radius: 8px;
line-height: 1.5;
}
.settings-note strong {
color: var(--on-surface);
}
/* ── Config Panel ── */
.panel {
}
.panel h2 {
font-size: 14px;
font-weight: 600;
margin: 0 0 16px;
color: var(--on-surface);
}
/* ── Forms ── */
.form-group {
margin-bottom: 12px;
}
.form-group label {
display: block;
font-size: 11px;
font-weight: 600;
color: var(--on-surface-variant);
margin-bottom: 4px;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.form-group input {
width: 100%;
padding: 9px 12px;
font-size: 14px;
border: 1px solid var(--outline-variant);
border-radius: 8px;
background: var(--surface);
color: var(--on-surface);
box-sizing: border-box;
font-family: var(--sans);
transition: border-color 0.15s, box-shadow 0.15s;
}
.form-group input:focus {
outline: none;
border-color: var(--primary);
box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 15%, transparent);
}
.form-group input:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.form-group input::placeholder {
color: var(--outline);
}
.form-row {
display: flex;
gap: 12px;
}
.form-row .form-group {
flex: 1;
}
/* ── Buttons ── */
button {
padding: 9px 18px;
font-size: 13px;
font-weight: 500;
border: 1px solid var(--outline-variant);
border-radius: 8px;
background: var(--surface-container-high);
color: var(--on-surface);
cursor: pointer;
font-family: var(--sans);
transition: all 0.15s;
}
button:hover:not(:disabled) {
background: var(--surface-container-highest);
}
button:disabled {
opacity: 0.5;
cursor: not-allowed;
}
button.primary {
background: var(--primary);
color: var(--on-primary);
border-color: var(--primary);
}
button.primary:hover:not(:disabled) {
opacity: 0.92;
}
button.small {
padding: 4px 10px;
font-size: 12px;
}
/* ── Logs ── */
.logs-panel {
max-width: none;
display: flex;
flex-direction: column;
height: calc(100vh - 120px);
}
.logs-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 12px;
}
.logs-header h2 {
margin: 0;
}
.logs-container {
flex: 1;
overflow-y: auto;
background: var(--surface-container);
border: 1px solid var(--outline-variant);
border-radius: 10px;
padding: 12px;
font-family: var(--mono);
font-size: 12px;
line-height: 1.7;
}
.logs-empty {
color: var(--outline);
font-style: italic;
}
.log-line {
color: var(--on-surface);
word-break: break-all;
}