This commit is contained in:
Mateusz Gruszczyński
2026-07-29 21:05:31 +02:00
parent 94ae8e52db
commit 9ca055de5f
4 changed files with 15 additions and 12 deletions
Generated
+1 -1
View File
@@ -2581,7 +2581,7 @@ dependencies = [
[[package]] [[package]]
name = "rustpad" name = "rustpad"
version = "0.2.1" version = "0.2.3"
dependencies = [ dependencies = [
"argon2", "argon2",
"aws-config", "aws-config",
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "rustpad" name = "rustpad"
version = "0.2.2" version = "0.2.3"
edition = "2024" edition = "2024"
rust-version = "1.94" rust-version = "1.94"
description = "Collaborative Markdown notepad built with Axum, WebSockets and SQLite, PostgreSQL and MySQL" description = "Collaborative Markdown notepad built with Axum, WebSockets and SQLite, PostgreSQL and MySQL"
+10 -8
View File
@@ -1410,15 +1410,17 @@ dialog::backdrop {
.owner-label { .owner-label {
position: absolute; position: absolute;
right: 8px; right: calc(var(--editor-rendered-font-size, 14px) * .57);
max-width: min(180px, 45%); box-sizing: border-box;
max-width: min(calc(var(--editor-rendered-font-size, 14px) * 12.8571), 45%);
max-height: calc(var(--editor-line-height, 29px) - 2px);
overflow: hidden; overflow: hidden;
padding: 2px 7px; padding: .14em .5em;
border: 1px solid color-mix(in srgb, var(--owner) 62%, transparent); border: 1px solid color-mix(in srgb, var(--owner) 62%, transparent);
border-radius: 999px; border-radius: 999px;
background: color-mix(in srgb, var(--owner) 18%, #0d1015); background: color-mix(in srgb, var(--owner) 18%, #0d1015);
color: #eef1f5; color: #eef1f5;
font: 600 10px/1.25 system-ui, sans-serif; font: 600 calc(var(--editor-rendered-font-size, 14px) * .7143)/1.25 system-ui, sans-serif;
opacity: .82; opacity: .82;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
@@ -4075,10 +4077,10 @@ dialog::backdrop {
/* Multiple authors can contribute to one line. */ /* Multiple authors can contribute to one line. */
.owner-label-group { .owner-label-group {
position: absolute; position: absolute;
right: 8px; right: calc(var(--editor-rendered-font-size, 14px) * .57);
display: flex; display: flex;
max-width: min(420px, 70%); max-width: min(calc(var(--editor-rendered-font-size, 14px) * 30), 70%);
gap: 4px; gap: calc(var(--editor-rendered-font-size, 14px) * .2857);
overflow: hidden; overflow: hidden;
transform: translateY(-50%); transform: translateY(-50%);
white-space: nowrap; white-space: nowrap;
@@ -4089,7 +4091,7 @@ dialog::backdrop {
right: auto; right: auto;
flex: 0 1 auto; flex: 0 1 auto;
min-width: 0; min-width: 0;
max-width: 150px; max-width: calc(var(--editor-rendered-font-size, 14px) * 10.7143);
transform: none; transform: none;
} }
+3 -2
View File
@@ -143,16 +143,17 @@ export function startNoteEditor(adapter) {
renderParticipantBadges(authorshipColorsEnabled ? owners : []); renderParticipantBadges(authorshipColorsEnabled ? owners : []);
document.querySelectorAll("[data-authorship-mode]").forEach(button => button.classList.toggle("active", button.dataset.authorshipMode === authorshipMode)); document.querySelectorAll("[data-authorship-mode]").forEach(button => button.classList.toggle("active", button.dataset.authorshipMode === authorshipMode));
editorWorkspace.dataset.authorshipMode = authorshipMode; editorWorkspace.dataset.authorshipMode = authorshipMode;
const style = getComputedStyle(editor), lineHeight = parseFloat(style.lineHeight) || 29, paddingTop = parseFloat(style.paddingTop) || 24, paddingBottom = parseFloat(style.paddingBottom) || 24; const style = getComputedStyle(editor), lineHeight = parseFloat(style.lineHeight) || 29, fontSize = parseFloat(style.fontSize) || 14, paddingTop = parseFloat(style.paddingTop) || 24, paddingBottom = parseFloat(style.paddingBottom) || 24;
gutter.style.paddingTop = `${paddingTop}px`; gutter.style.paddingBottom = `${paddingBottom}px`; gutter.style.lineHeight = `${lineHeight}px`; gutter.style.paddingTop = `${paddingTop}px`; gutter.style.paddingBottom = `${paddingBottom}px`; gutter.style.lineHeight = `${lineHeight}px`;
gutter.innerHTML = lines.map((_, i) => `<div class="line-number-row" style="height:${lineHeight}px"><button class="line-number-button" type="button" tabindex="-1" data-line="${i + 1}" aria-label="Copy link to line ${i + 1}">${i + 1}</button></div>`).join(""); gutter.innerHTML = lines.map((_, i) => `<div class="line-number-row" style="height:${lineHeight}px"><button class="line-number-button" type="button" tabindex="-1" data-line="${i + 1}" aria-label="Copy link to line ${i + 1}">${i + 1}</button></div>`).join("");
ownerLabels.style.setProperty("--editor-line-height", `${lineHeight}px`); ownerLabels.style.setProperty("--editor-line-height", `${lineHeight}px`);
ownerLabels.style.setProperty("--editor-rendered-font-size", `${fontSize}px`);
if (full) { if (full) {
let previousAuthorSignature = null; let previousAuthorSignature = null;
ownerLabels.innerHTML = lines.map((_, i) => { ownerLabels.innerHTML = lines.map((_, i) => {
const authors = authorsByLine[i] || []; const authors = authorsByLine[i] || [];
if (!authors.length) return ""; if (!authors.length) return "";
const top = paddingTop + i * lineHeight; const top = paddingTop + i * lineHeight + lineHeight / 2;
const signature = authors.map(owner => ownerName(owner)).sort((a, b) => a.localeCompare(b)).join("\u0000"); const signature = authors.map(owner => ownerName(owner)).sort((a, b) => a.localeCompare(b)).join("\u0000");
if (signature === previousAuthorSignature) return ""; if (signature === previousAuthorSignature) return "";
previousAuthorSignature = signature; previousAuthorSignature = signature;