Skip to content
Open
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
1a97d79
โ™ป๏ธ chore: ํด๋” ํŒŒํŠธ ์˜ค๋ฅ˜ ์ œ๊ฑฐ
Hongji03 May 7, 2026
bb8fbf3
:sparkles: ๋งํฌ ์ƒ์„ฑ ํ™”๋ฉด ๋ฆฌํŒฉํ† ๋ง
Hongji03 May 10, 2026
cae9a16
:sparkles: ์ปค์Šคํ…€ ํ† ์ŠคํŠธ ๋ฉ”์‹œ์ง€ ์ƒ์„ฑ
Hongji03 May 10, 2026
ef003df
:sparkles: ๋งํฌ ์ƒ์„ธ ์กฐํšŒ ํ™”๋ฉด Top Bar ์ƒ์„ฑ
Hongji03 May 27, 2026
cda40a1
Merge remote-tracking branch 'origin/develop' into chore/#126-link
Hongji03 May 27, 2026
1917332
:sparkles: ๋งํฌ ์ƒ์„ธ ์กฐํšŒ ๊ธฐ๋ณธ ํ™”๋ฉด ๋ฆฌํŒฉํ† ๋ง ์™„๋ฃŒ
Hongji03 May 27, 2026
b160d51
:sparkles: ๋งํฌ ์ƒ์„ธ ์กฐํšŒ ํ™”๋ฉด์— ๋“œ๋กญ๋‹ค์šด ์ถ”๊ฐ€
Hongji03 May 28, 2026
0c1d6cc
:recycle: ์ €์žฅ๋œ ๋งํฌ ์กฐํšŒ ํ™”๋ฉด ๋ฐ ์ˆ˜์ • ํ™”๋ฉด ๋ฆฌํŒฉํ† ๋ง
Hongji03 Jun 19, 2026
522b105
:sparkles: ์ €์žฅ๋œ ๋งํฌ ์‚ญ์ œ ๋ชจ๋‹ฌ ๊ตฌํ˜„ ์™„๋ฃŒ
Hongji03 Jun 19, 2026
cd65a08
:recycle: AI ์š”์•ฝ ๋ชจ๋‹ฌ ๋ฆฌํŒฉํ† ๋ง
Hongji03 Jun 20, 2026
516e0eb
:sparkles: AI ํƒœ๊ทธ ๋ฏธ ๋งํฌ ์š”์•ฝ, AI ์š”์•ฝ Modal ์—ฐ๋™ ๊ตฌํ˜„ ์™„๋ฃŒ
Hongji03 Jun 20, 2026
ed304fb
:sparkles: LinkCardItem ๋””์ž์ธ ๋ชจ๋“ˆ์— ์ƒ์„ฑ ์™„๋ฃŒ
Hongji03 Jun 20, 2026
4b6f8d4
:sparkles: ๋งํฌ ์ƒ์„ฑ ํ™”๋ฉด ๋ฆฌํŒฉํ† ๋ง
Hongji03 May 10, 2026
eac6b65
:sparkles: ์ปค์Šคํ…€ ํ† ์ŠคํŠธ ๋ฉ”์‹œ์ง€ ์ƒ์„ฑ
Hongji03 May 10, 2026
9a82420
:sparkles: Rebase 'chore/#126-link' onto develop
Hongji03 May 27, 2026
c36b349
:sparkles: ๋งํฌ ์ƒ์„ธ ์กฐํšŒ ๊ธฐ๋ณธ ํ™”๋ฉด ๋ฆฌํŒฉํ† ๋ง ์™„๋ฃŒ
Hongji03 May 27, 2026
b34cf5a
:sparkles: ๋งํฌ ์ƒ์„ธ ์กฐํšŒ ํ™”๋ฉด์— ๋“œ๋กญ๋‹ค์šด ์ถ”๊ฐ€
Hongji03 May 28, 2026
03b924b
:recycle: ์ €์žฅ๋œ ๋งํฌ ์กฐํšŒ ํ™”๋ฉด ๋ฐ ์ˆ˜์ • ํ™”๋ฉด ๋ฆฌํŒฉํ† ๋ง
Hongji03 Jun 19, 2026
3a38cf7
:sparkles: ์ €์žฅ๋œ ๋งํฌ ์‚ญ์ œ ๋ชจ๋‹ฌ ๊ตฌํ˜„ ์™„๋ฃŒ
Hongji03 Jun 19, 2026
82d3384
:recycle: AI ์š”์•ฝ ๋ชจ๋‹ฌ ๋ฆฌํŒฉํ† ๋ง
Hongji03 Jun 20, 2026
d01469e
:sparkles: AI ํƒœ๊ทธ ๋ฏธ ๋งํฌ ์š”์•ฝ, AI ์š”์•ฝ Modal ์—ฐ๋™ ๊ตฌํ˜„ ์™„๋ฃŒ
Hongji03 Jun 20, 2026
d33e92f
:sparkles: LinkCardItem ๋””์ž์ธ ๋ชจ๋“ˆ์— ์ƒ์„ฑ ์™„๋ฃŒ
Hongji03 Jun 20, 2026
ddde533
Merge remote-tracking branch 'origin/chore/#126-link' into chore/#126โ€ฆ
Hongji03 Jun 20, 2026
7ccb07d
Merge pull request #142
KateteDeveloper Jun 21, 2026
6aa03ba
:zap: ์ƒˆ๋กœ์šด ๋งํฌ ์ €์žฅ ๋ฐ ์ €์žฅ๋œ ๋งํฌ ํ™”๋ฉด ์ค‘๋ณต ํ˜ธ์ถœ ์ œ๊ฑฐ
Hongji03 Jun 21, 2026
c57bb3d
:sparkles: LinkCardItem์— ์™ธ๋ถ€ ๋งํฌ ํŒŒ๋ผ๋ฏธํ„ฐ ์ถ”๊ฐ€
Hongji03 Jun 21, 2026
e9faa7c
:sparkles: core ๋ชจ๋“ˆ์— ์žˆ๋˜ design ๋ชจ๋“ˆ ์˜์กด์„ฑ ์ œ๊ฑฐ ์™„๋ฃŒ
Hongji03 Jun 21, 2026
6f5513f
:sparkles: ํ•˜๋‚˜์˜ CATEGORY_MAP์„ ๊ธฐ์ค€์œผ๋กœ id/name์„ ์–‘๋ฐฉํ–ฅ ์กฐํšŒํ•˜๋„๋ก ์ˆ˜์ •
Hongji03 Jun 21, 2026
7f70dea
:sparkles: SituationId๋กœ ์„ ํƒํ•˜๊ฒŒ ๋ณ€๊ฒฝ ๋ฐ Situation Map์œผ๋กœ ๊ตฌํ˜„ ๋ณ€๊ฒฝ ์™„๋ฃŒ
Hongji03 Jun 21, 2026
71f5c0d
:sparkles: SituationId๋กœ ์„ ํƒํ•˜๊ฒŒ ๋ณ€๊ฒฝ ์™„๋ฃŒ
Hongji03 Jun 21, 2026
f2fe87f
:sparkles: ํŒŒ๋ผ๋ฏธํ„ฐ๋ช… ์ง๊ด€์ ์ด๊ฒŒ ์ˆ˜์ •
Hongji03 Jun 21, 2026
ceaa443
:sparkles: graphicsLayer ๋Œ€์‹  shadow๋กœ ๋ณ€๊ฒฝ
Hongji03 Jun 21, 2026
92cf18d
Merge pull request #132
codebidoof Jun 21, 2026
155ec68
:lipstick: fillMaxWidth ์†์„ฑ๊ฐ’ ์‚ญ์ œ
Hongji03 Jun 23, 2026
523e337
:heavy_plus_sign: disign ๋ชจ๋“ˆ์— coil ์˜์กด์„ฑ ์ถ”๊ฐ€
Hongji03 Jun 23, 2026
b8f42c3
:zap: modifier ํŒŒ๋ผ๋ฏธํ„ฐ์— ์ถ”๊ฐ€
Hongji03 Jun 23, 2026
c7bb7b6
:lipstick: ๋กœ๊ณ  ํฌ๊ธฐ ์ถ•์†Œ ๋ฐ Preview์— ThemeProvider ์ถ”๊ฐ€, FontFamily ์‚ญ์ œ
Hongji03 Jun 23, 2026
9f7a772
:zap: DrawableRes ํŒŒ๋ผ๋ฏธํ„ฐ์— ์•ž์— param ์ถ”๊ฐ€ (ํŒ€์› ํ”ผ๋“œ๋ฐฑ ๋ฐ˜์˜)
Hongji03 Jun 23, 2026
97dc501
:zap: ๋„๋ฉ”์ธ ์ด๋ฏธ์ง€ ์ถ”๊ฐ€ ๋ฐ ํŒ€์› ํ”ผ๋“œ๋ฐฑ ๋ฐ˜์˜
Hongji03 Jun 23, 2026
ae715ef
:art: ์ค‘๋ณต ์ฝ”๋“œ ์‚ญ์ œ
Hongji03 Jun 23, 2026
58a76d0
:art: clickable ์˜์—ญ padding ์œ„๋กœ ์˜ฌ๋ฆฌ๊ธฐ
Hongji03 Jun 23, 2026
f83aa5e
:art: ์ƒํ™ฉ ๋ฐ ๊ฐ์ •์นฉ ์ˆ˜์ •
Hongji03 Jun 25, 2026
4177d52
:sparkles: ๋งํฌ ์ €์žฅ์— ์ƒํ™ฉ ์ •๋ณด ์ถ”๊ฐ€
Hongji03 Jun 25, 2026
1f14c4f
:sparkles: ๋งํฌ ์ƒ์„ฑ ํ™”๋ฉด ๋ฆฌํŒฉํ† ๋ง
Hongji03 May 10, 2026
14c80b2
:sparkles: ์ปค์Šคํ…€ ํ† ์ŠคํŠธ ๋ฉ”์‹œ์ง€ ์ƒ์„ฑ
Hongji03 May 10, 2026
6956155
:sparkles: Rebase 'chore/#126-link' onto develop
Hongji03 May 27, 2026
a3e4141
:sparkles: ๋งํฌ ์ƒ์„ธ ์กฐํšŒ ๊ธฐ๋ณธ ํ™”๋ฉด ๋ฆฌํŒฉํ† ๋ง ์™„๋ฃŒ
Hongji03 May 27, 2026
72b7beb
:sparkles: ๋งํฌ ์ƒ์„ธ ์กฐํšŒ ํ™”๋ฉด์— ๋“œ๋กญ๋‹ค์šด ์ถ”๊ฐ€
Hongji03 May 28, 2026
3656030
:recycle: ์ €์žฅ๋œ ๋งํฌ ์กฐํšŒ ํ™”๋ฉด ๋ฐ ์ˆ˜์ • ํ™”๋ฉด ๋ฆฌํŒฉํ† ๋ง
Hongji03 Jun 19, 2026
488e453
:sparkles: ์ €์žฅ๋œ ๋งํฌ ์‚ญ์ œ ๋ชจ๋‹ฌ ๊ตฌํ˜„ ์™„๋ฃŒ
Hongji03 Jun 19, 2026
badd798
:recycle: AI ์š”์•ฝ ๋ชจ๋‹ฌ ๋ฆฌํŒฉํ† ๋ง
Hongji03 Jun 20, 2026
15a9dcd
:sparkles: AI ํƒœ๊ทธ ๋ฏธ ๋งํฌ ์š”์•ฝ, AI ์š”์•ฝ Modal ์—ฐ๋™ ๊ตฌํ˜„ ์™„๋ฃŒ
Hongji03 Jun 20, 2026
3422028
:sparkles: LinkCardItem ๋””์ž์ธ ๋ชจ๋“ˆ์— ์ƒ์„ฑ ์™„๋ฃŒ
Hongji03 Jun 20, 2026
45b03a5
:sparkles: ๋งํฌ ์ƒ์„ธ ์กฐํšŒ ํ™”๋ฉด Top Bar ์ƒ์„ฑ
Hongji03 May 27, 2026
71c41df
:zap: ์ƒˆ๋กœ์šด ๋งํฌ ์ €์žฅ ๋ฐ ์ €์žฅ๋œ ๋งํฌ ํ™”๋ฉด ์ค‘๋ณต ํ˜ธ์ถœ ์ œ๊ฑฐ
Hongji03 Jun 21, 2026
f3e834b
:sparkles: LinkCardItem์— ์™ธ๋ถ€ ๋งํฌ ํŒŒ๋ผ๋ฏธํ„ฐ ์ถ”๊ฐ€
Hongji03 Jun 21, 2026
6bc7736
:sparkles: core ๋ชจ๋“ˆ์— ์žˆ๋˜ design ๋ชจ๋“ˆ ์˜์กด์„ฑ ์ œ๊ฑฐ ์™„๋ฃŒ
Hongji03 Jun 21, 2026
02cc312
:sparkles: ํ•˜๋‚˜์˜ CATEGORY_MAP์„ ๊ธฐ์ค€์œผ๋กœ id/name์„ ์–‘๋ฐฉํ–ฅ ์กฐํšŒํ•˜๋„๋ก ์ˆ˜์ •
Hongji03 Jun 21, 2026
0c9138c
:sparkles: SituationId๋กœ ์„ ํƒํ•˜๊ฒŒ ๋ณ€๊ฒฝ ๋ฐ Situation Map์œผ๋กœ ๊ตฌํ˜„ ๋ณ€๊ฒฝ ์™„๋ฃŒ
Hongji03 Jun 21, 2026
33e3734
:sparkles: SituationId๋กœ ์„ ํƒํ•˜๊ฒŒ ๋ณ€๊ฒฝ ์™„๋ฃŒ
Hongji03 Jun 21, 2026
d86b3ac
:sparkles: ํŒŒ๋ผ๋ฏธํ„ฐ๋ช… ์ง๊ด€์ ์ด๊ฒŒ ์ˆ˜์ •
Hongji03 Jun 21, 2026
4cf3e1b
:sparkles: graphicsLayer ๋Œ€์‹  shadow๋กœ ๋ณ€๊ฒฝ
Hongji03 Jun 21, 2026
742bb1e
:lipstick: fillMaxWidth ์†์„ฑ๊ฐ’ ์‚ญ์ œ
Hongji03 Jun 23, 2026
26cc654
:heavy_plus_sign: disign ๋ชจ๋“ˆ์— coil ์˜์กด์„ฑ ์ถ”๊ฐ€
Hongji03 Jun 23, 2026
1422b6a
:zap: modifier ํŒŒ๋ผ๋ฏธํ„ฐ์— ์ถ”๊ฐ€
Hongji03 Jun 23, 2026
0b32e8c
:lipstick: ๋กœ๊ณ  ํฌ๊ธฐ ์ถ•์†Œ ๋ฐ Preview์— ThemeProvider ์ถ”๊ฐ€, FontFamily ์‚ญ์ œ
Hongji03 Jun 23, 2026
dd8fb76
:zap: DrawableRes ํŒŒ๋ผ๋ฏธํ„ฐ์— ์•ž์— param ์ถ”๊ฐ€ (ํŒ€์› ํ”ผ๋“œ๋ฐฑ ๋ฐ˜์˜)
Hongji03 Jun 23, 2026
f3d00c4
:zap: ๋„๋ฉ”์ธ ์ด๋ฏธ์ง€ ์ถ”๊ฐ€ ๋ฐ ํŒ€์› ํ”ผ๋“œ๋ฐฑ ๋ฐ˜์˜
Hongji03 Jun 23, 2026
ac2984f
:art: ์ค‘๋ณต ์ฝ”๋“œ ์‚ญ์ œ
Hongji03 Jun 23, 2026
eb9a021
:art: clickable ์˜์—ญ padding ์œ„๋กœ ์˜ฌ๋ฆฌ๊ธฐ
Hongji03 Jun 23, 2026
406cb78
:art: ์ƒํ™ฉ ๋ฐ ๊ฐ์ •์นฉ ์ˆ˜์ •
Hongji03 Jun 25, 2026
0b5645c
:sparkles: ๋งํฌ ์ €์žฅ์— ์ƒํ™ฉ ์ •๋ณด ์ถ”๊ฐ€
Hongji03 Jun 25, 2026
8962f7e
Merge remote-tracking branch 'origin/chore/#126-link' into chore/#126โ€ฆ
Hongji03 Jun 25, 2026
7878663
:zap: null์„ ํ—ˆ์šฉ ์•ˆํ•˜๊ณ  ๊ธฐ๋ณธ๊ฐ’์„ ๋นˆ ๋ฌธ์ž์—ด๋กœ ์‚ฌ์šฉ
Hongji03 Jun 25, 2026
63218e4
:zap: FlowRow๋กœ ๊ตฌํ˜„ ๋ณ€๊ฒฝ
Hongji03 Jun 25, 2026
e9c8c57
:zap: home ๋ชจ๋“ˆ LocalColorTheme.current์—์„œ Material.linkuColors๋กœ ๋ณ€๊ฒฝ
Hongji03 Jun 25, 2026
bf47a4d
:zap: home ๋ชจ๋“ˆ clickable์—์„œ noRippleClickable๋กœ ๋ณ€๊ฒฝ
Hongji03 Jun 25, 2026
e953b32
:zap: mypage ๋ชจ๋“ˆ LocalColorTheme.current์—์„œ Material.linkuColors๋กœ ๋ณ€๊ฒฝ
Hongji03 Jun 25, 2026
4bf61d9
:zap: mypage ๋ชจ๋“ˆ clickable์—์„œ noRippleClickable๋กœ ๋ณ€๊ฒฝ
Hongji03 Jun 25, 2026
3d1dc87
:zap: shape๋ฅผ remember๋กœ ๊ฐ์‹ธ ๋ถˆํ•„์š”ํ•œ ํ• ๋‹น ๋ฐฉ์ง€
Hongji03 Jun 25, 2026
b2f49ed
:zap: clickable์—์„œ noRippleClickable๋กœ ๋ณ€๊ฒฝ
Hongji03 Jun 25, 2026
11811bb
:zap: AsyncImage๋กœ ๋ณ€๊ฒฝ
Hongji03 Jun 25, 2026
91512d1
:zap: core์— ์žˆ๋Š” EmotionType์„ ๊ณตํ†ต์ ์œผ๋กœ ์‚ฌ์šฉํ•˜๊ฒŒ ์ˆ˜์ •
Hongji03 Jun 25, 2026
5ade90b
:truck: ์•ˆ์“ฐ๋Š” ํŒŒ์ผ ์ œ๊ฑฐ
Hongji03 Jun 25, 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
146 changes: 119 additions & 27 deletions app/src/main/java/com/linku/MainApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ import com.linku.file.FileViewModel
import com.linku.file.viewmodel.folder.state.FolderStateViewModel
import com.linku.home.HomeApp
import com.linku.home.HomeViewModel
import com.linku.home.screen.SaveLinkResultScreen
import com.linku.home.component.LinkCategoryOption
import com.linku.home.screen.LinkDetailScreen
import com.linku.home.screen.SaveLinkScreen
import com.linku.linku_android.curation.curationGraph
import com.linku.login.navigation.LoginApp
Expand Down Expand Up @@ -359,7 +360,7 @@ fun MainApp(
HomeApp(
viewModel = homeViewModel,
nickname = nickname.orEmpty().ifBlank { "๋งํ" },
onNavigateToMyPage = { // TODO: ์ถ”ํ›„ ์•Œ๋ฆผ ์„ค์ • ํŽ˜์ด์ง€๋กœ ์ด๋™
onNavigateToMyPage = {
navigator.navigate(NavigationRoute.MyPage.route) {
popUpTo(navigator.graph.findStartDestination().id) {
saveState = true
Expand All @@ -369,6 +370,13 @@ fun MainApp(
restoreState = true
}
},
onNavigateToSaveLink = { url ->
homeViewModel.setUrl(url)
navigator.navigate("savelink")
},
onNavigateToLinkDetail = { linkuId ->
navigator.navigate("savelinkresult/$linkuId")
},
onShowNavBar = { showNavBar = it }
)
}
Expand Down Expand Up @@ -453,10 +461,12 @@ fun MainApp(
SaveLinkScreen(
image = vm.image,
url = vm.url,
title = vm.title,
memo = vm.memo,
selectedEmotionId = vm.selectedEmotionId,
onPickImage = { imagePicker.launch("image/*") },
onUrlChange = vm::setUrl,
onTitleChange = vm::setTitle,
onMemoChange = vm::setMemo,
onEmotionSelect = vm::selectEmotion,
onSaveClick = {
Expand Down Expand Up @@ -496,48 +506,130 @@ fun MainApp(
vm.loadCategoryColors()
}

fun emotionNameOf(id: Long?): String {
return when (id) {
1L -> "์ฆ๊ฑฐ์›€"
2L -> "ํ‰์˜จ"
3L -> "์„ค๋ ˜"
4L -> "์Šฌํ””"
5L -> "์งœ์ฆ"
6L -> "๋ถ„๋…ธ"
else -> "๊ฐ์ •"
}
}

// TODO: ์นดํ…Œ๊ณ ๋ฆฌ API ์—ฐ๋™ ํ›„ categoryId ๊ธฐ์ค€ ์‹ค์ œ ์นดํ…Œ๊ณ ๋ฆฌ๋ช…/์ƒ‰์ƒ ๋งคํ•‘์œผ๋กœ ๊ต์ฒด
fun categoryNameOf(id: Long?): String {
return when (id) {
1L -> "์–ดํ•™"
2L -> "๋‰ด์Šค"
3L -> "๊ณต๋ถ€๋ฒ•"
4L -> "ITยท๊ฐœ๋ฐœ"
5L -> "์ž๊ธฐ๊ณ„๋ฐœ"
6L -> "์ทจ์—…ยท์ด์ง"
7L -> "๋น„์ฆˆ๋‹ˆ์Šค ์ธ์‚ฌ์ดํŠธ"
8L -> "์ƒ์‚ฐ์„ฑยทํˆด"
9L -> "๋ผ์ดํ”„์Šคํƒ€์ผ"
10L -> "์‹ฌ๋ฆฌยท์ž๊ธฐ์ดํ•ด"
11L -> "์—์„ธ์ดยท์นผ๋Ÿผ"
12L -> "ํŠธ๋ Œ๋“œ"
13L -> "๋””์ž์ธยท์˜ˆ์ˆ "
14L -> "์˜์ƒยท๋ฎค์ง"
15L -> "๋ง›์ง‘ยท์—ฌํ–‰"
16L -> "๊ธฐํƒ€"
else -> "์นดํ…Œ๊ณ ๋ฆฌ"
}
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.

fun categoryIdOf(name: String): Long? {
return when (name) {
"์–ดํ•™" -> 1L
"๋‰ด์Šค" -> 2L
"๊ณต๋ถ€๋ฒ•" -> 3L
"ITยท๊ฐœ๋ฐœ" -> 4L
"์ž๊ธฐ๊ณ„๋ฐœ" -> 5L
"์ทจ์—…ยท์ด์ง" -> 6L
"๋น„์ฆˆ๋‹ˆ์Šค ์ธ์‚ฌ์ดํŠธ" -> 7L
"์ƒ์‚ฐ์„ฑยทํˆด" -> 8L
"๋ผ์ดํ”„์Šคํƒ€์ผ" -> 9L
"์‹ฌ๋ฆฌยท์ž๊ธฐ์ดํ•ด" -> 10L
"์—์„ธ์ดยท์นผ๋Ÿผ" -> 11L
"ํŠธ๋ Œ๋“œ" -> 12L
"๋””์ž์ธยท์˜ˆ์ˆ " -> 13L
"์˜์ƒยท๋ฎค์ง" -> 14L
"๋ง›์ง‘ยท์—ฌํ–‰" -> 15L
"๊ธฐํƒ€" -> 16L
else -> null
}
}

fun keywordToTags(keyword: String?): List<String> {
return keyword
.orEmpty()
.split(",", " ", "#")
.map { it.trim() }
.filter { it.isNotBlank() }
.take(4)
}

// ์ง„ํ–‰๋ฅ /์ƒ‰์ƒ ๋งต ์ˆ˜์ง‘
val aiProgress = vm.aiProgress.collectAsState().value
val categoryColorMap = vm.categoryColorMap.collectAsState().value

val categoryOptions = categoryColorMap.mapNotNull { (name, style) ->
val id = categoryIdOf(name) ?: return@mapNotNull null

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[P1] ์—ฌ๊ธฐ์„œ ์„œ๋ฒ„์—์„œ ๋‚ด๋ ค์ค€ string ๋ฐ์ดํ„ฐ๋ฅผ ๋‹ค์‹œ LongId๋กœ ์—ญ๋งคํ•‘ํ•˜๋Š”๊ฑฐ ๋งž๋‚˜์š”? ์Œ ์•„๋‹ˆ๋ฉด categoryColorMap์„ String ํ‚ค๊ฐ€ ์•„๋‹ˆ๋ผ CategoryType ํ‚ค๋กœ ๋ฐ”๊พธ๋Š” ๋ฐฉํ–ฅ์€ ์–ด๋–ค๊ฐ€์š”?

private val _categoryColorMap = MutableStateFlow<Map<CategoryType, CategoryColorStyle>>(emptyMap())

์ด๋ ‡๊ฒŒ ํ™ˆ๋ทฐ๋ชจ๋ธ์—์„œ ์•„์˜ˆ String name์„ ํ•œ ๋ฒˆ ๋ณ€ํ™˜ํ•˜๋ฉด.... ๋ญ ์—ญ ๋งคํ•‘ํ•  ํ•„์š”๋Š” ์—†์ง€ ์•Š์„๊นŒ ์‹ถ์€๋ฐ

๊ทธ๋Ÿฌ๋ฉด ์—ฌ๊ธฐ์„œ๋Š”

val categoryOptions = categoryColorMap.map { (type, style) ->
    LinkCategoryOption(
        id = type.id,
        name = type.tagName,
        color = style.color4
    )
}

์ด๋ ‡๊ฒŒ ํ•˜๋ฉด ๋  ๊ฒƒ ๊ฐ™๊ธฐ๋„ ํ•˜๊ณ ..? ์Œ ์•„๋‹ˆ๋ฉด ์•„์˜ˆ LinkCategoryOption์ด Long id๋ฅผ ๋”ฐ๋กœ ๋“ค ํ•„์š” ์—†์ด CategoryType์„ ์ง์ ‘ ๋“œ๋Š” ๋ฐฉ์‹๋„ ์žˆ์„ ๊ฒƒ ๊ฐ™์€๋ฐ ์ง€ํ˜„์ด๊ฐ€ ๊ฐœ๋ฐœํ•œ ํŒŒํŠธ์ด๋‹ˆ ํ•œ ๋ฒˆ ๋ณด๊ณ  ํŒ๋‹จํ•ด์ฃผ์„ธ์š”:)


LinkCategoryOption(
id = id,
name = name,
color = style.color4
)
}
Comment on lines +519 to +582

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

์ด๋ฆ„๋งŒ์œผ๋กœ๋„ ์œ ๋‹ˆํฌํ•œ ๋ฐ์ดํ„ฐ๋“ค์— Long ํ˜•์‹ id๊ฐ€ ๋“ค์–ด๊ฐ€๋Š” ๊ฑด ๋ถˆ์•ˆ๋ถˆ์•ˆํ•˜๋„ค์š”..

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

์ด๋„˜์œผ๋กœ ๋ฐ”๊ฟ”๋ณผ๊ฒŒ์˜ˆ


// ์™ธ๋ถ€ ๋ธŒ๋ผ์šฐ์ € ์—ด๊ธฐ
fun openUrl(url: String) {
runCatching {
val fixed = if (url.startsWith("http")) url else "https://$url"
val fixed = if (
url.startsWith("http://") || url.startsWith("https://")
) {
url
} else {
"https://$url"
}

val intent = Intent(
Intent.ACTION_VIEW,
fixed.toUri()
)

context.startActivity(intent)
}.onFailure {
Toast.makeText(context, "๋งํฌ๋ฅผ ์—ด ์ˆ˜ ์—†์–ด์š”.", Toast.LENGTH_SHORT).show()
}
}

SaveLinkResultScreen(
link = vm.linkDetail,
aiArticle = vm.aiArticleDetail,
isLoading = vm.isLoadingLinkDetail || vm.isLoadingAiArticle,
isAiLoading = vm.isLoadingAiArticle,
onBack = { navigator.popBackStack() },
onOpenLink = { url -> openUrl(url) },
categoryColorMap = categoryColorMap,
onSubmitEdit = { title, memo, categoryId, emotionId ->
vm.updateLink(
title = title,
memo = memo,
categoryId = categoryId,
emotionId = emotionId,
onSucceed = { Toast.makeText(context, "์ˆ˜์ • ์™„๋ฃŒ", Toast.LENGTH_SHORT).show() },
onFailed = { e ->
Log.e("SaveLinkResult", "์ˆ˜์ • ์‹คํŒจ", e)
Toast.makeText(context, e.message ?: "์ˆ˜์ •์— ์‹คํŒจํ–ˆ์Šต๋‹ˆ๋‹ค.", Toast.LENGTH_SHORT).show()
}
)
},
onRequestAiSummary = { vm.loadAiArticle(linkuId) },
aiProgress = aiProgress,
onCancelAi = { vm.cancelAiArticleJob() }
val linkDetail = vm.linkDetail
val aiArticle = vm.aiArticleDetail

val displayKeyword = aiArticle?.keyword?.trim().orEmpty()
.ifEmpty { linkDetail?.keyword.orEmpty() }

val displaySummary = aiArticle?.summary?.trim().orEmpty()
.ifEmpty { linkDetail?.summary.orEmpty() }

LinkDetailScreen(
linkTitle = linkDetail?.title.orEmpty(),
category = categoryNameOf(linkDetail?.categoryId),
emotion = emotionNameOf(linkDetail?.emotionId),
situation = "ํ†ตํ•™ ์ค‘", // TODO: ์ƒ์„ธ API์— situationId ์ƒ๊ธฐ๋ฉด ์‹ค์ œ ๊ฐ’์œผ๋กœ ๋ณ€๊ฒฝ
linkUrl = linkDetail?.linku.orEmpty(),
memo = linkDetail?.memo.orEmpty(),
tags = keywordToTags(displayKeyword),
aiSummary = displaySummary,
categoryOptions = categoryOptions,
onBack = {
navigator.popBackStack()
}
)
}

Expand Down
58 changes: 50 additions & 8 deletions core/src/main/java/com/linku/core/model/EmotionType.kt
Original file line number Diff line number Diff line change
@@ -1,17 +1,59 @@
package com.linku.core.model

import androidx.annotation.DrawableRes
import com.linku.design.R
Comment thread
Hongji03 marked this conversation as resolved.
Outdated

enum class EmotionType(
val id: Long,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

์š”๊ธฐ๋„

val tagName: String
val tagName: String,
@DrawableRes val imgRes: Int
Comment thread
Hongji03 marked this conversation as resolved.
Outdated
) {
JOY(1, "์ฆ๊ฑฐ์›€"),
PEACE(2, "ํ‰์˜จ"),
EXCITEMENT(3, "์„ค๋ ˜"),
SADNESS(4, "์Šฌํ””"),
ANNOYANCE(5, "์งœ์ฆ"),
ANGER(6, "๋ถ„๋…ธ");
JOY(
id = 1L,
tagName = "์ฆ๊ฑฐ์›€",
imgRes = R.drawable.ic_joy
),
CALM(
id = 2L,
tagName = "ํ‰์˜จ",
imgRes = R.drawable.ic_calm
),
EXCITE(
id = 3L,
tagName = "์„ค๋ ˜",
imgRes = R.drawable.ic_excite
),
SAD(
id = 4L,
tagName = "์Šฌํ””",
imgRes = R.drawable.ic_sad
),
IRRITATION(
id = 5L,
tagName = "์งœ์ฆ",
imgRes = R.drawable.ic_irritation
),
ANGER(
id = 6L,
tagName = "๋ถ„๋…ธ",
imgRes = R.drawable.ic_anger
);

companion object {
fun fromId(id: Long): EmotionType? = values().find { it.id == id }
fun fromId(id: Long?): EmotionType? {
return entries.firstOrNull { it.id == id }
}

fun fromTagName(tagName: String?): EmotionType? {
return entries.firstOrNull { it.tagName == tagName }
}

fun tagNameOf(id: Long?): String? {
return fromId(id)?.tagName
}

fun idOf(tagName: String?): Long? {
return fromTagName(tagName)?.id
}
}
}
106 changes: 106 additions & 0 deletions core/src/main/java/com/linku/core/model/Situation.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
package com.linku.core.model

data class Situation(
val id: Long,
Comment thread
Hongji03 marked this conversation as resolved.
val tagName: String
)

object SituationOptions {
val linkDetailSituations: List<Situation> = listOf(
Situation(1L, "ํ†ตํ•™ ์ค‘"),
Situation(2L, "๊ณต๋ถ€ ์ค‘"),
Situation(3L, "ํœด์‹ ์ค‘"),
Situation(4L, "์ด๋™ ์ค‘"),
Situation(5L, "์‹์‚ฌ ์ค‘"),
Situation(6L, "์ž๊ธฐ ์ „")
)

fun situationsFor(jobId: Long): List<Situation> = when (jobId) {
1L -> listOf(
Situation(1L, "ํ†ตํ•™ ์ค‘"),
Situation(2L, "๊ณต๋ถ€ ์ค‘"),
Situation(3L, "์‹์‚ฌ ์ค‘"),
Situation(4L, "์‹œํ—˜ ์ค€๋น„"),
Situation(5L, "์นœ๊ตฌ๋ž‘"),
Situation(6L, "์‡ผํ•‘ ์ค‘"),
Situation(7L, "ํœด์‹ ์ค‘"),
Situation(8L, "์ž๊ธฐ ์ „")
)

2L -> listOf(
Situation(9L, "๊ณผ์ œ ์ค‘"),
Situation(10L, "ํ†ตํ•™ ์ค‘"),
Situation(11L, "์‡ผํ•‘ ์ค‘"),
Situation(12L, "์•Œ๋ฐ” ์ค‘"),
Situation(13L, "ํŠธ๋ Œ๋“œ ํ™•์ธ"),
Situation(14L, "๋ฐ์ดํŠธ ์ค‘"),
Situation(15L, "ํœด์‹ ์ค‘"),
Situation(16L, "์ž๊ธฐ ์ „")
)

3L -> listOf(
Situation(17L, "์ถœํ‡ด๊ทผ"),
Situation(18L, "ํŠธ๋ Œ๋“œ ํ™•์ธ"),
Situation(19L, "์—…๋ฌด ์ค‘"),
Situation(20L, "์ปค๋ฆฌ์–ด ๊ณ ๋ฏผ"),
Situation(21L, "์‡ผํ•‘ ์ค‘"),
Situation(22L, "๋ฐ์ดํŠธ ์ค‘"),
Situation(23L, "ํœด์‹ ์ค‘"),
Situation(24L, "์ž๊ธฐ ์ „")
)

4L -> listOf(
Situation(25L, "์ถœํ‡ด๊ทผ"),
Situation(26L, "์—…๋ฌด ์ค€๋น„ ์ค‘"),
Situation(27L, "๋ฐ์ดํŠธ ์ค‘"),
Situation(28L, "์‹์‚ฌ"),
Situation(29L, "์‡ผํ•‘ ์ค‘"),
Situation(30L, "ํŠธ๋ Œ๋“œ ํ™•์ธ"),
Situation(31L, "ํœด์‹ ์ค‘"),
Situation(32L, "์ž๊ธฐ ์ „")
)

5L -> listOf(
Situation(33L, "์ž‘์—… ์ค‘"),
Situation(34L, "์‡ผํ•‘ ์ค‘"),
Situation(35L, "ํŠธ๋ Œ๋“œ ํ™•์ธ"),
Situation(36L, "๋ฐ์ดํŠธ ์ค‘"),
Situation(37L, "์šด๋™ ์ค‘"),
Situation(38L, "์‹์‚ฌ"),
Situation(39L, "ํœด์‹ ์ค‘"),
Situation(40L, "์ž๊ธฐ ์ „")
)

6L -> listOf(
Situation(41L, "์ž์†Œ์„œ ์ž‘์„ฑ"),
Situation(42L, "๋ฉด์ ‘ ์ค€๋น„"),
Situation(43L, "์š”๋ฆฌ ์ค‘"),
Situation(44L, "ํŠธ๋ Œ๋“œ ํ™•์ธ"),
Situation(45L, "์‡ผํ•‘ ์ค‘"),
Situation(46L, "์šด๋™ ์ค‘"),
Situation(47L, "ํœด์‹ ์ค‘"),
Situation(48L, "์ž๊ธฐ ์ „")
)

else -> situationsFor(3L)
}

fun nameOf(id: Long?): String? {
if (id == null) return null

return (linkDetailSituations + (1L..6L).flatMap { situationsFor(it) })
Comment thread
Hongji03 marked this conversation as resolved.
Outdated
.distinctBy { it.id }
.firstOrNull { it.id == id }
?.tagName
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.

fun idOf(tagName: String, jobId: Long? = null): Long? {
val options = if (jobId != null) {
situationsFor(jobId)
} else {
linkDetailSituations
}

return options.firstOrNull { it.tagName == tagName }?.id
}
Comment thread
Hongji03 marked this conversation as resolved.
Outdated
}
Loading