mirror of
https://github.com/dong-nz/cv.git
synced 2026-11-22 16:10:40 +07:00
feat(edit): live edit mode with draft store, inline editing, JSON panel, save bar, branch targeting
?edit entry with Basic-auth probe; DraftStore copy-on-write over live branch documents (?ref GET / branch PUT, last_commit_sha optimistic concurrency, three-way rebase on 412); EditableText inline editors; JsonPanel with templates and orphan-free delete; EditBar sequential-PUT save with conflict actions and merge hint on non-master branches. scripts/smoke-draft.ts regression check.
This commit is contained in:
1 parent
f113dfc7b5
commit
6482c993e8
24 files changed
+2523
-52
No files matched your search
+18
-5
@@ -2,6 +2,7 @@ import { motion } from 'motion/react'
|
||||
import { SectionHeading } from '@/components/ui/SectionHeading'
|
||||
import { Tag } from '@/components/ui/Tag'
|
||||
import { InView } from '@/components/ui/InView'
|
||||
import { EditableText } from '@/components/ui/EditableText'
|
||||
import { useI18n } from '@/i18n/provider'
|
||||
|
||||
export function AboutPage() {
|
||||
@@ -25,9 +26,15 @@ export function AboutPage() {
|
||||
subtitle={s.about.subtitle}
|
||||
tag={s.about.heading}
|
||||
/>
|
||||
<p className="prose-lede lede-wide">
|
||||
<EditableText
|
||||
as="p"
|
||||
className="prose-lede lede-wide"
|
||||
path="profile.bio"
|
||||
label={s.edit.fields.bio}
|
||||
multiline
|
||||
>
|
||||
{c.profile.bio}
|
||||
</p>
|
||||
</EditableText>
|
||||
|
||||
<h3 className="subheading">
|
||||
{s.about.engineeringTitle}
|
||||
@@ -44,8 +51,12 @@ export function AboutPage() {
|
||||
whileHover={{ scale: 1.02, y: -4 }}
|
||||
whileTap={{ scale: 0.98 }}
|
||||
>
|
||||
<h3>{point.title}</h3>
|
||||
<p>{point.description}</p>
|
||||
<EditableText as="h3" path={`profile.philosophy.${point.id}.title`} label={s.edit.fields.pointTitle}>
|
||||
{point.title}
|
||||
</EditableText>
|
||||
<EditableText as="p" path={`profile.philosophy.${point.id}.description`} label={s.edit.fields.pointDescription} multiline>
|
||||
{point.description}
|
||||
</EditableText>
|
||||
<div className="philosophy-keywords">
|
||||
{point.keywords.map((kw) => (
|
||||
<Tag key={kw}>{kw}</Tag>
|
||||
@@ -92,7 +103,9 @@ export function AboutPage() {
|
||||
whileHover={{ scale: 1.02, y: -4 }}
|
||||
whileTap={{ scale: 0.98 }}
|
||||
>
|
||||
<h3>{group.title}</h3>
|
||||
<EditableText as="h3" path={`skills.${group.id}.title`} label={s.edit.fields.groupTitle}>
|
||||
{group.title}
|
||||
</EditableText>
|
||||
<ul className="expertise-skills">
|
||||
{group.skills.map((skill: string) => (
|
||||
<li key={skill} className="expertise-skill">
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { motion } from 'motion/react'
|
||||
import { SectionHeading } from '@/components/ui/SectionHeading'
|
||||
import { InView } from '@/components/ui/InView'
|
||||
import { EditableText } from '@/components/ui/EditableText'
|
||||
import { useI18n } from '@/i18n/provider'
|
||||
|
||||
export function ExperiencePage() {
|
||||
@@ -31,7 +32,9 @@ export function ExperiencePage() {
|
||||
>
|
||||
<div className="timeline-marker" />
|
||||
<div className="timeline-header">
|
||||
<div className="timeline-title">{exp.title}</div>
|
||||
<EditableText as="div" className="timeline-title" path={`experience.${exp.id}.title`} label={s.edit.fields.expTitle}>
|
||||
{exp.title}
|
||||
</EditableText>
|
||||
<div className="timeline-company">{exp.company}</div>
|
||||
<div className="timeline-meta">
|
||||
<span className="timeline-duration">{exp.duration}</span>
|
||||
@@ -39,8 +42,15 @@ export function ExperiencePage() {
|
||||
</div>
|
||||
</div>
|
||||
<ul className="timeline-responsibilities">
|
||||
{exp.responsibilities.map((r) => (
|
||||
<li key={r}>{r}</li>
|
||||
{exp.responsibilities.map((r, ri) => (
|
||||
<EditableText
|
||||
as="li"
|
||||
key={ri}
|
||||
path={`experience.${exp.id}.responsibilities[${ri}]`}
|
||||
label={`${exp.title} — ${s.edit.fields.responsibility} ${ri + 1}`}
|
||||
>
|
||||
{r}
|
||||
</EditableText>
|
||||
))}
|
||||
</ul>
|
||||
</motion.div>
|
||||
|
||||
@@ -2,6 +2,7 @@ import { useParams, Link } from 'react-router'
|
||||
import { motion, type Transition } from 'motion/react'
|
||||
import { Badge } from '@/components/ui/Badge'
|
||||
import { Tag } from '@/components/ui/Tag'
|
||||
import { EditableText } from '@/components/ui/EditableText'
|
||||
import { InView } from '@/components/ui/InView'
|
||||
import { useI18n } from '@/i18n/provider'
|
||||
|
||||
@@ -61,19 +62,25 @@ export function ProjectDetailPage() {
|
||||
viewport={{ once: true, amount: 0.2 }}
|
||||
transition={itemTransition(0)}
|
||||
>
|
||||
<h1 id="project-title" style={{ flex: 1 }}>{project.title}</h1>
|
||||
<EditableText as="h1" id="project-title" style={{ flex: 1 }} path={`projects.${project.id}.title`} label={s.edit.fields.title}>
|
||||
{project.title}
|
||||
</EditableText>
|
||||
<Badge variant="outline">{s.projects.categories[project.category]}</Badge>
|
||||
</motion.div>
|
||||
|
||||
<motion.p
|
||||
<EditableText
|
||||
as={motion.p}
|
||||
className="prose-lede"
|
||||
initial={{ opacity: 0, y: 24 }}
|
||||
whileInView={{ opacity: 1, y: 0 }}
|
||||
viewport={{ once: true, amount: 0.2 }}
|
||||
transition={itemTransition(0.08)}
|
||||
path={`projects.${project.id}.summary`}
|
||||
label={`${project.title} — ${s.edit.fields.summary}`}
|
||||
multiline
|
||||
>
|
||||
{project.summary}
|
||||
</motion.p>
|
||||
</EditableText>
|
||||
|
||||
<div className="prose">
|
||||
{project.metrics && project.metrics.length > 0 && (
|
||||
@@ -137,8 +144,12 @@ export function ProjectDetailPage() {
|
||||
viewport={{ once: true, amount: 0.2 }}
|
||||
transition={itemTransition(0.48 + idx * 0.08)}
|
||||
>
|
||||
<h4>{section.title}</h4>
|
||||
<p>{section.content}</p>
|
||||
<EditableText as="h4" path={`projects.${project.id}.sections.${section.id}.title`} label={`${section.title} — ${s.edit.fields.sectionTitle}`}>
|
||||
{section.title}
|
||||
</EditableText>
|
||||
<EditableText as="p" path={`projects.${project.id}.sections.${section.id}.content`} label={`${section.title} — ${s.edit.fields.sectionContent}`} multiline>
|
||||
{section.content}
|
||||
</EditableText>
|
||||
<Tag accent>{section.type}</Tag>
|
||||
</motion.div>
|
||||
))}
|
||||
|
||||
@@ -2,6 +2,7 @@ import { SectionHeading } from '@/components/ui/SectionHeading'
|
||||
import { Badge } from '@/components/ui/Badge'
|
||||
import { motion } from 'motion/react'
|
||||
import { InView } from '@/components/ui/InView'
|
||||
import { EditableText } from '@/components/ui/EditableText'
|
||||
import { useI18n } from '@/i18n/provider'
|
||||
|
||||
import { Link } from 'react-router'
|
||||
@@ -39,12 +40,16 @@ export function ProjectsListPage() {
|
||||
whileTap={{ scale: 0.98 }}
|
||||
>
|
||||
<div className="project-card-header">
|
||||
<h3>{project.title}</h3>
|
||||
<EditableText as="h3" path={`projects.${project.id}.title`} label={s.edit.fields.title}>
|
||||
{project.title}
|
||||
</EditableText>
|
||||
<Badge variant="outline">
|
||||
{s.projects.categories[project.category]}
|
||||
</Badge>
|
||||
</div>
|
||||
<p className="project-card-summary">{project.summary}</p>
|
||||
<EditableText as="p" className="project-card-summary" path={`projects.${project.id}.summary`} label={`${project.title} — ${s.edit.fields.summary}`}>
|
||||
{project.summary}
|
||||
</EditableText>
|
||||
<div className="project-card-techs">
|
||||
{project.technologies.slice(0, 4).map((tech) => (
|
||||
<span key={tech} className="tag">
|
||||
|
||||
Reference in new issue
Block a user