Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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: 2 additions & 4 deletions .github/scripts/transform-message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ type GitHubSchema = components['schemas'];

type GitHubUser = GitHubSchema['simple-user'];

interface GitHubAction extends Record<
'event_name' | 'actor' | 'server_url' | 'repository',
string
> {
interface GitHubAction
extends Record<'event_name' | 'actor' | 'server_url' | 'repository', string> {
action?: string;
ref?: string;
ref_name?: string;
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/self-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ jobs:

- uses: OWASP/cve-lite-cli@v1
with:
verbose: "true"
verbose: 'true'
fail-on: high
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
npm test
pnpm test
2 changes: 1 addition & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1 +1 @@
npm run build
pnpm run build
19 changes: 10 additions & 9 deletions components/Activity/Hackathon/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@ export interface HackathonHeroAction extends HackathonHeroNavItem {

export type HackathonHeroCard = Record<'title' | 'description' | 'eyebrow', string>;

export interface HackathonHeroProps extends Record<
| `visual${'Kicker' | 'Title' | 'Copy' | 'Chip'}`
| 'name'
| 'subtitle'
| 'description'
| 'locationText'
| 'imageFallback',
string
> {
export interface HackathonHeroProps
extends Record<
| `visual${'Kicker' | 'Title' | 'Copy' | 'Chip'}`
| 'name'
| 'subtitle'
| 'description'
| 'locationText'
| 'imageFallback',
string
> {
agendaItems: Agenda[];
badges: ReactNode[];
bottomCard?: HackathonHeroCard;
Expand Down
6 changes: 2 additions & 4 deletions components/Activity/Hackathon/Resources.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@ export interface HackathonProjectItem {
title: string;
}

export interface HackathonResourcesProps extends Record<
`project${'Subtitle' | 'Title'}` | `template${'Subtitle' | 'Title'}`,
string
> {
export interface HackathonResourcesProps
extends Record<`project${'Subtitle' | 'Title'}` | `template${'Subtitle' | 'Title'}`, string> {
projectInitialVisible?: number;
projectItems: HackathonProjectItem[];
showLessLabel?: string;
Expand Down
12 changes: 4 additions & 8 deletions components/Activity/Hackathon/Schedule.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ export interface HackathonScheduleFact extends HackathonAwardsMeta {
meta: string;
}

export interface HackathonScheduleItem extends Record<
'id' | 'phase' | 'title' | 'description',
string
> {
export interface HackathonScheduleItem
extends Record<'id' | 'phase' | 'title' | 'description', string> {
facts: HackathonScheduleFact[];

endedAt?: TimeData;
Expand All @@ -29,10 +27,8 @@ export interface HackathonScheduleItem extends Record<
tone: HackathonScheduleTone;
}

export interface HackathonScheduleProps extends Record<
'title' | 'subtitle' | 'lead' | 'kicker' | 'stageGoalLabel',
string
> {
export interface HackathonScheduleProps
extends Record<'title' | 'subtitle' | 'lead' | 'kicker' | 'stageGoalLabel', string> {
items: HackathonScheduleItem[];
keyDates?: {
label: string;
Expand Down
48 changes: 22 additions & 26 deletions components/Activity/Hackathon/theme.less
Original file line number Diff line number Diff line change
Expand Up @@ -14,49 +14,45 @@
@body: 'Outfit', 'Avenir Next', 'Segoe UI', sans-serif;

.panel-card() {
backdrop-filter: blur(18px);
box-shadow: @shadow;
border: 1px solid @border;
border-radius: 28px;
background: @panel;
backdrop-filter: blur(18px);
}

.section-shell() {
position: relative;
background: linear-gradient(180deg, rgba(5, 8, 20, 0.98), rgba(7, 12, 26, 0.98));
padding: clamp(4rem, 7vw, 6rem) 0;
background: linear-gradient(
180deg,
rgba(5, 8, 20, 0.98),
rgba(7, 12, 26, 0.98)
);
color: @copy;
}

.section-frame() {
.section {
.section-shell();
;
}

.sectionHeader {
.section-header();
;
}

.sectionTitle {
.section-title();
;
}

.sectionSubtitle {
.section-subtitle();
;
}

.accentLine {
.accent-line();
;
}
}
Comment on lines 31 to 51

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

.section-frame() mixin 内部调用被清空,将导致下游样式完全丢失

此 mixin 内的所有嵌套选择器(.section.sectionHeader.sectionTitle.sectionSubtitle.accentLine)原本应调用对应的子 mixin 以生成样式,现在全部被替换为空语句 ;

根据 Overview.module.less 等下游文件直接调用 .section-frame(),这意味着这些选择器将编译为空规则集,导致 Hackathon 页面的 section 布局、标题、副标题、装饰线样式全部丢失。

🐛 建议恢复 mixin 调用
 .section-frame() {
   .section {
-    ;
+    .section-shell();
   }

   .sectionHeader {
-    ;
+    .section-header();
   }

   .sectionTitle {
-    ;
+    .section-title();
   }

   .sectionSubtitle {
-    ;
+    .section-subtitle();
   }

   .accentLine {
-    ;
+    .accent-line();
   }
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
.section-frame() {
.section {
.section-shell();
;
}
.sectionHeader {
.section-header();
;
}
.sectionTitle {
.section-title();
;
}
.sectionSubtitle {
.section-subtitle();
;
}
.accentLine {
.accent-line();
;
}
}
.section-frame() {
.section {
.section-shell();
}
.sectionHeader {
.section-header();
}
.sectionTitle {
.section-title();
}
.sectionSubtitle {
.section-subtitle();
}
.accentLine {
.accent-line();
}
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@components/Activity/Hackathon/theme.less` around lines 31 - 51, The
`.section-frame()` mixin is missing its internal mixin calls and only contains
empty statements. Replace the empty semicolons in the nested selectors
`.section`, `.sectionHeader`, `.sectionTitle`, `.sectionSubtitle`, and
`.accentLine` with their corresponding mixin calls (e.g., `.section()` for the
`.section` selector, `.sectionHeader()` for the `.sectionHeader` selector, and
so on). This will restore the style generation for these elements that
downstream files like `Overview.module.less` depend on when calling
`.section-frame()`.


.section-header() {
text-align: center;
margin-bottom: clamp(2.3rem, 4vw, 3rem);
text-align: center;
}

.section-title() {
Expand All @@ -66,35 +62,35 @@
background-clip: text;
-webkit-background-clip: text;
color: transparent;
font-family: @heading;
font-size: clamp(1.9rem, 4vw, 2.6rem);
font-weight: 900;
font-size: clamp(1.9rem, 4vw, 2.6rem);
font-family: @heading;
letter-spacing: 0.12em;
text-transform: uppercase;
}

.section-subtitle() {
color: @muted;
font-family: @heading;
font-size: 0.75rem;
font-weight: 700;
font-size: 0.75rem;
font-family: @heading;
letter-spacing: 0.12em;
text-transform: uppercase;
}

.accent-line() {
width: 72px;
height: 2px;
margin: 1rem auto 0;
box-shadow: 0 0 14px rgba(44, 232, 255, 0.32);
border-radius: 999px;
background: linear-gradient(90deg, @cyan, @purple);
box-shadow: 0 0 14px rgba(44, 232, 255, 0.32);
width: 72px;
height: 2px;
}

.button-base() {
display: inline-flex;
align-items: center;
justify-content: center;
align-items: center;
gap: 0.5rem;
transition:
transform 0.22s ease,
Expand All @@ -105,9 +101,9 @@
border: 1px solid transparent;
border-radius: 10px;
padding: 0.9rem 1.35rem;
font-family: @heading;
font-size: 0.82rem;
font-weight: 700;
font-size: 0.82rem;
font-family: @heading;
letter-spacing: 0.08em;
text-align: center;
text-decoration: none;
Expand All @@ -120,7 +116,7 @@
}

.button-primary() {
.button-base();
;
box-shadow: 0 0 24px rgba(44, 232, 255, 0.18);
border-color: rgba(44, 232, 255, 0.3);
background: rgba(44, 232, 255, 0.12);
Expand All @@ -134,7 +130,7 @@
}

.button-ghost() {
.button-base();
;
border-color: rgba(255, 255, 255, 0.14);
background: rgba(255, 255, 255, 0.04);
color: @copy;
Expand All @@ -148,9 +144,9 @@

.eyebrow() {
color: @muted;
font-family: @heading;
font-size: 0.75rem;
font-weight: 700;
font-size: 0.75rem;
font-family: @heading;
letter-spacing: 0.12em;
text-transform: uppercase;
}
Expand Down
2 changes: 1 addition & 1 deletion components/Layout/CardPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Col, Pagination, Row } from 'react-bootstrap';
import { SearchPageMeta } from '../../models/System';

export interface CardPageProps extends SearchPageMeta {
Card: ComponentClass<any> | FC<any>;
Card: ComponentClass<Record<string, unknown>> | FC<Record<string, unknown>>;
cardLinkOf?: (id: string) => string;
pageLinkOf: (page: number) => string;
}
Comment on lines 6 to 10

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# 检查 ActivityCard、ProjectCard、OrganizationCard 的 props 接口定义
rg -n -A 8 'export.*ActivityCard|export.*ProjectCard' --type=tsx | head -50
rg -n -A 10 'export interface.*CardProps|type.*CardProps' --type=tsx | grep -E '(Activity|Project|Organization)Card'

Repository: Open-Source-Bazaar/Open-Source-Bazaar.github.io

Length of output: 147


🏁 Script executed:

#!/bin/bash
# Find card component files
fd -e tsx -e ts | grep -i 'card' | head -20

Repository: Open-Source-Bazaar/Open-Source-Bazaar.github.io

Length of output: 397


🏁 Script executed:

#!/bin/bash
# Search for ActivityCard, ProjectCard, OrganizationCard definitions
rg -n "export.*ActivityCard\|export.*ProjectCard\|export.*OrganizationCard" | head -30

Repository: Open-Source-Bazaar/Open-Source-Bazaar.github.io

Length of output: 73


🏁 Script executed:

#!/bin/bash
# Check CardPage.tsx to see how Card is used
cat -n components/Layout/CardPage.tsx

Repository: Open-Source-Bazaar/Open-Source-Bazaar.github.io

Length of output: 1420


🏁 Script executed:

#!/bin/bash
# Check Activity Card props
head -30 components/Activity/Card.tsx

Repository: Open-Source-Bazaar/Open-Source-Bazaar.github.io

Length of output: 907


🏁 Script executed:

#!/bin/bash
# Check Project Card props
head -30 components/Project/Card.tsx

Repository: Open-Source-Bazaar/Open-Source-Bazaar.github.io

Length of output: 528


🏁 Script executed:

#!/bin/bash
# Check Organization Card props
head -30 components/Organization/Card.tsx

Repository: Open-Source-Bazaar/Open-Source-Bazaar.github.io

Length of output: 1106


CardPageProps.Card 类型收窄存在兼容性问题。

Card 类型收窄为 ComponentClass<Record<string, unknown>> | FC<Record<string, unknown>> 无法安全匹配现有卡片组件的实际签名:

  • ActivityCardFC<ActivityCardProps extends Activity>):接受 className,但 linkOf 被忽略
  • ProjectCardFC<Project>):不接受 className,不接受 linkOf,两者都被忽略
  • OrganizationCardFC<OrganizationCardProps>):接受 className,但 linkOf 被忽略

CardPage.tsx 第 24 行实际传递了 className="h-100"linkOf={cardLinkOf},但 ProjectCard 会忽略 className,三个卡片组件都不使用 linkOf。这表明 Record<string, unknown> 的类型声明宣称的灵活性与实现不符。应改为更精确的联合类型或为各卡片组件补充缺失的 props 定义。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@components/Layout/CardPage.tsx` around lines 6 - 10, Replace the overly broad
`Record<string, unknown>` type for the Card property in CardPageProps with a
precise union type that accurately reflects the actual prop signatures of
ActivityCard, ProjectCard, and OrganizationCard. Alternatively, update each card
component to properly accept and handle the className and linkOf props that
CardPage.tsx is passing on line 24, rather than ignoring them. Choose the
approach that best aligns with your component design intent: either define Card
as a union of the three specific card component types with their actual prop
interfaces, or extend each card component's prop interface to include className
and linkOf parameters.

Expand Down
2 changes: 1 addition & 1 deletion components/License/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ export const licenseTips = ({ t }: typeof i18n): LicenseTips => ({
privacyLoophole: [{ text: t('tip_privacy_loophole') }],
marketingEndorsement: [{ text: t('tip_marketing_endorsement') }],
infectionRange: [{ text: t('tip_infection_range') }],
});
});
7 changes: 2 additions & 5 deletions components/Map/ChinaMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ import { OpenReactMap, OpenReactMapProps, TileLayer } from 'open-react-map';
import { FC } from 'react';

const ChinaMap: FC<OpenReactMapProps> = props => (
<OpenReactMap
{...props}
renderTileLayer={() => <TileLayer vendor="GaoDe" />}
/>
<OpenReactMap {...props} renderTileLayer={() => <TileLayer vendor="GaoDe" />} />
);
export default ChinaMap;
export default ChinaMap;
12 changes: 12 additions & 0 deletions components/Navigator/MainNavigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ const topNavBarMenu = ({ t }: typeof i18n): MenuItem[] => [
{ href: '/recipe', title: t('recipe') },
],
},
{
href: '/open-library',
name: t('open_library'),
},
Comment on lines +84 to +87

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

新菜单项字段名写错,破坏 MenuItem 契约。

Line 86 使用了 name,但 MenuItem 定义要求的是 title。这会触发类型错误,并导致导航渲染读取不到标题字段。

建议修复
   {
     href: '/open-library',
-    name: t('open_library'),
+    title: t('open_library'),
   },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{
href: '/open-library',
name: t('open_library'),
},
{
href: '/open-library',
title: t('open_library'),
},
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@components/Navigator/MainNavigator.tsx` around lines 84 - 87, The menu item
object for the open-library navigation route uses the incorrect field name
`name` when the MenuItem interface contract requires the field to be named
`title`. Change the property name from `name` to `title` in the navigation item
object that contains href set to '/open-library'. This will align with the
MenuItem type definition and ensure the navigation title is properly rendered.

];

export interface MainNavigatorProps {
Expand All @@ -94,6 +98,14 @@ export const MainNavigator: FC<MainNavigatorProps> = observer(({ menu }) => {

menu ||= topNavBarMenu(i18n);

// 检查是否是 Open Library 路径
const isOpenLibraryPath = pathname.startsWith('/open-library');

// 如果是 Open Library 路径,不渲染主站导航栏
if (isOpenLibraryPath) {
return null;
}

return (
<Navbar bg="dark" variant="dark" fixed="top" expand="lg">
<Container>
Expand Down
3 changes: 1 addition & 2 deletions components/Navigator/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ import { I18nContext } from '../../models/Translation';
import styles from './SearchBar.module.less';

export interface SearchBarProps
extends
Omit<FormProps, 'onChange'>,
extends Omit<FormProps, 'onChange'>,
Pick<InputGroupProps, 'size'>,
Pick<FormControlProps, 'name' | 'placeholder' | 'defaultValue' | 'value' | 'onChange'> {
expanded?: boolean;
Expand Down
3 changes: 1 addition & 2 deletions components/Organization/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import { i18n, I18nContext } from '../../models/Translation';
import { Organization } from '../../models/Organization';

export interface OrganizationCardProps
extends
Pick<HTMLAttributes<HTMLDivElement>, 'className' | 'style'>,
extends Pick<HTMLAttributes<HTMLDivElement>, 'className' | 'style'>,
Omit<Organization, 'id'>,
CardProps {
onSwitch?: (filter: Partial<Pick<Organization, 'entityType' | 'coverageArea'>>) => any;
Expand Down
Loading
Loading