feat(feedback): Add content improvement feedback system

Frontend (frontend/app.js):

- Add textarea for improvement feedback

- Add submit button with loading state

- Handle API response and display improved content

Backend (backend/copywriter.py):

- Add improve_copy() method using Cohere API

- Integrate retry mechanism for API calls

Backend (backend/main.py):

- Add /improve-content POST endpoint

- Implement error handling and return improved content with metadata

Testing:

- Verified feedback submission flow

- Confirmed improved content generation

- Tested error scenarios and loading states
This commit is contained in:
Michael Ikehi
2025-04-21 17:32:33 +01:00
parent 6d07556b85
commit c1a894ad50
11 changed files with 1001 additions and 1471 deletions
+80 -17
View File
@@ -446,9 +446,30 @@ header {
}
.result-content {
padding: 25px;
white-space: pre-wrap;
font-family: var(--font-family);
line-height: 1.6;
padding: 20px;
background: white;
border-radius: 8px;
box-shadow: var(--shadow-sm);
}
.result-content ul,
.result-content ol {
padding-left: 20px;
margin: 1em 0;
}
.result-content p {
margin: 1em 0;
}
/* Style bullet points */
.result-content {
margin-left: 1em;
display: list-item;
list-style-type: disc;
}
.metadata-panel {
@@ -745,6 +766,48 @@ header {
margin-top: 10px;
}
.tag-selector.read-only .tag {
cursor: default;
}
.style-description {
margin-top: 15px;
font-style: italic;
color: var(--grey-600);
line-height: 1.6;
}
.style-note {
display: flex;
align-items: center;
color: var(--grey-600);
font-style: italic;
}
.style-note i {
margin-right: 8px;
color: var(--grey-500);
}
.alert {
padding: 15px;
border-radius: var(--radius-md);
margin-top: 15px;
display: flex;
align-items: center;
}
.alert i {
margin-right: 10px;
font-size: 18px;
}
.alert-info {
background-color: rgba(98, 54, 255, 0.1);
color: var(--primary-dark);
border-left: 4px solid var(--primary-color);
}
.tag {
display: inline-flex;
align-items: center;
@@ -885,40 +948,40 @@ header {
width: 80px;
padding: 15px 0;
}
.logo h2 {
width: 50px;
height: 50px;
font-size: 20px;
}
.menu li {
justify-content: center;
padding: 12px;
}
.menu li i {
margin-right: 0;
font-size: 20px;
}
.menu li span {
display: none;
}
.user-info {
justify-content: center;
padding: 10px;
}
.user-avatar {
margin-right: 0;
}
.user-name {
display: none;
}
.content {
margin-left: 80px;
max-width: calc(100vw - 80px);
@@ -930,35 +993,35 @@ header {
flex-direction: column;
gap: 10px;
}
.templates-grid {
grid-template-columns: 1fr;
}
.history-item,
.history-item,
.training-item {
flex-direction: column;
align-items: flex-start;
}
.history-item-type,
.training-item-type {
margin-bottom: 10px;
}
.history-item-content,
.training-item-content {
padding: 0;
margin-bottom: 10px;
}
.history-item-date {
text-align: left;
margin-bottom: 10px;
}
.checkbox-group {
flex-direction: column;
gap: 10px;
}
}
}