mirror of
https://github.com/dong-nz/cv.git
synced 2026-11-22 16:10:40 +07:00
feat(edit): inline editing controls on every record surface (spec-v4-inline-editing §5 steps 1-7)
- EditableText: wrapper zone + pencil trigger (E6), inline validation errors, provenance tooltip + copy-chip (E7) - TagListEditor: per-chip edit/delete/move + ghost add over all six tag arrays, tagline emphasis toggle - RecordControls + AddGhost on About, AboutPage, Expertise, Experience, ExperiencePage, Projects, ProjectsListPage, ProjectDetailPage (incl. sections), PhilosophyPage; RecordSettings popover (featured, section list with type picker, variant, location, logo) - id-slug rename on committed record titles (E3); per-field conflict UI in EditBar; chrome CSS in App.css; labels in both ui.json - JsonPanel kept until the inline surface is verified in a real browser (spec progress row 8); acceptance §6 partial — build, validate:content, lint, smoke-draft pass 2026-10-23
This commit is contained in:
1 parent
753b28a4e3
commit
0a72cd9b58
22 files changed
+1812
-277
No files matched your search
@@ -2,10 +2,14 @@ import { motion } from "motion/react"
|
||||
import { SectionHeading } from "@/components/ui/SectionHeading"
|
||||
import { InView } from '@/components/ui/InView'
|
||||
import { EditableText } from '@/components/ui/EditableText'
|
||||
import { TagListEditor } from '@/components/ui/TagListEditor'
|
||||
import { RecordControls, AddGhost } from '@/components/ui/RecordControls'
|
||||
import { useEdit } from '@/hooks/useEdit'
|
||||
import { useI18n } from '@/i18n/provider'
|
||||
|
||||
export function Expertise() {
|
||||
const { ui: s, content: c } = useI18n()
|
||||
const edit = useEdit()
|
||||
return (
|
||||
<InView>
|
||||
<motion.section
|
||||
@@ -24,7 +28,7 @@ export function Expertise() {
|
||||
{c.skillGroups.map((group, i) => (
|
||||
<motion.div
|
||||
key={group.id}
|
||||
className="expertise-card"
|
||||
className={edit ? 'expertise-card edit-record-host' : 'expertise-card'}
|
||||
initial={{ opacity: 0, y: 24 }}
|
||||
whileInView={{ opacity: 1, y: 0 }}
|
||||
viewport={{ once: true, amount: 0.2 }}
|
||||
@@ -32,18 +36,33 @@ export function Expertise() {
|
||||
whileHover={{ scale: 1.02, y: -4 }}
|
||||
whileTap={{ scale: 0.98 }}
|
||||
>
|
||||
{edit && (
|
||||
<RecordControls
|
||||
label={group.title}
|
||||
canUp={i > 0}
|
||||
canDown={i < c.skillGroups.length - 1}
|
||||
onUp={() => edit.moveItem('skills', '', i, i - 1)}
|
||||
onDown={() => edit.moveItem('skills', '', i, i + 1)}
|
||||
onDelete={() => edit.deleteRecord('skill-group', { id: group.id })}
|
||||
/>
|
||||
)}
|
||||
<EditableText as="h3" path={`skills.${group.id}.title`} label={s.edit.fields.groupTitle}>
|
||||
{group.title}
|
||||
</EditableText>
|
||||
<ul className="expertise-skills">
|
||||
{group.skills.map((skill) => (
|
||||
<li key={skill} className="expertise-skill">
|
||||
{skill}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
<TagListEditor
|
||||
doc="skills"
|
||||
arrayPath={`[${i}].skills`}
|
||||
items={group.skills}
|
||||
containerAs="ul"
|
||||
containerClassName="expertise-skills"
|
||||
as="li"
|
||||
itemClassName="expertise-skill"
|
||||
labelPrefix={`${group.title} — ${s.edit.fields.skill}`}
|
||||
addLabel={s.edit.addSkill}
|
||||
/>
|
||||
</motion.div>
|
||||
))}
|
||||
{edit && <AddGhost variant="card" label={s.edit.addSkillGroup} onClick={() => edit.addRecord('skill-group')} />}
|
||||
</div>
|
||||
</motion.section>
|
||||
</InView>
|
||||
|
||||
Reference in new issue
Block a user