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

feat(Slice): Use keyboard to change slices of the active view #679

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

lchauvin
Copy link
Contributor

This needs this PR to be merged first: #676

Copy link

netlify bot commented Oct 29, 2024

Deploy Preview for volview-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 01402f2
🔍 Latest deploy log https://app.netlify.com/sites/volview-dev/deploys/672100e66051a300087ba04a
😎 Deploy Preview https://deploy-preview-679--volview-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@PaulHax PaulHax self-requested a review December 12, 2024 14:09
Copy link
Collaborator

@PaulHax PaulHax left a comment

Choose a reason for hiding this comment

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

Making dreams come true here.

If you rebase on top of main rather than merge we can avoid thoes pesky merge commits.

Comment on lines +42 to +56
const nextSlice = () => () => {
const { currentImageID } = useCurrentImage();
const { activeViewID } = useViewStore();

const { slice: currentSlice } = useSliceConfig(activeViewID, currentImageID);
currentSlice.value += 1;
};

const previousSlice = () => () => {
const { currentImageID } = useCurrentImage();
const { activeViewID } = useViewStore();

const { slice: currentSlice } = useSliceConfig(activeViewID, currentImageID);
currentSlice.value -= 1;
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

To remove duplicate code, could define something like offsetSlice(offset: number) then

const nextSlice = () => offsetSlice(1)
const previousSlice = () => offsetSlice(-1)

@@ -28,6 +29,13 @@ import { useViewStore } from '../store/views';

export default defineComponent({
name: 'LayoutGrid',
methods: {
onFocusView(id: string, type: string) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍️ Good

Also, when I scroll with mouse wheel on a view, then press the arrow keys, its not always the same view that gets its slice changed. So maybe setActiveView on scroll events too?

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.

2 participants