refactor(snippets): adopt alias/title model and markdown UX

- rename snippet identity from name to alias and add required title fields

- migrate snippet API, forms, cards, and detail views to alias/title semantics

- render markdown descriptions with short card previews and split vendor chunks
This commit is contained in:
2026-04-10 23:26:36 +03:00
parent 11db983ea6
commit 7223371fae
21 changed files with 1821 additions and 85 deletions
+2 -2
View File
@@ -90,7 +90,7 @@ export const snippets = {
get(id: string): Promise<Snippet> {
return request(`/snippets/${id}`);
},
create(payload: Pick<Snippet, 'name' | 'code'> & { description?: string }): Promise<Snippet> {
create(payload: Pick<Snippet, 'alias' | 'title' | 'code'> & { description?: string }): Promise<Snippet> {
return request('/snippets', {
method: 'POST',
body: JSON.stringify(payload),
@@ -98,7 +98,7 @@ export const snippets = {
},
update(
id: string,
patch: Partial<Pick<Snippet, 'name' | 'description' | 'code'>>,
patch: Partial<Pick<Snippet, 'alias' | 'title' | 'description' | 'code'>>,
): Promise<Snippet> {
return request(`/snippets/${id}`, {
method: 'PATCH',
+2 -1
View File
@@ -36,7 +36,8 @@ export interface Credential {
export interface Snippet {
id: string;
name: string;
alias: string;
title: string;
description: string | null;
code: string;
createdAt: string;