Skip to content

fix file gallery styles#471

Merged
iceljc merged 1 commit into
SciSharp:mainfrom
iceljc:features/refine-response-format
Jul 14, 2026
Merged

fix file gallery styles#471
iceljc merged 1 commit into
SciSharp:mainfrom
iceljc:features/refine-response-format

Conversation

@iceljc

@iceljc iceljc commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@iceljc iceljc merged commit 1ed84fd into SciSharp:main Jul 14, 2026
1 of 2 checks passed
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Fix FileGallery thumbnail caption overlay and center lightbox footer text

🐞 Bug fix 🕐 Less than 10 minutes

Grey Divider

AI Description

• Remove per-thumbnail filename caption to prevent overlay/layout issues in the gallery grid.
• Center-align lightbox footer headings and text for consistent presentation.
Diagram

graph TD
  A["FileGallery.svelte"] --> B["Thumbnail grid"] --> C["GalleryImage"] --> D["LightboxGallery"] --> E["svelte-lightbox footer"] --> F["Global CSS overrides"]
  subgraph Legend
    direction LR
    _ui[UI Component] ~~~ _ext{{Third-party UI}} ~~~ _css["CSS rules"]
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Move filename into lightbox caption/footer instead of removing
  • ➕ Preserves filename visibility without impacting thumbnail layout
  • ➕ Keeps thumbnails visually clean while still providing context on preview
  • ➖ Requires wiring caption data into the lightbox component (may depend on library API)
  • ➖ Slightly more implementation/testing than the current minimal change
2. Use a locally-scoped wrapper class instead of :global footer selectors
  • ➕ Reduces risk of unintended global style bleed if multiple lightboxes exist
  • ➕ More maintainable if the third-party library changes internal markup
  • ➖ May not be possible if the library doesn’t expose a wrapper hook/class for the footer
  • ➖ Could require more restructuring of the lightbox integration

Recommendation: The current approach is appropriate for a quick UI fix: removing the thumbnail filename avoids the immediate layout/overlay issue and centering footer typography improves readability. If filenames are important to users, prefer surfacing them in the lightbox caption/footer via library-supported hooks rather than reintroducing per-thumbnail captions.

Files changed (1) +5 / -3

Bug fix (1) +5 / -3
FileGallery.svelteRemove thumbnail filename caption and center lightbox footer text +5/-3

Remove thumbnail filename caption and center lightbox footer text

• Removes rendering of the per-file name text under each gallery item, likely to prevent cramped/overlapping thumbnail layouts. Adds :global CSS rules to center-align common text elements (h2/h5/p) in the svelte-lightbox footer for consistent styling.

src/lib/common/files/FileGallery.svelte

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Informational

1. Lightbox filename text removed 🐞 Bug ⚙ Maintainability
Description
FileGallery no longer renders file.file_name as text inside each LightboxGallery slide body (the
<div class="item-text">…</div> was removed). This changes the lightbox content from “preview +
filename” to “preview only”, which can reduce in-slide context for users when viewing multiple
attachments.
Code

src/lib/common/files/FileGallery.svelte[L165-167]

-                    {#if !!file.file_name}
-                        <div class="item-text">{file.file_name}</div>
-                    {/if}
Evidence
The PR deletes the conditional block that rendered file.file_name inside each lightbox slide. The
current lightbox slide loop renders only an <img> per file type, while filename rendering remains
only in the thumbnail section when showFileName is set.

src/lib/common/files/FileGallery.svelte[135-166]
src/lib/common/files/FileGallery.svelte[148-166]
src/lib/common/files/MessageFileGallery.svelte[78-85]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`FileGallery.svelte` removed the only explicit filename text rendered inside each `GalleryImage` in the lightbox. This is a user-visible behavior change: the lightbox slide body now contains only the preview image/icon.

## Issue Context
- Thumbnails still optionally render filenames via `showFileName`, but the lightbox slide body no longer does.
- If filename context in the lightbox is still desired, it should be rendered explicitly (or be clearly controlled by a prop).

## Fix Focus Areas
- src/lib/common/files/FileGallery.svelte[148-167]
- src/lib/common/files/FileGallery.svelte[162-167]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

Comment on lines -165 to 167
{#if !!file.file_name}
<div class="item-text">{file.file_name}</div>
{/if}
</GalleryImage>
{/each}
</LightboxGallery>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Informational

1. Lightbox filename text removed 🐞 Bug ⚙ Maintainability

FileGallery no longer renders file.file_name as text inside each LightboxGallery slide body (the
<div class="item-text">…</div> was removed). This changes the lightbox content from “preview +
filename” to “preview only”, which can reduce in-slide context for users when viewing multiple
attachments.
Agent Prompt
## Issue description
`FileGallery.svelte` removed the only explicit filename text rendered inside each `GalleryImage` in the lightbox. This is a user-visible behavior change: the lightbox slide body now contains only the preview image/icon.

## Issue Context
- Thumbnails still optionally render filenames via `showFileName`, but the lightbox slide body no longer does.
- If filename context in the lightbox is still desired, it should be rendered explicitly (or be clearly controlled by a prop).

## Fix Focus Areas
- src/lib/common/files/FileGallery.svelte[148-167]
- src/lib/common/files/FileGallery.svelte[162-167]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant