context_drop 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +149 -12
- data/Rakefile +110 -1
- data/app/assets/javascripts/context_drop/context_drop.js +1230 -53
- data/app/controllers/context_drop/application_controller.rb +52 -3
- data/app/controllers/context_drop/configs_controller.rb +10 -1
- data/app/controllers/context_drop/dashboard/feedbacks_controller.rb +15 -11
- data/app/controllers/context_drop/feedbacks_controller.rb +383 -17
- data/app/javascript/context_drop/__tests__/api-client.test.ts +255 -0
- data/app/javascript/context_drop/__tests__/widget.test.ts +355 -1
- data/app/javascript/context_drop/api-client.ts +306 -22
- data/app/javascript/context_drop/element-picker.ts +1 -1
- data/app/javascript/context_drop/icons.ts +4 -0
- data/app/javascript/context_drop/screenshot.ts +1 -1
- data/app/javascript/context_drop/styles.ts +181 -0
- data/app/javascript/context_drop/types.ts +96 -6
- data/app/javascript/context_drop/widget.ts +752 -29
- data/app/models/context_drop/feedback.rb +65 -8
- data/app/services/context_drop/ownership_token.rb +114 -0
- data/app/views/context_drop/dashboard/feedbacks/index.html.erb +8 -0
- data/app/views/context_drop/dashboard/feedbacks/show.html.erb +9 -0
- data/app/views/layouts/context_drop/application.html.erb +5 -0
- data/config/routes.rb +11 -0
- data/db/migrate/20261113000005_add_deleted_at_to_context_drop_feedbacks.rb +11 -0
- data/lib/context_drop/configuration.rb +26 -0
- data/lib/context_drop/mcp/prompts/investigate_feedback.rb +3 -1
- data/lib/context_drop/mcp/tools/get_feedback.rb +16 -5
- data/lib/context_drop/mcp/tools/get_feedback_attachment.rb +3 -0
- data/lib/context_drop/mcp/tools/list_feedbacks.rb +22 -2
- data/lib/context_drop/mcp/tools/update_feedback_status.rb +3 -1
- data/lib/context_drop/version.rb +1 -1
- metadata +4 -2
|
@@ -128,6 +128,47 @@ export const WIDGET_SHADOW_STYLES = `
|
|
|
128
128
|
border-color: #3b4252;
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
+
:host([data-cd-theme="dark"]) .cd-msg-action-btn:hover:not(:disabled),
|
|
132
|
+
:host([data-theme="dark"]) .cd-msg-action-btn:hover:not(:disabled),
|
|
133
|
+
.cd-composer[data-theme="dark"] .cd-msg-action-btn:hover:not(:disabled) {
|
|
134
|
+
background: rgba(255, 255, 255, 0.09);
|
|
135
|
+
color: var(--cd-ink);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
:host([data-cd-theme="dark"]) .cd-msg-action-btn.is-danger:hover:not(:disabled),
|
|
139
|
+
:host([data-theme="dark"]) .cd-msg-action-btn.is-danger:hover:not(:disabled),
|
|
140
|
+
.cd-composer[data-theme="dark"] .cd-msg-action-btn.is-danger:hover:not(:disabled) {
|
|
141
|
+
background: var(--cd-danger-soft);
|
|
142
|
+
color: #fca5a5;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
:host([data-cd-theme="dark"]) .cd-edit-banner-info,
|
|
146
|
+
:host([data-theme="dark"]) .cd-edit-banner-info,
|
|
147
|
+
.cd-composer[data-theme="dark"] .cd-edit-banner-info {
|
|
148
|
+
color: var(--cd-ink);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
:host([data-cd-theme="dark"]) .cd-msg-delete-label,
|
|
152
|
+
:host([data-theme="dark"]) .cd-msg-delete-label,
|
|
153
|
+
.cd-composer[data-theme="dark"] .cd-msg-delete-label {
|
|
154
|
+
color: #fca5a5;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
:host([data-cd-theme="dark"]) .cd-btn-danger,
|
|
158
|
+
:host([data-theme="dark"]) .cd-btn-danger,
|
|
159
|
+
.cd-composer[data-theme="dark"] .cd-btn-danger {
|
|
160
|
+
background: #dc2626;
|
|
161
|
+
border-color: #dc2626;
|
|
162
|
+
color: #ffffff;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
:host([data-cd-theme="dark"]) .cd-btn-danger:hover:not(:disabled),
|
|
166
|
+
:host([data-theme="dark"]) .cd-btn-danger:hover:not(:disabled),
|
|
167
|
+
.cd-composer[data-theme="dark"] .cd-btn-danger:hover:not(:disabled) {
|
|
168
|
+
background: #ef4444;
|
|
169
|
+
border-color: #ef4444;
|
|
170
|
+
}
|
|
171
|
+
|
|
131
172
|
*, *::before, *::after {
|
|
132
173
|
box-sizing: border-box;
|
|
133
174
|
}
|
|
@@ -990,11 +1031,18 @@ select:focus-visible {
|
|
|
990
1031
|
flex-direction: column;
|
|
991
1032
|
gap: 5px;
|
|
992
1033
|
align-self: flex-end;
|
|
1034
|
+
width: 92%;
|
|
993
1035
|
max-width: 92%;
|
|
994
1036
|
padding: 9px 11px;
|
|
995
1037
|
background: var(--cd-surface-elevated);
|
|
996
1038
|
border: 1px solid var(--cd-border);
|
|
997
1039
|
border-radius: 12px 12px 3px 12px;
|
|
1040
|
+
transition: border-color 0.14s var(--cd-ease), box-shadow 0.14s var(--cd-ease);
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
.cd-chat-msg.is-editing {
|
|
1044
|
+
border-color: var(--cd-accent);
|
|
1045
|
+
box-shadow: 0 0 0 2px var(--cd-accent-soft);
|
|
998
1046
|
}
|
|
999
1047
|
|
|
1000
1048
|
.cd-chat-msg-text {
|
|
@@ -1015,6 +1063,83 @@ select:focus-visible {
|
|
|
1015
1063
|
font-variant-numeric: tabular-nums;
|
|
1016
1064
|
}
|
|
1017
1065
|
|
|
1066
|
+
.cd-chat-msg-meta-info {
|
|
1067
|
+
display: inline-flex;
|
|
1068
|
+
align-items: center;
|
|
1069
|
+
gap: 6px;
|
|
1070
|
+
min-width: 0;
|
|
1071
|
+
flex-wrap: wrap;
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
.cd-chat-msg-actions {
|
|
1075
|
+
display: inline-flex;
|
|
1076
|
+
align-items: center;
|
|
1077
|
+
gap: 2px;
|
|
1078
|
+
flex-shrink: 0;
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
.cd-msg-action-btn {
|
|
1082
|
+
appearance: none;
|
|
1083
|
+
display: inline-flex;
|
|
1084
|
+
align-items: center;
|
|
1085
|
+
justify-content: center;
|
|
1086
|
+
width: 24px;
|
|
1087
|
+
height: 24px;
|
|
1088
|
+
padding: 0;
|
|
1089
|
+
border: 1px solid transparent;
|
|
1090
|
+
border-radius: 6px;
|
|
1091
|
+
background: transparent;
|
|
1092
|
+
color: var(--cd-ink-secondary);
|
|
1093
|
+
cursor: pointer;
|
|
1094
|
+
transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
.cd-msg-action-btn:hover:not(:disabled) {
|
|
1098
|
+
background: rgba(17, 19, 24, 0.06);
|
|
1099
|
+
color: var(--cd-ink);
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
.cd-msg-action-btn.is-active {
|
|
1103
|
+
background: var(--cd-accent-soft);
|
|
1104
|
+
color: var(--cd-accent-hover);
|
|
1105
|
+
border-color: rgba(29, 78, 216, 0.25);
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
.cd-msg-action-btn.is-danger:hover:not(:disabled) {
|
|
1109
|
+
background: var(--cd-danger-soft);
|
|
1110
|
+
color: var(--cd-danger);
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
.cd-msg-action-btn:disabled {
|
|
1114
|
+
opacity: 0.4;
|
|
1115
|
+
cursor: not-allowed;
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
.cd-msg-delete-confirm {
|
|
1119
|
+
display: flex;
|
|
1120
|
+
align-items: center;
|
|
1121
|
+
justify-content: space-between;
|
|
1122
|
+
gap: 8px;
|
|
1123
|
+
margin-top: 2px;
|
|
1124
|
+
padding: 6px 8px;
|
|
1125
|
+
border-radius: 8px;
|
|
1126
|
+
background: var(--cd-danger-soft);
|
|
1127
|
+
border: 1px solid rgba(185, 28, 28, 0.24);
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
.cd-msg-delete-label {
|
|
1131
|
+
font-size: 11.5px;
|
|
1132
|
+
font-weight: 600;
|
|
1133
|
+
color: var(--cd-danger);
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
.cd-msg-delete-btns {
|
|
1137
|
+
display: inline-flex;
|
|
1138
|
+
align-items: center;
|
|
1139
|
+
gap: 5px;
|
|
1140
|
+
flex-shrink: 0;
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1018
1143
|
.cd-chat-msg-pills {
|
|
1019
1144
|
display: flex;
|
|
1020
1145
|
flex-wrap: wrap;
|
|
@@ -1899,6 +2024,42 @@ select:focus-visible {
|
|
|
1899
2024
|
border-top: 1px solid var(--cd-border);
|
|
1900
2025
|
}
|
|
1901
2026
|
|
|
2027
|
+
.cd-edit-banner {
|
|
2028
|
+
display: flex;
|
|
2029
|
+
align-items: center;
|
|
2030
|
+
justify-content: space-between;
|
|
2031
|
+
gap: 8px;
|
|
2032
|
+
padding: 6px 12px;
|
|
2033
|
+
background: var(--cd-accent-soft);
|
|
2034
|
+
border-bottom: 1px solid var(--cd-border-subtle);
|
|
2035
|
+
font-size: 12px;
|
|
2036
|
+
color: var(--cd-ink);
|
|
2037
|
+
}
|
|
2038
|
+
|
|
2039
|
+
.cd-edit-banner[hidden] {
|
|
2040
|
+
display: none !important;
|
|
2041
|
+
}
|
|
2042
|
+
|
|
2043
|
+
.cd-edit-banner-info {
|
|
2044
|
+
display: inline-flex;
|
|
2045
|
+
align-items: center;
|
|
2046
|
+
gap: 6px;
|
|
2047
|
+
min-width: 0;
|
|
2048
|
+
font-weight: 600;
|
|
2049
|
+
color: var(--cd-accent-hover);
|
|
2050
|
+
}
|
|
2051
|
+
|
|
2052
|
+
.cd-edit-banner-info svg {
|
|
2053
|
+
color: var(--cd-accent-hover);
|
|
2054
|
+
flex-shrink: 0;
|
|
2055
|
+
}
|
|
2056
|
+
|
|
2057
|
+
.cd-edit-banner-id {
|
|
2058
|
+
font-family: var(--cd-mono);
|
|
2059
|
+
font-size: 11px;
|
|
2060
|
+
font-variant-numeric: tabular-nums;
|
|
2061
|
+
}
|
|
2062
|
+
|
|
1902
2063
|
.cd-textarea {
|
|
1903
2064
|
width: 100%;
|
|
1904
2065
|
min-height: 68px;
|
|
@@ -1979,6 +2140,24 @@ select:focus-visible {
|
|
|
1979
2140
|
border-color: #252a34;
|
|
1980
2141
|
}
|
|
1981
2142
|
|
|
2143
|
+
.cd-btn-xs {
|
|
2144
|
+
padding: 3px 8px;
|
|
2145
|
+
font-size: 11.5px;
|
|
2146
|
+
border-radius: 6px;
|
|
2147
|
+
}
|
|
2148
|
+
|
|
2149
|
+
.cd-btn-danger {
|
|
2150
|
+
background: var(--cd-danger);
|
|
2151
|
+
border-color: var(--cd-danger);
|
|
2152
|
+
color: #ffffff;
|
|
2153
|
+
font-weight: 600;
|
|
2154
|
+
}
|
|
2155
|
+
|
|
2156
|
+
.cd-btn-danger:hover:not(:disabled) {
|
|
2157
|
+
background: #991b1b;
|
|
2158
|
+
border-color: #991b1b;
|
|
2159
|
+
}
|
|
2160
|
+
|
|
1982
2161
|
@media (max-width: 560px) {
|
|
1983
2162
|
.cd-composer,
|
|
1984
2163
|
.cd-compact-bar {
|
|
@@ -2006,6 +2185,8 @@ select:focus-visible {
|
|
|
2006
2185
|
.cd-corner-flap,
|
|
2007
2186
|
.cd-drag-pin-head,
|
|
2008
2187
|
.cd-composer,
|
|
2188
|
+
.cd-chat-msg,
|
|
2189
|
+
.cd-msg-action-btn,
|
|
2009
2190
|
.cd-agent-sidebar,
|
|
2010
2191
|
.cd-skeleton-bar {
|
|
2011
2192
|
animation: none !important;
|
|
@@ -54,6 +54,7 @@ export interface SmartComponentDescription {
|
|
|
54
54
|
|
|
55
55
|
export interface PendingAttachmentItem {
|
|
56
56
|
id: string;
|
|
57
|
+
existing_attachment_id?: number | string;
|
|
57
58
|
attachment_type: "image" | "screenshot";
|
|
58
59
|
label: string;
|
|
59
60
|
preview_url: string;
|
|
@@ -65,17 +66,36 @@ export interface PendingAttachmentItem {
|
|
|
65
66
|
metadata: Record<string, unknown>;
|
|
66
67
|
}
|
|
67
68
|
|
|
69
|
+
export interface SessionFeedbackAttachmentItem {
|
|
70
|
+
id: string;
|
|
71
|
+
server_id?: number | string;
|
|
72
|
+
label: string;
|
|
73
|
+
preview_url: string;
|
|
74
|
+
attachment_type: "image" | "screenshot";
|
|
75
|
+
filename?: string | null;
|
|
76
|
+
signed_blob_id?: string;
|
|
77
|
+
data_url?: string;
|
|
78
|
+
element_reference_ref?: string | null;
|
|
79
|
+
metadata?: Record<string, unknown>;
|
|
80
|
+
}
|
|
81
|
+
|
|
68
82
|
export interface SessionFeedbackEntry {
|
|
69
83
|
id: number | string;
|
|
70
84
|
message: string;
|
|
85
|
+
rawMessage?: string;
|
|
71
86
|
createdAt: string;
|
|
87
|
+
rawCreatedAt?: string;
|
|
88
|
+
rawUpdatedAt?: string;
|
|
89
|
+
isEdited?: boolean;
|
|
90
|
+
status?: string;
|
|
91
|
+
ownershipToken?: string;
|
|
72
92
|
elements: ElementReferenceSnapshot[];
|
|
73
|
-
attachments:
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
93
|
+
attachments: SessionFeedbackAttachmentItem[];
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface ContextDropApiClientOptions {
|
|
97
|
+
credentials?: RequestCredentials;
|
|
98
|
+
headers?: Record<string, string>;
|
|
79
99
|
}
|
|
80
100
|
|
|
81
101
|
export interface WidgetConfig {
|
|
@@ -122,6 +142,73 @@ export interface FeedbackSubmissionPayload {
|
|
|
122
142
|
}>;
|
|
123
143
|
}
|
|
124
144
|
|
|
145
|
+
export interface OwnFeedbackAttachment {
|
|
146
|
+
id: number | string;
|
|
147
|
+
attachment_type: "image" | "screenshot";
|
|
148
|
+
filename: string | null;
|
|
149
|
+
content_type?: string | null;
|
|
150
|
+
byte_size?: number | null;
|
|
151
|
+
element_reference_ref?: string | null;
|
|
152
|
+
metadata?: Record<string, unknown>;
|
|
153
|
+
created_at?: string;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export interface OwnFeedbackRecord {
|
|
157
|
+
id: number;
|
|
158
|
+
environment?: string;
|
|
159
|
+
message: string;
|
|
160
|
+
page_url?: string;
|
|
161
|
+
status: string;
|
|
162
|
+
metadata?: Record<string, unknown>;
|
|
163
|
+
attachments_count: number;
|
|
164
|
+
element_references_count: number;
|
|
165
|
+
element_references: ElementReferenceSnapshot[];
|
|
166
|
+
attachments: OwnFeedbackAttachment[];
|
|
167
|
+
created_at: string;
|
|
168
|
+
updated_at: string;
|
|
169
|
+
ownership_token?: string;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export interface OwnFeedbackListResponse {
|
|
173
|
+
total_count: number;
|
|
174
|
+
feedbacks: OwnFeedbackRecord[];
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export interface FeedbackAttachmentUpdateInput {
|
|
178
|
+
existing_id?: number | string;
|
|
179
|
+
attachment_type?: "image" | "screenshot";
|
|
180
|
+
filename?: string;
|
|
181
|
+
signed_blob_id?: string;
|
|
182
|
+
data_url?: string;
|
|
183
|
+
element_reference_ref?: string;
|
|
184
|
+
metadata?: Record<string, unknown>;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export interface FeedbackUpdatePayload {
|
|
188
|
+
message: string;
|
|
189
|
+
metadata?: Record<string, unknown>;
|
|
190
|
+
element_references: ElementReferenceSnapshot[];
|
|
191
|
+
attachments: FeedbackAttachmentUpdateInput[];
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export interface FeedbackUpdateResponse {
|
|
195
|
+
id: number;
|
|
196
|
+
environment?: string;
|
|
197
|
+
status: string;
|
|
198
|
+
attachments_count: number;
|
|
199
|
+
element_references_count: number;
|
|
200
|
+
created_at: string;
|
|
201
|
+
updated_at: string;
|
|
202
|
+
ownership_token?: string;
|
|
203
|
+
feedback?: OwnFeedbackRecord;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export interface FeedbackDeleteResponse {
|
|
207
|
+
id: number;
|
|
208
|
+
deleted: boolean;
|
|
209
|
+
deleted_at: string;
|
|
210
|
+
}
|
|
211
|
+
|
|
125
212
|
export interface FeedbackSubmissionResponse {
|
|
126
213
|
id: number;
|
|
127
214
|
environment?: string;
|
|
@@ -129,6 +216,9 @@ export interface FeedbackSubmissionResponse {
|
|
|
129
216
|
attachments_count: number;
|
|
130
217
|
element_references_count: number;
|
|
131
218
|
created_at: string;
|
|
219
|
+
updated_at?: string;
|
|
220
|
+
ownership_token?: string;
|
|
221
|
+
feedback?: OwnFeedbackRecord;
|
|
132
222
|
}
|
|
133
223
|
|
|
134
224
|
export interface AgentProviderInfo {
|