mirror of
https://github.com/OpenSquawk/OpenSquawk
synced 2026-08-05 17:05:53 +08:00
feat(bug-reports): trace reports by code and tell Live ATC from Classroom
Every report now gets a UUID that the notification mail quotes as "Nenne den Fehlercode <uuid> beim Commit", so a fix can be tied back to the report it closes. The mail also names the area it came from, and the comment field is relabelled "Fehlerbeschreibung/Featurewunsch" since it collects feature wishes just as often as bugs. Classroom loses its plain feedback link and gets the same reporter as Live ATC — screenshot, arrow annotation and all. `useBugReport` takes an options object so the communications-engine snapshot stays optional; the dialog moves out of `live-atc/cockpit` now that both pages use it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,10 @@ import mongoose from 'mongoose'
|
||||
|
||||
export type BugReportStatus = 'open' | 'resolved'
|
||||
|
||||
/** Where the report was filed. Shown in the notification mail so we know which
|
||||
* part of the app to reproduce it in. */
|
||||
export type BugReportSource = 'live-atc' | 'classroom'
|
||||
|
||||
export interface PmStateSnapshot {
|
||||
flowSlug?: string
|
||||
scenarioId?: string
|
||||
@@ -13,6 +17,9 @@ export interface PmStateSnapshot {
|
||||
}
|
||||
|
||||
export interface BugReportDocument extends mongoose.Document {
|
||||
/** Stable UUID quoted in commit messages so a fix can be traced back here. */
|
||||
code: string
|
||||
source: BugReportSource
|
||||
comment: string
|
||||
contact: string
|
||||
userId?: mongoose.Types.ObjectId
|
||||
@@ -23,6 +30,10 @@ export interface BugReportDocument extends mongoose.Document {
|
||||
}
|
||||
|
||||
const bugReportSchema = new mongoose.Schema<BugReportDocument>({
|
||||
// Sparse: reports created before the code existed simply have none, and a
|
||||
// plain unique index would reject more than one of them.
|
||||
code: { type: String, required: true, unique: true, sparse: true },
|
||||
source: { type: String, enum: ['live-atc', 'classroom'], default: 'live-atc', index: true },
|
||||
comment: { type: String, required: true, trim: true, maxlength: 4000 },
|
||||
contact: { type: String, required: true, trim: true, maxlength: 200 },
|
||||
userId: { type: mongoose.Schema.Types.ObjectId, ref: 'User', index: true },
|
||||
|
||||
Reference in New Issue
Block a user