-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[view] vscode 테마 컬러 가져오기 및 git lens 분석 내용 공유 #119
Comments
와👍👍👍 정성스럽게 분석해주셔서 너무 감사합니다!! |
지금은 개발 초반단계고 일정에 쫓겨서 힘들지만, 한번은 git lens 코드를 보고 또 써볼만 한것 같아용. 👍 (궁금) commit graph 와 file history view는 유료인 것 같던데 한슬님 결제하셨나요? @__@? 저는 3일의 trial 기간으로 사용했습니다 |
@wherehows 혹시 github에 학생 계정 연동하셨나요? 그러면 기간 제한 없이 무료로 이용 가능하더라구요~! |
WOW 진짜 분석 멋집니다!!!! 제가 알기로도 theme main color를 가져오는 방법은 정식(?)으로는 없는데, 올려주신 workaround를 생각해볼 수도 있겠네요. �--- 조금 결이 다른 얘기를 하자면, 개인적으로는 theme color에 민감하게 반응하지 않아도 될 것 같습니다. 그래서, 저희는 light/dark 2가지 모드만 생각해도 충분할 것 같긴합니다. 아무튼 멋진 분석 감사합니다. 다음번에는 gitLens의 시각화 자체에 대해서도 좀 얘기해보면 좋겠네요 :- ) |
와우 자세한 분석 감사합니다. |
오ㅏ 너무 훌륭합니다,,, 최고에요 ㅋㅋㅋ 저도 한번 공부해봐야겠네요 감사합니다. |
vscode theme color에 접근하는 방법 및 githru에 적용 관련해서 리서치를 했습니다. 그래서 아래 gitlens처럼 vscode theme 컬러가 달라질 때, 아래 gitlens+의 CommitGraph와 Visual File History 처럼 배경화면색도 그에 맞게 변하는 기능을 구현하려는게 목적이었는데요.
vscode api로는 theme color에 마땅히 접근할 방법이 없었습니다. onDidChangeActiveThemeColor api가 있지만 접근해서 뭘 하기 유의미한 데이터를 제공하지 않습니다.
onDidChangeActiveThemeColor api에 대해서 조금 설명을 드리면, 호출시 이벤트 핸들러의 인자로 kind 프로퍼티가 오는데, kind에 할당되는 숫자가 theme의 변경에 따라서 바뀌지만, 몇몇 theme은 같은 숫자를 공유하기 때문에 의미가 없습니다.
그래서 어제 오늘 git lens를 분해해봤는데요. 앞서 말한 CommitGraph와 Visual File History를 생성할 때 document.body에 Mutation Observer를 등록해서 컬러를 업데이트 하고있습니다.(코드는 맨 아래에 있스빈다) 이를 저희쪽에서 이용한다면 아래와 같이 코드를 작성할 수 있습니다.
테마를 바꿀때 출력되는 gif를 보면 아래와 같습니다. 웹뷰를 띄우고 개발자 도구( command + Option + i)에서 콘솔을 찍은 것 입니다.
getPropertyValue로 가져올 수 있는 vscode theme color들은 다음과 같습니다.
git lens에서는 아래와 같이 몇 가지 vscode theme color를 가져와서 자신들이 제공하는 feature가 vscode theme과 잘 녹아들게 하는 것 같습니다. (실제로 어디에, 어떻게 적용되는지는 모르겠습니다. 로컬에서 git lens extension 코드를 돌려도 프리미엄인 commit graph 나 file history view에는 접근할 수가 없어요. ㅜ_ㅜ)
그런데 아래 gif처럼, 단순히 background-color: transparent로 두어도 정상적으로 theme color가 반영이 되기 때문에, git lens처럼 컬러를 섬세하게 표현하고 검토해야하는 상황이 못된다면 background-color를 transparent하게 두는게 좋을 것 같습니다.
git lens 분석 내용 공유
git lens 파일을 조금 까본 내용을 공유드립니다. 아마 누군가는 git lens를 볼 일이 있을 것 같아서요. 조금이라도 삽질을 줄이셨으면 하는 마음에서...
git lens는 저희와는 다르게 Yeoman과 Vscode Extension Generator를 이용하지 않고, 밑바닥부터 환경을 구성한 것 같습니다.
commit graph와 file history view 렌더링 관련 코드를 위치 ( src/webview/apps/plus)
graph.ts 내부에서 graph.html 내부의 전체적인 상태와 마크업을 GraphWrapper가 그려주어 commit graph를 보여주고, timeline.ts 내부에서 timeline.html 내부의 전체적인 상태와 마크업을 chart.ts가 그려주어 Time Line(File History View)을 렌더링합니다. 화면에 보여지는 것은 왠만해선 이 폴더에서 다루어집니다.
The text was updated successfully, but these errors were encountered: