Repository: dcapal/dcapal (language: rust)

Issue:
Misc FE improvements
### Action items

- Sunset `ImageKit` (which is penalizing Lighthouse score and makes asset management less agile)
- Replace `ImageKit` with Webpack's [Asset Modules](https://webpack.js.org/guides/asset-modules/#resource-assets)
- Fix text wrapping in `EndStep` in mobile view

<img width="254" alt="image" src="https://github.com/leonardoarcari/dcapal/assets/811969/b1d64c54-7fe4-4f28-8141-b6089298e22d">

#### Rust: fix workspace config

- Profiles for non root package

```
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   C:\Users\leonardoarcari\Development\rust\dcapal\dcapal-optimizer-wasm\Cargo.toml
workspace: C:\Users\leonardoarcari\Development\rust\dcapal\Cargo.toml
```

- Crates resolver v2

```
warning: some crates are on edition 2021 which defaults to `resolver = "2"`, but virtual workspaces default to `resolver = "1"`
note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest
note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest
```

- Move shared crate dependencies to workspace root ([link](https://doc.rust-lang.org/cargo/reference/workspaces.html#the-dependencies-table))


Discussion / hints:
For wrapping, I think it's sufficient to remove _whitespace-nowrap_ here:

https://github.com/leonardoarcari/dcapal/blob/44e3b6c0e465d4547f2da1edbaf0335cc81ffd9f/dcapal-frontend/src/components/allocationFlow/endStep/allocateCard.js#L103

### Demonstration
https://github.com/leonardoarcari/dcapal/assets/36475130/3587014a-e3a1-4518-bc4b-4c1485579f56



Fix patch:
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index 50aceed5..e210111a 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -56,7 +56,7 @@ jobs:
       - name: Build and push
         uses: docker/build-push-action@v3
         with:
-          context: ./dcapal-backend
+          context: .
           file: ./dcapal-backend/docker/Dockerfile
           push: true
           tags: ${{ env.DOCKER_REPO }}:latest,${{ env.DOCKER_REPO }}:${{ env.VERSION }}
@@ -90,7 +90,7 @@ jobs:
       - name: Build
         run: |
           cd dcapal-optimizer-wasm
-          wasm-pack build --release
+          wasm-pack build --dev -- --profile release-wasm
 
       - name: Archive dcapal-optimizer-wasm pkg
         uses: actions/upload-artifact@v3
diff --git a/Cargo.toml b/Cargo.toml
index cdcf6d0a..de6c9450 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,16 @@
 [workspace]
+resolver = "2"
 members = ["dcapal-backend", "dcapal-optimizer-wasm"]
 
+[workspace.package]
+version = "0.2.2"
+authors = ["Leonardo Arcari <leonardo1.arcari@gmail.com>"]
+
 [profile.release-with-debug]
 inherits = "release"
 debug = true
+
+[profile.release-wasm]
+inherits = "release"
+# Tell `rustc` to optimize for small code size.
+opt-level = "s"
diff --git a/dcapal-backend/Cargo.toml b/dcapal-backend/Cargo.toml
index 777ec624..ccb449a1 100644
--- a/dcapal-backend/Cargo.toml
+++ b/dcapal-backend/Cargo.toml
@@ -1,6 +1,7 @@
 [package]
 name = "dcapal-backend"
-version = "0.2.2"
+version.workspace = true
+authors.workspace = true
 edition = "2021"
 
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
diff --git a/dcapal-backend/docker/Dockerfile b/dcapal-backend/docker/Dockerfile
index 6f00ab9e..115d8d13 100644
--- a/dcapal-backend/docker/Dockerfile
+++ b/dcapal-backend/docker/Dockerfile
@@ -1,15 +1,23 @@
 FROM lukemathwalker/cargo-chef:latest-rust-1.65.0 AS chef
-WORKDIR /var/dcapal-backend
+WORKDIR /var/dcapal
 
 FROM chef AS planner
-COPY . .
+WORKDIR /var/dcapal
+COPY ./Cargo.toml ./Cargo.toml
+COPY ./Cargo.lock ./Cargo.lock
+COPY ./dcapal-backend ./dcapal-backend
+COPY ./dcapal-optimizer-wasm ./dcapal-optimizer-wasm
 RUN cargo chef prepare --recipe-path recipe.json
 
-FROM chef AS builder 
-COPY --from=planner /var/dcapal-backend/recipe.json recipe.json
+FROM chef AS builder
+WORKDIR /var/dcapal
+COPY ./Cargo.toml ./Cargo.toml
+COPY ./Cargo.lock ./Cargo.lock
+COPY ./dcapal-backend ./dcapal-backend
+COPY ./dcapal-optimizer-wasm ./dcapal-optimizer-wasm
+COPY --from=planner /var/dcapal/recipe.json recipe.json
 RUN cargo chef cook --release --recipe-path recipe.json
-COPY . .
-RUN cargo build --release --bin dcapal-backend
+RUN cargo build --profile release-with-debug --bin dcapal-backend
 
 FROM debian:bullseye-slim AS runtime
 # Install runtime dependencies
@@ -19,8 +27,8 @@ RUN apt-get install -qq \
     ca-certificates \
     curl
 # Prepare binary
-WORKDIR /var/dcapal-backend
+WORKDIR /var/dcapal/dcapal-backend
 RUN mkdir bin
 RUN mkdir data
-COPY --from=builder /var/dcapal-backend/target/release/dcapal-backend /var/dcapal-backend/bin
-ENTRYPOINT ["/var/dcapal-backend/bin/dcapal-backend"]
\ No newline at end of file
+COPY --from=builder /var/dcapal/target/release/dcapal-backend /var/dcapal/dcapal-backend/bin
+ENTRYPOINT ["/var/dcapal/dcapal-backend/bin/dcapal-backend"]
\ No newline at end of file
diff --git a/dcapal-frontend/images/icons/settings.svg b/dcapal-frontend/images/icons/settings.svg
new file mode 100644
index 00000000..65df5c02
--- /dev/null
+++ b/dcapal-frontend/images/icons/settings.svg
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
+<svg fill="#000000" height="800px" width="800px" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" 
+	 viewBox="0 0 512 512" xml:space="preserve">
+<g>
+	<g>
+		<path d="M498.723,89.435H183.171V76.958c0-18.3-14.888-33.188-33.188-33.188h-51.5c-18.3,0-33.188,14.888-33.188,33.188v12.477
+			H13.275C5.943,89.435,0,95.38,0,102.711c0,7.331,5.943,13.275,13.275,13.275h52.018v12.473c0,18.3,14.888,33.188,33.188,33.188
+			h51.501c18.3,0,33.188-14.888,33.188-33.188v-12.473h315.553c7.332,0,13.275-5.945,13.275-13.275
+			C511.999,95.38,506.055,89.435,498.723,89.435z M156.621,128.459c0,3.66-2.978,6.638-6.638,6.638H98.482
+			c-3.66,0-6.638-2.978-6.638-6.638V76.958c0-3.66,2.978-6.638,6.638-6.638h51.501c3.66,0,6.638,2.978,6.638,6.638V128.459z"/>
+	</g>
+</g>
+<g>
+	<g>
+		<path d="M498.725,237.295h-52.019v-12.481c0-18.3-14.888-33.188-33.188-33.188h-51.501c-18.3,0-33.188,14.888-33.188,33.188
+			v12.481H13.275C5.943,237.295,0,243.239,0,250.57c0,7.331,5.943,13.275,13.275,13.275h315.553v12.469
+			c0,18.3,14.888,33.188,33.188,33.188h51.501c18.3,0,33.188-14.888,33.188-33.188v-12.469h52.019
+			c7.332,0,13.275-5.945,13.275-13.275C512,243.239,506.057,237.295,498.725,237.295z M420.155,276.315
+			c0,3.66-2.978,6.638-6.638,6.638h-51.501c-3.66,0-6.638-2.978-6.638-6.638v-51.501c0-3.66,2.978-6.638,6.638-6.638h51.501
+			c3.66,0,6.638,2.978,6.638,6.638V276.315z"/>
+	</g>
+</g>
+<g>
+	<g>
+		<path d="M498.725,396.014H276.432v-12.473c0-18.3-14.888-33.188-33.188-33.188h-51.501c-18.3,0-33.188,14.888-33.188,33.188
+			v12.473H13.275C5.943,396.014,0,401.959,0,409.289c0,7.331,5.943,13.275,13.275,13.275h145.279v12.477
+			c0,18.3,14.888,33.188,33.188,33.188h51.501c18.3,0,33.188-14.888,33.188-33.188v-12.477h222.293
+			c7.332,0,13.275-5.945,13.275-13.275C512,401.957,506.057,396.014,498.725,396.014z M249.881,435.042
+			c0,3.66-2.978,6.638-6.638,6.638h-51.501c-3.66,0-6.638-2.978-6.638-6.638v-51.501c0-3.66,2.978-6.638,6.638-6.638h51.501
+			c3.66,0,6.638,2.978,6.638,6.638V435.042z"/>
+	</g>
+</g>
+</svg>
\ No newline at end of file
diff --git a/dcapal-frontend/src/components/allocationFlow/portfolioStep/index.js b/dcapal-frontend/src/components/allocationFlow/portfolioStep/index.js
index 86f5ebaa..c7c2e60d 100644
--- a/dcapal-frontend/src/components/allocationFlow/portfolioStep/index.js
+++ b/dcapal-frontend/src/components/allocationFlow/portfolioStep/index.js
@@ -7,6 +7,8 @@ import toast from "react-hot-toast";
 import { SearchBar } from "./searchBar";
 import { AssetCard } from "./assetCard";
 
+import SettingsSvg from "../../../../images/icons/settings.svg";
+
 import {
   addAsset,
   clearPortfolio,
@@ -151,7 +153,7 @@ export const PortfolioStep = ({ ...props }) => {
       {assets && assets.length > 0 && (
         <div className="relative w-full flex flex-col items-end justify-center mt-2">
           <button className={feeBtnClass} onClick={onClickTransactionFees}>
-            ⚙️
+            <img src={SettingsSvg} className="w-full max-w-[32px] pt-1" />
           </button>
           {isShowFees && (
             <div className="w-full max-w-lg relative -top-4 px-3 pt-2 pb-3 flex flex-col gap-2 bg-white shadow-md ring-1 ring-black/5 rounded-md">
diff --git a/dcapal-frontend/webpack.common.js b/dcapal-frontend/webpack.common.js
index 80977598..bde99f77 100644
--- a/dcapal-frontend/webpack.common.js
+++ b/dcapal-frontend/webpack.common.js
@@ -29,14 +29,7 @@ module.exports = (env, argv) => {
         },
         {
           test: /\.svg$/,
-          use: [
-            {
-              loader: "svg-url-loader",
-              options: {
-                limit: 10000,
-              },
-            },
-          ],
+          type: "asset/resource",
         },
       ],
     },
diff --git a/dcapal-optimizer-wasm/Cargo.toml b/dcapal-optimizer-wasm/Cargo.toml
index 0e1c87e4..c434dc6a 100644
--- a/dcapal-optimizer-wasm/Cargo.toml
+++ b/dcapal-optimizer-wasm/Cargo.toml
@@ -1,7 +1,7 @@
 [package]
 name = "dcapal-optimizer-wasm"
-version = "0.2.2"
-authors = ["Leonardo Arcari <leonardo1.arcari@gmail.com>"]
+version.workspace = true
+authors.workspace = true
 edition = "2021"
 
 [lib]
@@ -37,7 +37,3 @@ env_logger = "0.10.0"
 test-log = { version = "0", features = ["log"] }
 glob = "0.3.1"
 serde_json = "1"
-
-[profile.release]
-# Tell `rustc` to optimize for small code size.
-opt-level = "s"


Test patch: