Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
45 changes: 45 additions & 0 deletions DevLog/UI/Common/Componeent/WebItemtRow.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
//
// WebItemtRow.swift
// DevLog
//
// Created by Codex on 2/24/26.
//

import SwiftUI

struct WebItemtRow: View {

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.

medium

Struct 이름에 오타가 있는 것 같습니다. WebItemtRowWebItemRow로 수정하면 더 명확하고 일관성 있을 것 같습니다. 파일명(WebItemtRow.swift)과 폴더명(Componeent)에도 비슷한 오타가 있으니 함께 확인해보시면 좋겠습니다.

Suggested change
struct WebItemtRow: View {
struct WebItemRow: View {

@Environment(\.sceneWidth) private var sceneWidth

let item: WebPageItem
let showsChevron: Bool

var body: some View {
HStack {
CacheableImage(url: item.imageURL) {
Image(systemName: "globe")
.resizable()
.scaledToFit()
}
.frame(width: sceneWidth / 10, height: sceneWidth / 10)
.clipShape(RoundedRectangle(cornerRadius: 10))

VStack(alignment: .leading) {
Text(item.title)
.foregroundStyle(Color.primary)
.bold()
.multilineTextAlignment(.leading)
.lineLimit(2)
Text(item.displayURL)
.foregroundStyle(Color.accentColor)
.underline()
}
Spacer()
if showsChevron {
Image(systemName: "chevron.right")
.font(.caption2.bold())
.foregroundStyle(.gray)
}
}
.padding(.vertical, 4)
}
}
27 changes: 5 additions & 22 deletions DevLog/UI/Home/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ struct HomeView: View {
))
case .web(let page):
WebView(url: page.url)
.navigationBarTitleDisplayMode(.inline)
.ignoresSafeArea()
.toolbar(.hidden, for: .tabBar)
.toolbar {
ToolbarItem(placement: .principal) {
Text(page.title)
Expand Down Expand Up @@ -253,6 +256,7 @@ struct HomeView: View {
ForEach(viewModel.state.webPages, id: \.id) { page in
webResultRow(page)
}
.listRowInsets(EdgeInsets(top: 0, leading: 16, bottom: 0, trailing: 16))
}
} header: {
HStack {
Expand Down Expand Up @@ -289,28 +293,7 @@ struct HomeView: View {

private func webResultRow(_ item: WebPageItem) -> some View {
NavigationLink(value: Path.web(item)) {
HStack {
CacheableImage(url: item.imageURL) {
Image(systemName: "globe")
.resizable()
.scaledToFit()
}
.frame(width: sceneWidth / 10, height: sceneWidth / 10)
.clipShape(RoundedRectangle(cornerRadius: 10))

VStack(alignment: .leading) {
Text(item.title)
.foregroundStyle(Color.primary)
.bold()
.multilineTextAlignment(.leading)
.lineLimit(2)
Text(item.displayURL)
.foregroundStyle(Color.accentColor)
.underline()
}
Spacer()
}
.padding(.vertical, 4)
WebItemtRow(item: item, showsChevron: false)
}
.swipeActions(edge: .trailing, allowsFullSwipe: true) {
Button(role: .destructive) {
Expand Down
28 changes: 3 additions & 25 deletions DevLog/UI/Search/SearchView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ struct SearchView: View {
))
case .web(let page):
WebView(url: page.url)
.ignoresSafeArea()
.toolbar {
ToolbarItem(placement: .principal) {
Text(page.title)
Expand Down Expand Up @@ -214,31 +215,8 @@ struct SearchView: View {

private func webResultRow(_ item: WebPageItem) -> some View {
NavigationLink(value: Path.web(item)) {
VStack(spacing: 4) {
HStack {
CacheableImage(url: item.imageURL) {
Image(systemName: "globe")
.resizable()
.scaledToFit()
}
.frame(width: sceneWidth / 10, height: sceneWidth / 10)
.clipShape(RoundedRectangle(cornerRadius: 10))

VStack(alignment: .leading) {
Text(item.title)
.foregroundStyle(Color.primary)
.bold()
.multilineTextAlignment(.leading)
.lineLimit(2)
Text(item.displayURL)
.foregroundStyle(Color.accentColor)
.underline()
}
Spacer()
Image(systemName: "chevron.right")
.font(.caption2.bold())
.foregroundStyle(.gray)
}
VStack(spacing: 0) {
WebItemtRow(item: item, showsChevron: true)
Divider()
}
}
Expand Down