Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2391 - Multiple images in the viewer #2419

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

SebinSong
Copy link
Collaborator

@SebinSong SebinSong commented Nov 11, 2024

closes #2391

[Desktop]
It also allows navigation via arrows in the keyboard too.

image

[Mobile]

@SebinSong SebinSong self-assigned this Nov 11, 2024
Copy link

cypress bot commented Nov 11, 2024

group-income    Run #3384

Run Properties:  status check passed Passed #3384  •  git commit f67d403a55 ℹ️: Merge d973d388f2d6f29a28563ed86cbe38c59fa46eca into 3b142e94445de8ab49b435e8d4bd...
Project group-income
Branch Review sebin/task/#2391-multiple-images-in-the-viewer
Run status status check passed Passed #3384
Run duration 09m 07s
Commit git commit f67d403a55 ℹ️: Merge d973d388f2d6f29a28563ed86cbe38c59fa46eca into 3b142e94445de8ab49b435e8d4bd...
Committer Sebin Song
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 10
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 111
View all changes introduced in this branch ↗︎

@@ -5,7 +5,7 @@
@mouseup='mouseUpHandler'
)
img.c-preview-image(ref='previewImg'
:class='{ "is-movable": isImageMovable }'
:class='{ "is-movable": isImageMovable, "is-hidden": !ephemeral.imgInitDone }'
Copy link
Collaborator Author

@SebinSong SebinSong Nov 11, 2024

Choose a reason for hiding this comment

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

Discovered a bug where the image kind of flickers when it finishes the load/initialization steps(happens because image dimensions changes from it's natural size to the initial zoom value). So made a fix here.

ownerID: this.ownerID,
imgUrl: entry.url || this.objectURLList[index] || '',
createdAt: this.createdAt || new Date(),
id: randomHexString(12)
Copy link
Member

Choose a reason for hiding this comment

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

Instead of a random ID, wouldn't it be better to use a deterministic ID in this case? For example, I think the URLs would be both deterministic and unique (or it could be combined with the message ID).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Valid suggestion. But I think it's safe to use the random string here because the id here is merely used for differentiating multiple images rendered in the DOM.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I think it's safe also as used here, but I'm partial to deterministic IDs because they're always safe and can also be used, e.g., in testing.

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.

Implement cycling between multiple images in the image viewer
2 participants