From 12e6bd9d7160c3fe44c4dcd9ca39162c20b59fa2 Mon Sep 17 00:00:00 2001 From: trett Date: Sat, 1 Nov 2025 20:31:48 +0100 Subject: [PATCH 1/2] [client] improve desktop look --- build.sbt | 2 +- client/package-lock.json | 1 + client/src/main/scala/client/Home.scala | 2 +- client/src/main/scala/client/Router.scala | 19 +++++++++++-------- client/style.css | 10 ++++++++++ scripts/local-docker/docker-compose.yml | 4 ++-- 6 files changed, 26 insertions(+), 12 deletions(-) diff --git a/build.sbt b/build.sbt index 1691777..c796b12 100644 --- a/build.sbt +++ b/build.sbt @@ -4,7 +4,7 @@ import org.scalajs.linker.interface.ModuleSplitStyle import scala.sys.process.* -lazy val projectVersion = "2.1.9" +lazy val projectVersion = "2.1.10" lazy val organizationName = "ru.trett" lazy val scala3Version = "3.7.2" lazy val circeVersion = "0.14.14" diff --git a/client/package-lock.json b/client/package-lock.json index dbe6806..b85b077 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -1027,6 +1027,7 @@ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, diff --git a/client/src/main/scala/client/Home.scala b/client/src/main/scala/client/Home.scala index f4540b5..0dfdaac 100644 --- a/client/src/main/scala/client/Home.scala +++ b/client/src/main/scala/client/Home.scala @@ -46,7 +46,7 @@ object Home: feedVar.updater[FeedItemList]((xs1, xs2) => (xs1 ++: xs2).distinctBy(_.link)) def render: Element = div( - cls := "cards", + cls := "cards main-content", div( onMountBind(ctx => refreshFeedsBus --> { page => diff --git a/client/src/main/scala/client/Router.scala b/client/src/main/scala/client/Router.scala index 703d38b..01e8397 100644 --- a/client/src/main/scala/client/Router.scala +++ b/client/src/main/scala/client/Router.scala @@ -29,13 +29,16 @@ object Router: def settings: Element = SettingsPage.render def summary: Element = SummaryPage.render - private val root = div(child <-- currentPageVar.signal.map { - case LoginRoute => login - case HomeRoute => div(navbar, notifications, home) - case SettingsRoute => div(navbar, notifications, settings) - case SummaryRoute => div(navbar, notifications, summary) - case ErrorRoute => div(Text("An error occured")) - case NotFoundRoute => div(Text("Not Found")) - }) + private val root = div( + child <-- currentPageVar.signal.map { + case LoginRoute => login + case HomeRoute => div(navbar, notifications, home) + case SettingsRoute => div(navbar, notifications, settings) + case SummaryRoute => div(navbar, notifications, summary) + case ErrorRoute => div(Text("An error occured")) + case NotFoundRoute => div(Text("Not Found")) + }, + className := "app-container" + ) def appElement(): Element = div(root) diff --git a/client/style.css b/client/style.css index 3fa4b7a..49597ca 100644 --- a/client/style.css +++ b/client/style.css @@ -38,3 +38,13 @@ .signup-button { background-color: #6c757d !important; /* A dark grey color */ } + +@media (min-width: 768px) { + .app-container { + background-color: #e1e1e1; + } + .main-content { + margin: 0 auto; + max-width: 50%; + } +} diff --git a/scripts/local-docker/docker-compose.yml b/scripts/local-docker/docker-compose.yml index cbe49ff..f2bf158 100644 --- a/scripts/local-docker/docker-compose.yml +++ b/scripts/local-docker/docker-compose.yml @@ -26,7 +26,7 @@ services: - host.docker.internal:host-gateway server: - image: server:2.1.9 + image: server:2.1.10 container_name: rss_server restart: always depends_on: @@ -42,7 +42,7 @@ services: GOOGLE_API_KEY: ${GOOGLE_API_KEY} client: - image: client:2.1.9 + image: client:2.1.10 container_name: rss_client restart: always depends_on: From ebd8e221353f5c7184acba564fd1cf903d12921a Mon Sep 17 00:00:00 2001 From: trett Date: Sat, 1 Nov 2025 20:50:00 +0100 Subject: [PATCH 2/2] summary page fixed --- build.sbt | 2 +- .../src/main/scala/client/SummaryPage.scala | 19 +++++++++++-------- client/style.css | 1 + scripts/local-docker/docker-compose.yml | 4 ++-- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/build.sbt b/build.sbt index c796b12..3b39d0a 100644 --- a/build.sbt +++ b/build.sbt @@ -4,7 +4,7 @@ import org.scalajs.linker.interface.ModuleSplitStyle import scala.sys.process.* -lazy val projectVersion = "2.1.10" +lazy val projectVersion = "2.1.11" lazy val organizationName = "ru.trett" lazy val scala3Version = "3.7.2" lazy val circeVersion = "0.14.14" diff --git a/client/src/main/scala/client/SummaryPage.scala b/client/src/main/scala/client/SummaryPage.scala index fe34872..eed36d1 100644 --- a/client/src/main/scala/client/SummaryPage.scala +++ b/client/src/main/scala/client/SummaryPage.scala @@ -14,14 +14,17 @@ object SummaryPage { FetchStream.get(req) } val isLoading = response.map(_.isPending) - Panel( - _.headerText := "Summary", - BusyIndicator( - _.active <-- isLoading, - UList( - child <-- response - .splitStatus((resolved, _) => resolved.output, (pending, _) => "") - .map(unsafeParseToHtmlFragment(_)) + div( + cls := "main-content", + Panel( + _.headerText := "Summary", + BusyIndicator( + _.active <-- isLoading, + UList( + child <-- response + .splitStatus((resolved, _) => resolved.output, (pending, _) => "") + .map(unsafeParseToHtmlFragment(_)) + ) ) ) ) diff --git a/client/style.css b/client/style.css index 49597ca..5e78467 100644 --- a/client/style.css +++ b/client/style.css @@ -42,6 +42,7 @@ @media (min-width: 768px) { .app-container { background-color: #e1e1e1; + min-height: 100vh; } .main-content { margin: 0 auto; diff --git a/scripts/local-docker/docker-compose.yml b/scripts/local-docker/docker-compose.yml index f2bf158..ac571ed 100644 --- a/scripts/local-docker/docker-compose.yml +++ b/scripts/local-docker/docker-compose.yml @@ -26,7 +26,7 @@ services: - host.docker.internal:host-gateway server: - image: server:2.1.10 + image: server:2.1.11 container_name: rss_server restart: always depends_on: @@ -42,7 +42,7 @@ services: GOOGLE_API_KEY: ${GOOGLE_API_KEY} client: - image: client:2.1.10 + image: client:2.1.11 container_name: rss_client restart: always depends_on: