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

Always open in new tab setting #497

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

Conversation

marienvo
Copy link
Contributor

I prefer the calendar tab not to close when opening an event (but open a new tab instead). This way its easier to compare and switch notes of multiple events. So maybe we could add this setting to always have clicks to open in a new tab?

Without setting (current, many clicks needed)
current

With setting (this PR, less clicks needed)
new

Invert Ctrl-setting for opening modal vs file
Also (second commit in this PR), I tend to want to open the note more than I want to open the edit modal. So I added a setting for inverting the modifier key as well (ctrl for opening modal instead of ctrl for opening the file - notes are central for me):

Screenshot from 2023-09-10 11-06-21

Copy link
Collaborator

@davish davish left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution! Just a few suggestions before merging.

@@ -27,6 +27,8 @@ export interface FullCalendarSettings {
};
timeFormat24h: boolean;
clickToCreateEventFromMonthView: boolean;
alwaysOpenInNewTab: boolean;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
alwaysOpenInNewTab: boolean;
alwaysOpenInNewTab?: boolean;

Both of these settings should be optional, since they won't be present in existing Full Calendar installations. Following the type errors should lead you to add some more edge cases to fill in the defaults as they should in those cases.

* @returns
*/
export async function openFileForEvent(
cache: EventCache,
{ workspace, vault }: { workspace: Workspace; vault: Vault },
id: string
id: string,
settings?: FullCalendarSettings
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
settings?: FullCalendarSettings
openInNewTab: boolean

Could you pass the setting in as its own parameters rather than passing in the whole settings object? I'd prefer it to be explicit what settings openFileForEvent is using from its type signature.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, just updated the branch

@marienvo marienvo requested a review from davish October 28, 2023 16:02
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