mirror of
https://github.com/Dvorinka/Primora.git
synced 2026-10-28 15:51:23 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
56c63d43cd | ||
|
|
6d758c0089 | ||
|
|
361538aabc | ||
|
|
5eec80bbca | ||
|
|
40c189c431 | ||
|
|
bc8b165ad9 |
No files matched your search
@@ -4,6 +4,23 @@ All notable changes to Primora. Format follows [Keep a Changelog](https://keepac
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [0.8.5] - 2026-09-28
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- **Content column centers on wide screens** — `.page` was capped at 72rem but left-aligned, so above ~1200px the dashboard hugged the left with a growing dead zone on the right. It now centers (`margin-inline: auto`) while staying full-width below the cap.
|
||||||
|
|
||||||
|
## [0.8.4] - 2026-09-28
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- **Slugs auto-derive from names** — typing an organization, project, bucket, or collection name now fills its slug (`TDvorak` → `tdvorak`); hand-editing the slug stops the derivation, and manual edits are sanitized as you type. Edit forms stay manual.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- **Installer URL prompt was invisible under `curl | bash`** — `exec 9</dev/tty 2>/dev/null` sent the whole shell's stderr to `/dev/null` permanently, so the `read` prompt rendered nowhere while the script blocked on input. The prompt now reads `/dev/tty` directly with a quiet probe; no-tty runs default silently.
|
||||||
|
- **Installer fetches fail fast** — the compose-file and source-tarball `curl` calls now carry connect/max-time timeouts plus retries, so a stalled GitHub connection errors within seconds naming the file instead of hanging forever.
|
||||||
|
|
||||||
## [0.8.3] - 2026-09-28
|
## [0.8.3] - 2026-09-28
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@primora/desktop",
|
"name": "@primora/desktop",
|
||||||
"version": "0.8.3",
|
"version": "0.8.5",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "Primora desktop shell — thin Tauri client for a self-hosted deployment",
|
"description": "Primora desktop shell — thin Tauri client for a self-hosted deployment",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://schema.tauri.app/config/2",
|
"$schema": "https://schema.tauri.app/config/2",
|
||||||
"productName": "Primora",
|
"productName": "Primora",
|
||||||
"version": "0.8.3",
|
"version": "0.8.5",
|
||||||
"identifier": "dev.tdvorak.primora",
|
"identifier": "dev.tdvorak.primora",
|
||||||
"build": {
|
"build": {
|
||||||
"frontendDist": "../ui"
|
"frontendDist": "../ui"
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import { Show, createEffect, createMemo, createResource, createSignal, onCleanup
|
|||||||
import { authClient, fetchApiToken } from "./lib/auth-client";
|
import { authClient, fetchApiToken } from "./lib/auth-client";
|
||||||
import { configureApiToken, errorMessage } from "./lib/api";
|
import { configureApiToken, errorMessage } from "./lib/api";
|
||||||
import { isDemoMode, disableDemoMode, enableDemoMode, demoSession, demoService } from "./lib/demo-mode";
|
import { isDemoMode, disableDemoMode, enableDemoMode, demoSession, demoService } from "./lib/demo-mode";
|
||||||
|
import { applySlugField } from "./lib/slug";
|
||||||
import {
|
import {
|
||||||
AgentSetupModal,
|
AgentSetupModal,
|
||||||
AppShell,
|
AppShell,
|
||||||
@@ -1670,14 +1671,14 @@ export default function App() {
|
|||||||
label="Organization name"
|
label="Organization name"
|
||||||
placeholder="Acme Corporation"
|
placeholder="Acme Corporation"
|
||||||
value={organizationInput().name}
|
value={organizationInput().name}
|
||||||
onInput={(e) => setOrganizationInput((c) => ({ ...c, name: e.currentTarget.value }))}
|
onInput={(e) => setOrganizationInput((c) => applySlugField(c, "name", e.currentTarget.value))}
|
||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
<Input
|
<Input
|
||||||
label="Slug"
|
label="Slug"
|
||||||
placeholder="acme"
|
placeholder="acme"
|
||||||
value={organizationInput().slug}
|
value={organizationInput().slug}
|
||||||
onInput={(e) => setOrganizationInput((c) => ({ ...c, slug: e.currentTarget.value }))}
|
onInput={(e) => setOrganizationInput((c) => applySlugField(c, "slug", e.currentTarget.value))}
|
||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
<button type="submit" class="btn btn-primary w-full" disabled={workspacePending()}>
|
<button type="submit" class="btn btn-primary w-full" disabled={workspacePending()}>
|
||||||
@@ -1723,7 +1724,7 @@ export default function App() {
|
|||||||
projectMessage={projectMessage()}
|
projectMessage={projectMessage()}
|
||||||
projectPending={projectPending()}
|
projectPending={projectPending()}
|
||||||
canUpdateProject={canUpdateProject()}
|
canUpdateProject={canUpdateProject()}
|
||||||
onProjectInputChange={(field, value) => setProjectInput((c) => ({ ...c, [field]: value }))}
|
onProjectInputChange={(field, value) => setProjectInput((c) => applySlugField(c, field, value))}
|
||||||
onProjectEditInputChange={(field, value) => setProjectEditInput((c) => ({ ...c, [field]: value }))}
|
onProjectEditInputChange={(field, value) => setProjectEditInput((c) => ({ ...c, [field]: value }))}
|
||||||
onCreateProject={createProject}
|
onCreateProject={createProject}
|
||||||
onUpdateProject={updateActiveProject}
|
onUpdateProject={updateActiveProject}
|
||||||
@@ -1822,7 +1823,7 @@ export default function App() {
|
|||||||
previewLoading={objectPreview.loading}
|
previewLoading={objectPreview.loading}
|
||||||
renameObjectKey={renameObjectKeyInput()}
|
renameObjectKey={renameObjectKeyInput()}
|
||||||
moveDestinationBucketID={moveDestinationBucketID()}
|
moveDestinationBucketID={moveDestinationBucketID()}
|
||||||
onBucketInputChange={(field, value) => setBucketInput((c) => ({ ...c, [field]: value }))}
|
onBucketInputChange={(field, value) => setBucketInput((c) => applySlugField(c, field, value))}
|
||||||
onBucketEditInputChange={(field, value) => setBucketEditInput((c) => ({ ...c, [field]: value }))}
|
onBucketEditInputChange={(field, value) => setBucketEditInput((c) => ({ ...c, [field]: value }))}
|
||||||
onCreateBucket={createBucket}
|
onCreateBucket={createBucket}
|
||||||
onUpdateBucket={updateSelectedBucket}
|
onUpdateBucket={updateSelectedBucket}
|
||||||
@@ -1859,7 +1860,7 @@ export default function App() {
|
|||||||
collectionPending={collectionPending()}
|
collectionPending={collectionPending()}
|
||||||
documentPending={documentPending()}
|
documentPending={documentPending()}
|
||||||
canUpdate={canUpdateProject()}
|
canUpdate={canUpdateProject()}
|
||||||
onCollectionInputChange={(field, value) => setCollectionInput((c) => ({ ...c, [field]: value }))}
|
onCollectionInputChange={(field, value) => setCollectionInput((c) => applySlugField(c, field, value))}
|
||||||
onCreateCollection={createCollection}
|
onCreateCollection={createCollection}
|
||||||
onDeleteCollection={deleteCollection}
|
onDeleteCollection={deleteCollection}
|
||||||
onSelectCollection={setSelectedCollectionID}
|
onSelectCollection={setSelectedCollectionID}
|
||||||
|
|||||||
@@ -1096,6 +1096,8 @@ code {
|
|||||||
/* ---------- page scaffold ---------- */
|
/* ---------- page scaffold ---------- */
|
||||||
.page {
|
.page {
|
||||||
max-width: 72rem;
|
max-width: 72rem;
|
||||||
|
width: 100%;
|
||||||
|
margin-inline: auto;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 1.5rem;
|
gap: 1.5rem;
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
import { describe, expect, it } from "vitest";
|
||||||
|
|
||||||
|
import { applySlugField, slugify } from "../slug";
|
||||||
|
|
||||||
|
describe("slugify", () => {
|
||||||
|
it("derives lowercase hyphenated slugs", () => {
|
||||||
|
expect(slugify("TDvorak")).toBe("tdvorak");
|
||||||
|
expect(slugify("Acme Corporation")).toBe("acme-corporation");
|
||||||
|
expect(slugify(" My_App!! v2 ")).toBe("my-app-v2");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("strips accents and non-ascii characters", () => {
|
||||||
|
expect(slugify("Zürich — Héllo")).toBe("zurich-hello");
|
||||||
|
expect(slugify("日本語")).toBe("");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("applySlugField", () => {
|
||||||
|
const form = { name: "", slug: "", description: "" };
|
||||||
|
|
||||||
|
it("fills the slug while it is untouched", () => {
|
||||||
|
const next = applySlugField(form, "name", "My Org");
|
||||||
|
expect(next.slug).toBe("my-org");
|
||||||
|
// keeps following name edits
|
||||||
|
expect(applySlugField(next, "name", "Renamed Org").slug).toBe("renamed-org");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("stops deriving once the slug was hand-edited", () => {
|
||||||
|
const custom = applySlugField(applySlugField(form, "name", "My Org"), "slug", "custom-slug");
|
||||||
|
expect(applySlugField(custom, "name", "New Name").slug).toBe("custom-slug");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("resumes deriving if the slug is cleared", () => {
|
||||||
|
const cleared = applySlugField(applySlugField(form, "name", "My Org"), "slug", "");
|
||||||
|
expect(applySlugField(cleared, "name", "Other").slug).toBe("other");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("sanitizes manual slug edits", () => {
|
||||||
|
expect(applySlugField(form, "slug", "Not A Slug!").slug).toBe("not-a-slug");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("passes through unrelated fields", () => {
|
||||||
|
expect(applySlugField(form, "description", "hi").description).toBe("hi");
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
export function slugify(value: string): string {
|
||||||
|
return value
|
||||||
|
.normalize("NFKD")
|
||||||
|
.replace(/[\u0300-\u036f]/g, "")
|
||||||
|
.toLowerCase()
|
||||||
|
.trim()
|
||||||
|
.replace(/[^a-z0-9]+/g, "-")
|
||||||
|
.replace(/^-+|-+$/g, "")
|
||||||
|
.slice(0, 63);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Applies a field edit to a {name, slug, ...} form. While the slug is
|
||||||
|
* untouched — empty or still equal to the derived value — renaming the
|
||||||
|
* entity re-derives its slug. Explicit slug edits are sanitized in place.
|
||||||
|
*/
|
||||||
|
export function applySlugField<T extends { name: string; slug: string }>(
|
||||||
|
current: T,
|
||||||
|
field: string,
|
||||||
|
value: string,
|
||||||
|
): T {
|
||||||
|
if (field === "slug") return { ...current, slug: slugify(value) };
|
||||||
|
if (field === "name" && (current.slug === "" || current.slug === slugify(current.name))) {
|
||||||
|
return { ...current, name: value, slug: slugify(value) };
|
||||||
|
}
|
||||||
|
return { ...current, [field]: value };
|
||||||
|
}
|
||||||
+13
-7
@@ -38,9 +38,12 @@ mkdir -p "$DIR/infra/nginx"
|
|||||||
cd "$DIR"
|
cd "$DIR"
|
||||||
|
|
||||||
# The compose stack needs exactly these three files from the repo.
|
# The compose stack needs exactly these three files from the repo.
|
||||||
|
# Timeouts + retries: a stalled connection must fail loudly, not hang.
|
||||||
info "Fetching compose files ($REF)"
|
info "Fetching compose files ($REF)"
|
||||||
for f in docker-compose.yml .env.example infra/nginx/default.conf; do
|
for f in docker-compose.yml .env.example infra/nginx/default.conf; do
|
||||||
curl -fsSL "https://raw.githubusercontent.com/$REPO/$REF/$f" -o "$f"
|
curl -fsSL --connect-timeout 10 --max-time 60 --retry 3 --retry-delay 1 --retry-all-errors \
|
||||||
|
"https://raw.githubusercontent.com/$REPO/$REF/$f" -o "$f" \
|
||||||
|
|| die "could not fetch $f — check connectivity to raw.githubusercontent.com"
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -f .env ]; then
|
if [ -f .env ]; then
|
||||||
@@ -57,11 +60,13 @@ else
|
|||||||
if [ -z "$PUBLIC_URL" ]; then
|
if [ -z "$PUBLIC_URL" ]; then
|
||||||
DEFAULT_URL="http://localhost"
|
DEFAULT_URL="http://localhost"
|
||||||
[ "$NGINX_PORT" != "80" ] && DEFAULT_URL="http://localhost:$NGINX_PORT"
|
[ "$NGINX_PORT" != "80" ] && DEFAULT_URL="http://localhost:$NGINX_PORT"
|
||||||
# Under `curl | bash` stdin is the script pipe — prompt on the
|
# Under `curl | bash` stdin is the script pipe — ask on the controlling
|
||||||
# controlling terminal instead. No tty (CI/cron) → default silently.
|
# terminal instead. `true </dev/tty` probes the open quietly; read's own
|
||||||
if exec 9</dev/tty 2>/dev/null; then
|
# redirect fails non-fatally (default applies) where there is no tty.
|
||||||
read -rp "URL where you'll open Primora (domain or IP, e.g. https://primora.example.com) [$DEFAULT_URL]: " PUBLIC_URL <&9 || true
|
# Never `exec ... 2>/dev/null` here — exec redirections persist and would
|
||||||
exec 9>&-
|
# silence stderr, including the read prompt below, for the whole script.
|
||||||
|
if true 2>/dev/null </dev/tty; then
|
||||||
|
read -rp "URL where you'll open Primora (domain or IP, e.g. https://primora.example.com) [$DEFAULT_URL]: " PUBLIC_URL </dev/tty || true
|
||||||
fi
|
fi
|
||||||
PUBLIC_URL="${PUBLIC_URL:-$DEFAULT_URL}"
|
PUBLIC_URL="${PUBLIC_URL:-$DEFAULT_URL}"
|
||||||
fi
|
fi
|
||||||
@@ -129,7 +134,8 @@ if docker pull "ghcr.io/$GHCR_OWNER/primora-backend:latest" \
|
|||||||
else
|
else
|
||||||
# GHCR packages are private until first published release — build from source.
|
# GHCR packages are private until first published release — build from source.
|
||||||
info "Prebuilt images unavailable; building from source"
|
info "Prebuilt images unavailable; building from source"
|
||||||
curl -fsSL "https://codeload.github.com/$REPO/tar.gz/refs/heads/$REF" | tar xz --strip-components=1
|
curl -fsSL --connect-timeout 10 --max-time 120 --retry 3 --retry-delay 1 --retry-all-errors \
|
||||||
|
"https://codeload.github.com/$REPO/tar.gz/refs/heads/$REF" | tar xz --strip-components=1
|
||||||
docker compose up -d --build
|
docker compose up -d --build
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "primora",
|
"name": "primora",
|
||||||
"version": "0.8.3",
|
"version": "0.8.5",
|
||||||
"private": true,
|
"private": true,
|
||||||
"packageManager": "[email protected]",
|
"packageManager": "[email protected]",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
|
|||||||
Reference in new issue
Block a user