diff --git a/docs/ai-usage.md b/docs/ai-usage.md index 87fbd38c..75b463d2 100644 --- a/docs/ai-usage.md +++ b/docs/ai-usage.md @@ -36,6 +36,8 @@ After the peer reviews, we used AI to help us split up `ExplorePlants.tsx`, whic All AI-generated suggestions were reviewed, tested and adapted by the team before they were committed. Every change went through a pull request that had to be approved by another group member (see [quality.md](quality.md#work-practices)), so no AI-generated code was merged without a review. Design and architectural decisions were made by the team. +In retrospect vi could have added a globall context-file for the AI models used. This would have been helpfull to make sure all AI models used followed the same rules. In future we would do this. + ### Being critical of a suggestion from AI We did not always follow the suggestions from AI. For example, when My Matches was changed to fetch one page of plants at a time, the old `matchedPlants` field on the user was no longer used by the app. AI first suggested keeping the field because the tests used it, but we decided to remove it, since keeping unused code only for the tests made no sense. Before removing it, we searched the code for every place it was used, to make sure it was safe. Then we updated the tests to use the new field, and wrote new tests for the `myMatches` query. diff --git a/docs/media/drawnExplorePage.png b/docs/media/drawnExplorePage.png new file mode 100644 index 00000000..4952c952 Binary files /dev/null and b/docs/media/drawnExplorePage.png differ diff --git a/docs/media/drawnFlowerCard.png b/docs/media/drawnFlowerCard.png new file mode 100644 index 00000000..038db163 Binary files /dev/null and b/docs/media/drawnFlowerCard.png differ diff --git a/docs/media/drawnProfilePage.png b/docs/media/drawnProfilePage.png new file mode 100644 index 00000000..b2915bdc Binary files /dev/null and b/docs/media/drawnProfilePage.png differ diff --git a/docs/media/figmaMockUp.png b/docs/media/figmaMockUp.png new file mode 100644 index 00000000..83ea2804 Binary files /dev/null and b/docs/media/figmaMockUp.png differ diff --git a/docs/quality.md b/docs/quality.md index 9f805ddd..d4451193 100644 --- a/docs/quality.md +++ b/docs/quality.md @@ -16,7 +16,23 @@ GitHub Actions ([.github/workflows/ci.yml](../.github/workflows/ci.yml)) runs on ## Work practices -- Before development began, the group created a prototype in Figma to establish a shared visual understanding of the application and agree on the design before writing code. +### Ideation process + +- Before development began, we sketched the main functions of the application by hand: the Explore page, where users can search and filter all plants, mark plants as favourites and mark plants they own; the plant card; and the profile page with information about the user. This gave the group a shared understanding of what the application should do before writing any code. This also made it easier to communicate ideas about the project. + + Hand-drawn sketch of the Explore page with a sidebar menu, a search bar, a filter button and a grid of plant cards + + Hand-drawn sketch of a plant card with an info icon, a heart icon and an "I have this one!" button + + Hand-drawn sketch of the profile page with a profile picture and fields for information about the user + +- We then used Figma to find inspiration for colours and layout. The mock-up below was used as a reference for the visual style, not as a finished design. + + Figma mock-up of a plant app with a green sidebar menu, a search bar, plant cards with photos and a list of care tasks + +- The sketches and the mock-up were a starting point. A lot of iteration happened during development: features, layout and design choices changed as we built the application, tested it, got feedback from others in the course and gave to each other, so the final application differs in many ways from the first sketches. + +### Practices during development - We followed three rules before merging a pull request: 1. **At least one member of IT2810-H26-T03 had to approve the pull request.** Members could not approve their own pull requests, and staff approvals did not count towards this requirement. This ensured that team members reviewed each other's code. diff --git a/e2e/uiImages.spec.ts b/e2e/uiImages.spec.ts index ef403ebd..cbaade4f 100644 --- a/e2e/uiImages.spec.ts +++ b/e2e/uiImages.spec.ts @@ -105,7 +105,8 @@ test("the placeholder picture loads on plant cards without an image", async ({ (element) => getComputedStyle(element, "::before").backgroundImage, ); const url = backgroundImage.match(/url\("?(.*?)"?\)/)?.[1]; - expect(url).toContain("plantPlaceholder.png"); + // Vite adds a hash to the file name in the build, for example plantPlaceholder-a1b2c3.png + expect(url).toContain("plantPlaceholder"); expect(await loadImageWidth(page, url!)).toBeGreaterThan(0); }); diff --git a/frontend/public/plantPlaceholder.png b/frontend/src/assets/plantPlaceholder.png similarity index 100% rename from frontend/public/plantPlaceholder.png rename to frontend/src/assets/plantPlaceholder.png diff --git a/frontend/src/components/plantCard/PlantCard.css b/frontend/src/components/plantCard/PlantCard.css index 550fe658..4d73fa45 100644 --- a/frontend/src/components/plantCard/PlantCard.css +++ b/frontend/src/components/plantCard/PlantCard.css @@ -94,12 +94,6 @@ overflow: hidden; } -/* The back of the card is too close to the page color in dark mode, so it gets - a light green border to show where it ends */ -[data-theme="dark"] .plant-card-back { - border: 2px solid var(--dark-green); -} - .plant-card-front { background: var(--card-front); } @@ -229,7 +223,7 @@ content: ""; position: absolute; inset: 0; - background: url("/plantPlaceholder.png") center / cover no-repeat; + background: url("../../assets/plantPlaceholder.png") center / cover no-repeat; } .plant-card-front .plant-card-preferences { @@ -291,8 +285,11 @@ color: var(--text-light); } +/* The back is dark pink like the front's corner, so the back's corner gets the + front's color, to match */ .plant-card-face-back .plant-card-flap { - --flap-fill: var(--cream); + --flap-fill: var(--card-front); + --flap-border: var(--soft-green); } .plant-card-back .plant-card-hint, diff --git a/frontend/src/components/sidebar/Sidebar.css b/frontend/src/components/sidebar/Sidebar.css index 2c1a2e3d..603891af 100644 --- a/frontend/src/components/sidebar/Sidebar.css +++ b/frontend/src/components/sidebar/Sidebar.css @@ -33,7 +33,7 @@ border-radius: 0.6rem; color: var(--sidebar-text); text-decoration: none; - font-size: 1.1rem; + font-size: 1.3rem; font-weight: 500; border: 1px solid transparent; transition: @@ -70,13 +70,17 @@ } .sidebar_title { - font-size: 2rem; + font-size: 2.3rem; font-weight: 600; margin-top: 1em; margin-bottom: 1rem; text-align: center; } +.sidebar__heart { + color: var(--dark-pink); +} + .close-button { display: none; } diff --git a/frontend/src/components/sidebar/Sidebar.tsx b/frontend/src/components/sidebar/Sidebar.tsx index acd83210..c4f42a22 100644 --- a/frontend/src/components/sidebar/Sidebar.tsx +++ b/frontend/src/components/sidebar/Sidebar.tsx @@ -15,6 +15,8 @@ type SidebarProps = { export default function Sidebar({ isOpen, onCloseSidebar, ref }: SidebarProps) { const { t } = useTranslation(); const closeButtonRef = useRef(null); + // The title is "I <3 Plants". The heart is put in its own span so it can be pink. + const [titleStart, titleEnd] = t("sidebar.title").split("<3"); // On mobile the sidebar opens over the page. Focus moves into it when it // opens, and Escape closes it, like other dialogs and menus. @@ -48,7 +50,13 @@ export default function Sidebar({ isOpen, onCloseSidebar, ref }: SidebarProps) {