Skip to content

Commit fc01c34

Browse files
committed
fix: more qa issues
1 parent a894309 commit fc01c34

File tree

3 files changed

+19
-46
lines changed

3 files changed

+19
-46
lines changed

apps/frontend/src/components/ui/moderation/ModerationTechRevCard.vue

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,12 @@ function backToFileList() {
132132
selectedFile.value = null
133133
}
134134
135-
async function copyToClipboard(code: string) {
135+
async function copyToClipboard(code: string, detailId: string) {
136136
try {
137137
await navigator.clipboard.writeText(code)
138-
showCopyFeedback.value = true
138+
showCopyFeedback.value.set(detailId, true)
139139
setTimeout(() => {
140-
showCopyFeedback.value = false
140+
showCopyFeedback.value.delete(detailId)
141141
}, 2000)
142142
} catch (error) {
143143
console.error('Failed to copy code:', error)
@@ -157,7 +157,7 @@ async function updateIssueStatus(
157157
}
158158
159159
const expandedIssues = ref<Set<string>>(new Set())
160-
const showCopyFeedback = ref(false)
160+
const showCopyFeedback = ref<Map<string, boolean>>(new Map())
161161
162162
function toggleIssue(issueId: string) {
163163
if (expandedIssues.value.has(issueId)) {
@@ -382,14 +382,13 @@ function toggleIssue(issueId: string) {
382382
class="border-x border-b border-t-0 border-solid border-surface-3 bg-surface-2"
383383
:class="{ 'rounded-bl-2xl rounded-br-2xl': idx === selectedFile.issues.length - 1 }"
384384
>
385-
<div class="flex items-center justify-between p-4">
385+
<div
386+
class="flex cursor-pointer items-center justify-between p-4 transition-colors hover:bg-surface-3"
387+
@click="toggleIssue(issue.id)"
388+
>
386389
<div class="my-auto flex items-center gap-2">
387390
<ButtonStyled type="transparent" circular>
388-
<button
389-
class="transition-transform"
390-
:class="{ 'rotate-180': !expandedIssues.has(issue.id) }"
391-
@click="toggleIssue(issue.id)"
392-
>
391+
<button class="transition-transform" :class="{ 'rotate-180': expandedIssues.has(issue.id) }">
393392
<ChevronDownIcon class="h-5 w-5 text-contrast" />
394393
</button>
395394
</ButtonStyled>
@@ -417,7 +416,7 @@ function toggleIssue(issueId: string) {
417416
</div>
418417
</div>
419418

420-
<div class="flex items-center gap-2">
419+
<div class="flex items-center gap-2" @click.stop>
421420
<ButtonStyled color="brand" type="outlined">
422421
<button class="!border-[1px]" @click="updateIssueStatus(issue.id, 'safe')">
423422
Safe
@@ -448,9 +447,9 @@ function toggleIssue(issueId: string) {
448447
<button
449448
v-tooltip="`Copy code`"
450449
class="absolute right-2 top-2 border-[1px]"
451-
@click="copyToClipboard(detail.decompiled_source)"
450+
@click="copyToClipboard(detail.decompiled_source, `${issue.id}-${detailIdx}`)"
452451
>
453-
<CopyIcon v-if="!showCopyFeedback" />
452+
<CopyIcon v-if="!showCopyFeedback.get(`${issue.id}-${detailIdx}`)" />
454453
<CheckIcon v-else />
455454
</button>
456455
</ButtonStyled>

apps/frontend/src/pages/moderation/technical-review.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ watch(currentSortType, () => {
327327
<SearchIcon aria-hidden="true" class="text-lg" />
328328
<input
329329
v-model="query"
330-
class="h-[40px]"
330+
class="h-4"
331331
autocomplete="off"
332332
spellcheck="false"
333333
type="text"

packages/api-client/src/modules/labrinth/types.ts

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ISO3166 } from '../iso3166/types'
1+
import type { ISO3166 } from '..'
22

33
export namespace Labrinth {
44
export namespace Billing {
@@ -13,7 +13,7 @@ export namespace Labrinth {
1313
price_id: string
1414
interval: PriceDuration
1515
status: SubscriptionStatus
16-
created: string // ISO datetime string
16+
created: string
1717
metadata?: SubscriptionMetadata
1818
}
1919

@@ -40,8 +40,8 @@ export namespace Labrinth {
4040
amount: number
4141
currency_code: string
4242
status: ChargeStatus
43-
due: string // ISO datetime string
44-
last_attempt: string | null // ISO datetime string
43+
due: string
44+
last_attempt: string | null
4545
type: ChargeType
4646
subscription_id: string | null
4747
subscription_interval: PriceDuration | null
@@ -339,7 +339,7 @@ export namespace Labrinth {
339339

340340
/**
341341
* @deprecated Not recommended to use.
342-
*/
342+
**/
343343
[key: string]: unknown
344344
}
345345

@@ -383,7 +383,7 @@ export namespace Labrinth {
383383
export interface GameVersion {
384384
version: string
385385
version_type: string
386-
date: string // RFC 3339 DateTime
386+
date: string
387387
major: boolean
388388
}
389389

@@ -475,66 +475,40 @@ export namespace Labrinth {
475475
}
476476

477477
export type SearchResponse = {
478-
/** Flat list of all file reports */
479478
reports: FileReport[]
480-
/** Project data lookup by project ID */
481479
projects: Record<string, Projects.v3.Project>
482-
/** Thread data lookup by thread ID */
483480
threads: Record<string, DBThread>
484-
/** Ownership data lookup by project ID */
485481
ownership: Record<string, Ownership>
486482
}
487483

488484
export type FileReport = {
489-
/** Unique ID of this report */
490485
id: string
491-
/** ID of the scanned file */
492486
file_id: string
493-
/** ID of the version this file belongs to */
494487
version_id: string
495-
/** ID of the project this file belongs to */
496488
project_id: string
497-
/** When this report was created (ISO datetime string) */
498489
created: string
499-
/** Why this file was flagged */
500490
flag_reason: FlagReason
501-
/** Overall severity of issues in this file */
502491
severity: DelphiSeverity
503-
/** Name of the flagged file */
504492
file_name: string
505-
/** Size of the file in bytes */
506493
file_size: number
507-
/** List of issues found in this file */
508494
issues: FileIssue[]
509495
}
510496

511497
export type FileIssue = {
512-
/** Unique ID of this issue */
513498
id: string
514-
/** ID of the report this issue belongs to */
515499
report_id: string
516-
/** Type of issue (e.g., 'OBFUSCATED_NAMES', 'SUSPICIOUS_CODE') */
517500
issue_type: string
518-
/** Whether this issue is valid, false positive, or pending review */
519501
status: DelphiReportIssueStatus
520-
/** Specific details about where/why this issue was raised */
521502
details: ReportIssueDetail[]
522503
}
523504

524505
export type ReportIssueDetail = {
525-
/** Unique ID of this detail entry */
526506
id: string
527-
/** ID of the issue this detail belongs to */
528507
issue_id: string
529-
/** Key identifier for this detail (e.g., class or method name) */
530508
key: string
531-
/** File path where the issue was found (e.g., 'com/example/Class.class') */
532509
file_path: string
533-
/** Decompiled source code showing the issue (may be omitted for large files) */
534510
decompiled_source: string | null
535-
/** Additional structured metadata about this detail */
536511
data: Record<string, unknown>
537-
/** Severity level of this specific detail */
538512
severity: DelphiSeverity
539513
}
540514

0 commit comments

Comments
 (0)