// Create a feature change set
const featureChangeSet = await createChangeSet({
lix,
labels: [
{ key: "type", value: "feature" },
{ key: "proposal", value: "true" },
{ key: "title", value: "Add dark theme support" },
{ key: "status", value: "open" }
]
});
// Create a discussion thread for the proposal
const thread = await lix.db
.insertInto("thread")
.values({
id: generateId(),
title: "Proposal: Add dark theme support",
description: "This change adds a new dark theme option to the application settings.",
created_at: new Date().toISOString(),
change_set_id: featureChangeSet.id,
status: "open"
})
.returningAll()
.executeTakeFirstOrThrow();
// Proposer adds implementation details
await lix.db
.insertInto("comment")
.values({
id: generateId(),
thread_id: thread.id,
content: "The implementation uses CSS variables to switch between light and dark color schemes. All colors have been adjusted for proper contrast ratios.",
author: "proposer@example.com",
created_at: new Date().toISOString()
})
.execute();
// Reviewer asks a question
const questionComment = await lix.db
.insertInto("comment")
.values({
id: generateId(),
thread_id: thread.id,
content: "Have you tested this with screen readers? We need to ensure accessibility is maintained.",
author: "reviewer@example.com",
created_at: new Date().toISOString()
})
.returningAll()
.executeTakeFirstOrThrow();
// Proposer responds to the question
await lix.db
.insertInto("comment")
.values({
id: generateId(),
thread_id: thread.id,
content: "Yes, I've tested with VoiceOver and NVDA. All elements maintain their proper roles and labels regardless of theme.",
author: "proposer@example.com",
created_at: new Date().toISOString(),
reply_to_id: questionComment.id
})
.execute();
// Reviewer provides feedback
await lix.db
.insertInto("comment")
.values({
id: generateId(),
thread_id: thread.id,
content: "The contrast ratio in the notification component is too low. Please increase it to meet WCAG AA standards.",
author: "reviewer@example.com",
created_at: new Date().toISOString()
})
.execute();
// Proposer acknowledges the feedback
await lix.db
.insertInto("comment")
.values({
id: generateId(),
thread_id: thread.id,
content: "Good catch. I'll fix the notification component contrast in the next revision.",
author: "proposer@example.com",
created_at: new Date().toISOString()
})
.execute();
// After making changes, proposer updates the thread
await lix.db
.insertInto("comment")
.values({
id: generateId(),
thread_id: thread.id,
content: "I've updated the notification component colors to increase the contrast ratio. Now all components meet WCAG AA standards.",
author: "proposer@example.com",
created_at: new Date().toISOString()
})
.execute();
// Reviewer approves
await lix.db
.insertInto("comment")
.values({
id: generateId(),
thread_id: thread.id,
content: "The changes look good. I approve this proposal.",
author: "reviewer@example.com",
created_at: new Date().toISOString()
})
.execute();
// Update thread status
await lix.db
.updateTable("thread")
.set({
status: "approved"
})
.where("id", "=", thread.id)
.execute();
// After merging, add a final comment
await lix.db
.insertInto("comment")
.values({
id: generateId(),
thread_id: thread.id,
content: "This proposal has been merged into the main version.",
author: "system",
created_at: new Date().toISOString()
})
.execute();
// Close the thread
await lix.db
.updateTable("thread")
.set({
status: "closed"
})
.where("id", "=", thread.id)
.execute();