Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
393aca3
flag rules backend model
aecsocket Oct 28, 2026
4bed0f5
project flag routes
aecsocket Oct 29, 2026
6873520
add rule editor frontend and rhai eval
aecsocket Oct 29, 2026
2f29c7e
wip: project flags can scan files for patterns
aecsocket Oct 29, 2026
799d773
persist scan patterns for rules
aecsocket Oct 29, 2026
600a114
more flag context
aecsocket Oct 29, 2026
8b68be6
listing and starting runs
aecsocket Nov 2, 2026
8907718
wip: consumer task for reading scan reqs
aecsocket Nov 2, 2026
660fc91
persist flag run results in db
aecsocket Nov 2, 2026
6b81dc1
run rule result persistence
aecsocket Nov 3, 2026
2676af9
route to fetch project flags
aecsocket Nov 3, 2026
35a2845
Merge branch 'main' into boris/dev-1493-flag-rules-backend
aecsocket Nov 4, 2026
05ef0eb
list runs/delete runs but keep active flags
aecsocket Nov 5, 2026
5d4347d
Merge branch 'main' into boris/dev-1493-flag-rules-backend
aecsocket Nov 5, 2026
c97cefb
allow kafka scans to not have a run_id
aecsocket Nov 5, 2026
7961dc1
sqlx prepare
aecsocket Nov 5, 2026
13efdcd
feat: surface project flags in modview
tdgao Nov 5, 2026
d28b4db
pnpm prepr
tdgao Nov 5, 2026
6d34d54
track how many scan jobs we have + how many kafka consumers
aecsocket Nov 7, 2026
62ee613
sqlx prepare
aecsocket Nov 7, 2026
927d974
default auto_resolve on add_gallery_images issue targets
clrxbl Nov 7, 2026
f1e1c63
Merge branch 'main' into boris/dev-1493-flag-rules-backend
aecsocket Nov 10, 2026
6411b67
scan size limits with env var
aecsocket Nov 10, 2026
cff217f
strip out run application
aecsocket Nov 10, 2026
6048e29
use a pending jobs ledger
aecsocket Nov 10, 2026
0b873b4
prepr
aecsocket Nov 10, 2026
811116b
disable source map uploads
aecsocket Nov 10, 2026
77b3634
address comments
aecsocket Nov 10, 2026
d82d20e
Merge branch 'boris/dev-1493-flag-rules-backend' into truman/surfacin…
tdgao Nov 11, 2026
524537f
remove mock data
tdgao Nov 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/frontend-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ jobs:
BUILD_ENV: ${{ steps.meta.outputs.env }}
PREVIEW: ${{ inputs.preview && 'true' || 'false' }}

- name: Disable server source map uploads for previews
if: ${{ inputs.preview }}
working-directory: ./apps/frontend
run: |
sed -i 's/"upload_source_maps": true/"upload_source_maps": false/g' wrangler.jsonc
- name: Install Wrangler CLI
uses: cloudflare/wrangler-action@953926a2e2182532811c01a25e53647d93bf07c0 # v4.1.3
with:
Expand Down
93 changes: 92 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ redis = "1.7.1"
regex = "1.13.1"
reqwest = { version = "0.13.5", default-features = false, features = ["form", "query"] }
rgb = "0.8.53"
rhai = "1.27.0"
rust_decimal = { version = "1.43.0", features = ["serde-with-float", "serde-with-str"] }
rust_iso3166 = "0.2.0"
rust-s3 = { version = "0.38.0", default-features = false, features = [
Expand Down Expand Up @@ -263,6 +264,7 @@ unicode-segmentation = "1.13.3"
url = "2.5.8"
urlencoding = "2.1.3"
utoipa = { version = "6.0.0", features = ["actix_extras", "chrono", "decimal"] }
utoipa-actix-web = "0.2.0"
uuid = "1.28.0"
validator = "0.21.0"
webauthn-rs = "0.5.5"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<template>
<article
class="flex min-w-0 flex-col gap-2 rounded-xl border border-solid border-surface-3 bg-surface-2 p-2.5 text-sm"
>
<div class="flex items-center gap-2">
<h3 class="m-0 flex min-w-0 flex-1 items-center gap-1.5 text-sm font-medium text-contrast">
<TagCategoryFlagIcon class="size-4 shrink-0 text-purple" aria-hidden="true" />
<span class="min-w-0 break-words">{{ flag.name || flag.key }}</span>
</h3>
<ButtonLink
v-tooltip="'View flag rule'"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Flag preview link disappears

Hovering “View flag rule” inside a flag preview removes the card before the user can click the link. The card is already inside an interactive Tooltip, but this nested v-tooltip replaces the shared activeTooltip with plain text. Remove the nested tooltip here and keep the existing aria-label.

Suggested change
v-tooltip="'View flag rule'"
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/frontend/src/components/project-review/flag-list/flag-card.vue
Line: 11

Comment:
**Flag preview link disappears**

Hovering “View flag rule” inside a flag preview removes the card before the user can click the link. The card is already inside an interactive `Tooltip`, but this nested `v-tooltip` replaces the shared `activeTooltip` with plain text. Remove the nested tooltip here and keep the existing `aria-label`.

```suggestion

```

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

type="quiet"
size="xs"
class="-my-1 -mr-1 !size-7 shrink-0 !rounded-full !p-0"
href="/moderation/project-flag"
target="_blank"
rel="noopener noreferrer"
aria-label="View flag rule"
>
<ExternalIcon class="!size-3.5 !min-h-0 !min-w-0" aria-hidden="true" />
</ButtonLink>
</div>
<p v-if="flag.reason" class="m-0 whitespace-pre-wrap break-words text-primary">
{{ flag.reason }}
</p>
<div v-if="flag.location" class="flex">
<Button
size="xs"
type="quiet"
class="!h-auto !min-h-0 !rounded-full !bg-surface-3 !px-2.5 !py-1 !text-xs !font-medium hover:!bg-surface-4"
@click="emit('reveal', flag.location.review_panel_key)"
>
<PanelTopIcon class="!size-3.5 shrink-0" aria-hidden="true" />
{{ locationTitle || flag.location.review_panel_key }}
</Button>
</div>
</article>
</template>

<script setup lang="ts">
import type { ProjectFlag } from '@modrinth/api-client'
import { ExternalIcon, PanelTopIcon, TagCategoryFlagIcon } from '@modrinth/assets'
import { Button, ButtonLink } from '@modrinth/ui'

defineProps<{ flag: ProjectFlag; locationTitle?: string }>()
const emit = defineEmits<{ reveal: [key: string] }>()
</script>
31 changes: 31 additions & 0 deletions apps/frontend/src/components/project-review/flag-list/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<template>
<div class="flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto">
<FlagCard
v-for="flag in flags"
:key="flag.key"
:flag="flag"
:location-title="locationTitle(flag.location?.review_panel_key)"
@reveal="revealPanel"
/>
<p v-if="isPending" class="m-0 text-sm text-secondary">Loading flags...</p>
<p v-else-if="isError" class="m-0 text-sm text-red">Failed to load project flags.</p>
<p v-else-if="!flags.length" class="m-0 text-sm text-secondary">
No flags on this project.
</p>
</div>
</template>

<script setup lang="ts">
import { injectReviewFlags } from '~/providers/project-review/review-flags'
import { injectReviewPanels } from '~/providers/project-review/review-panels'

import { injectReviewContext } from '../review-panel/context'
import FlagCard from './flag-card.vue'

const { flags, isPending, isError } = injectReviewFlags()
const panels = injectReviewPanels()
const { revealPanel } = injectReviewContext()
function locationTitle(key: string | undefined) {
return key ? panels.resolve({ kind: 'panel', key })?.panel.title : undefined
}
</script>
12 changes: 11 additions & 1 deletion apps/frontend/src/components/project-review/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
</div>
</div>
<IssueList v-show="activeReviewTab === 'issues'" />
<FlagList v-show="activeReviewTab === 'flags'" />
<IssueList v-show="activeReviewTab === 're-review'" re-review />
<MessageThread v-show="activeReviewTab === 'thread'" ref="messageThread" />
</section>
Expand Down Expand Up @@ -105,6 +106,7 @@ import {
import { isStaff } from '~/helpers/users.js'
import { injectProjectReviewPageContext } from '~/providers/project-review'
import { previousReviewLinkUrls } from '~/providers/project-review/project-links'
import { createReviewFlags, provideReviewFlags } from '~/providers/project-review/review-flags'
import {
createReviewMessages,
provideReviewMessages,
Expand All @@ -126,6 +128,7 @@ import {

import Description from './description/index.vue'
import Disclosures from './disclosures/index.vue'
import FlagList from './flag-list/index.vue'
import Gallery from './gallery/index.vue'
import IssueList from './issue-list/index.vue'
import IssuePicker from './issue-list/issue-picker.vue'
Expand Down Expand Up @@ -177,6 +180,7 @@ const visibleTabs = computed<readonly ProjectReviewTab[]>((previousTabs) => {
)
})
const reviewProjectId = computed(() => project.value?.id)
const reviewFlags = provideReviewFlags(createReviewFlags(reviewProjectId))
const session = provideReviewSession(createReviewSession())
const settings = useModerationSettings()
const panels = provideReviewPanels(
Expand Down Expand Up @@ -298,6 +302,7 @@ const rightPanelTabs = computed(() => [
value: 'issues',
label: `Issues (${issueCount.value})`,
},
{ value: 'flags', label: `Flags (${reviewFlags.flags.value.length})` },
])

watch(
Expand All @@ -313,7 +318,12 @@ watch(projectId, () => {
})

useShortcut('cycle-conversation', () => {
const tabs = ['issues', 'thread', ...(hasPreviousStructuredIssues.value ? ['re-review'] : [])]
const tabs = [
'issues',
'flags',
'thread',
...(hasPreviousStructuredIssues.value ? ['re-review'] : []),
]
activeReviewTab.value = tabs[(tabs.indexOf(activeReviewTab.value) + 1) % tabs.length]
shortcuts.run('reveal-right')
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
<slot name="heading-after" />
</div>
<div
v-if="$slots.right || selectedFindingCount > 0 || reReviewFindingCount > 0"
v-if="$slots.right || flagCount > 0 || selectedFindingCount > 0 || reReviewFindingCount > 0"
class="flex shrink-0 items-center gap-2"
>
<slot name="right" />
<FlagsCountBadge :panel-key="target ? panels.resolve(target)?.key : undefined" />
<ReReviewFindingsCountBadge :count="reReviewFindingCount" />
<FindingsCountBadge :count="selectedFindingCount" />
</div>
Expand All @@ -28,10 +29,12 @@
import { computed } from 'vue'

import type { ReviewTarget } from '~/providers/project-review/review'
import { injectReviewFlags } from '~/providers/project-review/review-flags'
import { injectReviewPanels } from '~/providers/project-review/review-panels'
import { injectReviewPreviousIssues } from '~/providers/project-review/review-previous-issues'

import FindingsCountBadge from '../review-panel/findings-count-badge.vue'
import FlagsCountBadge from '../review-panel/flags-count-badge.vue'
import ReviewPanel from '../review-panel/index.vue'
import ReReviewFindingsCountBadge from '../review-panel/re-review-findings-count-badge.vue'

Expand All @@ -41,6 +44,11 @@ const props = defineProps<{
}>()
const panels = injectReviewPanels()
const previousIssues = injectReviewPreviousIssues()
const reviewFlags = injectReviewFlags(null)
const flagCount = computed(() => {
const binding = props.target ? panels.resolve(props.target) : undefined
return binding ? (reviewFlags?.forPanel(binding.key).length ?? 0) : 0
})
const reReviewFindingCount = computed(() => {
const binding = props.target ? panels.resolve(props.target) : undefined
return binding ? previousIssues.reReviewFindingCount(binding) : 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
>
<slot />
<div v-if="showFindingBadge" class="absolute right-0 top-0 flex items-center gap-1">
<FlagsCountBadge :panel-key="panels.resolve(target)?.key" />
<ReReviewFindingsCountBadge :count="reReviewFindingCount" />
<FindingsCountBadge :count="selectedFindingCount" />
</div>
Expand All @@ -37,6 +38,7 @@ import { injectReviewPreviousIssues } from '~/providers/project-review/review-pr

import { injectReviewContext } from './context'
import FindingsCountBadge from './findings-count-badge.vue'
import FlagsCountBadge from './flags-count-badge.vue'
import Highlight from './highlight.vue'
import ReReviewFindingsCountBadge from './re-review-findings-count-badge.vue'

Expand Down
Loading