Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@import "styles/app";

.commit-message__issue-link {

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.

의견입니다ㅎㅎ

이제 이름이 생겼으니 스타일에서도 .github-issue-link 이런 느낌으로 쓰는거 어떨까요

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

의견 감사합니다!!
분리에만 집중하다보니 놓쳤네요. 저도 컴포넌트명이랑 통일시키는 게 좋은 것 같습니다 ㅎㅎ 다음 작업 때 반영해 보겠습니다😄

color: var(--color-primary);
text-decoration: none;
font-weight: 500;
padding: 0.125rem 0.25rem;
border-radius: 0.125rem;
background-color: rgba(224, 96, 145, 0.1);
transition: all 0.2s ease-in-out;

&:hover {
background-color: rgba(224, 96, 145, 0.2);
text-decoration: underline;
transform: translateY(-1px);
}

&:active {
transform: translateY(0);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import cn from "classnames";

import type { GithubIssueLinkProps } from "./GithubIssueLink.type";
import "./GithubIssueLink.scss";

const GithubIssueLink = ({ owner, repo, issueNumber, className, ...rest }: GithubIssueLinkProps) => {
const issueLink = `https://github.com/${owner}/${repo}/issues/${issueNumber}`;

return (
<a
href={issueLink}
target="_blank"
rel="noopener noreferrer"
className={cn("commit-message__issue-link", className)}
title={`GitHub Issue #${issueNumber}`}
{...rest}
>
#{issueNumber}
</a>
);
};

export default GithubIssueLink;
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import type { ComponentPropsWithoutRef } from "react";

export interface GithubIssueLinkProps

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.

오오!! 고급 type 활용편인가요!!! 👍👍👍

@nxnaxx nxnaxx Oct 2, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

공통 컴포넌트로 추출하다보니 지금 사용하고 있는 두 컴포넌트 이외에도 추후에 다른 곳에서 사용될 수 있을 것 같아서 <a> 기본 속성들을 자동으로 상속해주도록 만들었습니다!

extends Omit<ComponentPropsWithoutRef<"a">, "href" | "target" | "rel" | "children"> {
owner: string;
repo: string;
issueNumber: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as GithubIssueLink } from "./GithubIssueLink";
25 changes: 2 additions & 23 deletions packages/view/src/components/Detail/Detail.scss
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
gap: 0.625rem;
width: 100%;
flex: 1;
margin-left: 0.125rem; // 아주 미세한 여백
margin-left: 0.125rem;
min-width: 0;
padding-top: 0.3rem;
padding-right: 3.125rem;
Expand All @@ -90,7 +90,6 @@
gap: 0.75rem;
margin-bottom: 0.5rem;

// 아바타를 맨 앞에 배치
.author {
width: 1.5rem;
height: 1.5rem;
Expand Down Expand Up @@ -176,7 +175,7 @@
}

.commit-item__right {
display: none; // 오른쪽 레이아웃 숨김
display: none;
}
}
}
Expand All @@ -194,23 +193,3 @@
color: $color-light-gray;
}
}

.commit-message__issue-link {
color: var(--color-primary);
text-decoration: none;
font-weight: 500;
padding: 0.125rem 0.25rem;
border-radius: 0.125rem;
background-color: rgba(224, 96, 145, 0.1);
transition: all 0.2s ease-in-out;

&:hover {
background-color: rgba(224, 96, 145, 0.2);
text-decoration: underline;
transform: translateY(-1px);
}

&:active {
transform: translateY(0);
}
}
21 changes: 8 additions & 13 deletions packages/view/src/components/Detail/Detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ import {
} from "@mui/icons-material";
import { Tooltip } from "@mui/material";

import { Author } from "components/@common/Author";
import { useGithubInfo, useDataStore } from "store";
import { Author } from "components/@common/Author";

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.

(취향, 개취), common 폴더 앞에 @골뱅이도 나중에 없애면 좋긴 하겠습니다. 이전에 common이 상단에 오는게 좋다면서 @를 붙이자고 하셨는데, 여전히 개인적으로는 뭔가 거슬리네요 😈😈😈😈😈

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

왜 해당 폴더만 @가 붙어있는지 궁금했었는데 그런 히스토리가 있었군요..!
저도 개인적으로는 변경하는 것이 좋다고 생각합니다. path alias에 주로 사용되는 접두어라 헷갈리기도 하구요

단순히 @만 제거하고 components/common/으로 남기기에는 다른 컴포넌트 폴더와 다르게 소문자라 컨벤션이 안 맞고, PascalCase로 변경하기에는 단일 컴포넌트로 오해할 수 있을 것 같은데요.
src/ 하위로 빼서 src/shared/ui/src/common/ 으로 두는 것은 어떨지 의견을 듣고 싶습니다!

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.

단순히 @만 제거하고 components/common/으로 남기기에는 다른 컴포넌트 폴더와 다르게 소문자라 컨벤션이 안 맞고, PascalCase로 변경하기에는 단일 컴포넌트로 오해할 수 있을 것 같은데요.
src/ 하위로 빼서 src/shared/ui/src/common/ 으로 두는 것은 어떨지 의견을 듣고 싶습니다!

@nxnaxx 님, 요 부분 issue로 discussion label 달고 만드시면 어떨까요?
살짝 얘기해보고 의견 받아서 반영하면 좋겠습니다.
(저는 개인적으로는 대 찬성입니다!!)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

네 이슈로 올려보겠습니다😄

import { GithubIssueLink } from "components/@common/GithubIssueLink";

import { useCommitListHide } from "./Detail.hook";
import { getCommitListDetail } from "./Detail.util";
Expand Down Expand Up @@ -57,21 +58,15 @@ const Detail = ({ clusterId, authSrcMap }: DetailProps) => {
parts.push(message.slice(lastIndex, match.index));
}

// 이슈 번호를 링크로 변환
const issueNumber = match[1].substring(1); // # 제거
const issueLink = `https://github.com/${owner}/${repo}/issues/${issueNumber}`;
const issueNumber = match[1].substring(1);

parts.push(
<a
<GithubIssueLink
key={`issue-${issueNumber}-${match.index}`}
href={issueLink}
target="_blank"
rel="noopener noreferrer"
className="commit-message__issue-link"
title={`GitHub Issue #${issueNumber}`}
>
{match[1]}
</a>
owner={owner}
repo={repo}
issueNumber={issueNumber}
/>
);

lastIndex = match.index + match[0].length;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useEffect, useState } from "react";
import ArrowDropDownCircleRoundedIcon from "@mui/icons-material/ArrowDropDownCircleRounded";

import { useGithubInfo } from "store";
import { GithubIssueLink } from "components/@common/GithubIssueLink";

import type { ContentProps } from "../Summary.type";

Expand Down Expand Up @@ -32,21 +33,15 @@ const Content = ({ content, clusterId, selectedClusterIds }: ContentProps) => {
parts.push(message.slice(lastIndex, match.index));
}

// 이슈 번호를 링크로 변환
const issueNumber = match[1].substring(1); // # 제거
const issueLink = `https://github.com/${owner}/${repo}/issues/${issueNumber}`;
const issueNumber = match[1].substring(1);

parts.push(
<a
<GithubIssueLink
key={`issue-${issueNumber}-${match.index}`}
href={issueLink}
target="_blank"
rel="noopener noreferrer"
className="summary__commit-issue-link"
title={`GitHub Issue #${issueNumber}`}
>
{match[1]}
</a>
owner={owner}
repo={repo}
issueNumber={issueNumber}
/>
);

lastIndex = match.index + match[0].length;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,23 +143,3 @@
max-height: fit-content;
padding: 0.625rem 1.075rem;
}

.summary__commit-issue-link {
color: var(--color-primary);
text-decoration: none;
font-weight: 500;
padding: 0.125rem 0.25rem;
border-radius: 0.125rem;
background-color: rgba(224, 96, 145, 0.1);
transition: all 0.2s ease-in-out;

&:hover {
background-color: rgba(224, 96, 145, 0.2);
text-decoration: underline;
transform: translateY(-1px);
}

&:active {
transform: translateY(0);
}
}
Loading