-
-
Notifications
You must be signed in to change notification settings - Fork 36
Feature: Field Extraction #196
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
Changes from 4 commits
5abf616
3b277e5
b85a083
0ee3e02
80217e1
6809110
243881e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,9 +1,20 @@ | ||||||||||||||||||
| export interface CallUrlPattern { | ||||||||||||||||||
| name: string; | ||||||||||||||||||
| pattern: string; | ||||||||||||||||||
| matchType: 'regex' | 'contains'; | ||||||||||||||||||
| priority: number; | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| export interface ICSSettings { | ||||||||||||||||||
| format: { | ||||||||||||||||||
| timeFormat: string | ||||||||||||||||||
| dataViewSyntax: boolean, | ||||||||||||||||||
| }, | ||||||||||||||||||
| calendars: Record < string, Calendar > ; | ||||||||||||||||||
| videoCallExtraction: { | ||||||||||||||||||
| enabled: boolean; | ||||||||||||||||||
| patterns: CallUrlPattern[]; | ||||||||||||||||||
| }; | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| export interface Calendar { | ||||||||||||||||||
|
|
@@ -43,11 +54,42 @@ export const DEFAULT_CALENDAR_FORMAT = { | |||||||||||||||||
| showTransparentEvents: false | ||||||||||||||||||
| }; | ||||||||||||||||||
|
|
||||||||||||||||||
| export const DEFAULT_VIDEO_CALL_PATTERNS: CallUrlPattern[] = [ | ||||||||||||||||||
| { | ||||||||||||||||||
| name: "Google Meet", | ||||||||||||||||||
| pattern: "GOOGLE-CONFERENCE", | ||||||||||||||||||
| matchType: "contains", | ||||||||||||||||||
| priority: 1 | ||||||||||||||||||
| }, | ||||||||||||||||||
| { | ||||||||||||||||||
| name: "Zoom", | ||||||||||||||||||
| pattern: "zoom.us", | ||||||||||||||||||
| matchType: "contains", | ||||||||||||||||||
| priority: 2 | ||||||||||||||||||
| }, | ||||||||||||||||||
| { | ||||||||||||||||||
| name: "Skype", | ||||||||||||||||||
| pattern: "https:\\/\\/join\\.skype\\.com\\/[a-zA-Z0-9]+", | ||||||||||||||||||
| matchType: "regex", | ||||||||||||||||||
| priority: 3 | ||||||||||||||||||
| }, | ||||||||||||||||||
| { | ||||||||||||||||||
| name: "Microsoft Teams", | ||||||||||||||||||
| pattern: "https:\\/\\/teams\\.microsoft\\.com\\/l\\/meetup-join\\/[^>]+", | ||||||||||||||||||
| matchType: "regex", | ||||||||||||||||||
| priority: 4 | ||||||||||||||||||
| } | ||||||||||||||||||
| ]; | ||||||||||||||||||
|
|
||||||||||||||||||
| export const DEFAULT_SETTINGS: ICSSettings = { | ||||||||||||||||||
| format: { | ||||||||||||||||||
| timeFormat: "HH:mm", | ||||||||||||||||||
| dataViewSyntax: false, | ||||||||||||||||||
| }, | ||||||||||||||||||
| calendars: { | ||||||||||||||||||
| }, | ||||||||||||||||||
| videoCallExtraction: { | ||||||||||||||||||
| enabled: true, | ||||||||||||||||||
| patterns: DEFAULT_VIDEO_CALL_PATTERNS | ||||||||||||||||||
| } | ||||||||||||||||||
|
||||||||||||||||||
| videoCallExtraction: { | |
| enabled: true, | |
| patterns: DEFAULT_VIDEO_CALL_PATTERNS | |
| } | |
| videoCallExtraction: { | |
| enabled: true, | |
| patterns: DEFAULT_VIDEO_CALL_PATTERNS.map(pattern => ({ ...pattern })) | |
| } |
🤖 Prompt for AI Agents
In src/settings/ICSSettings.ts around lines 91-94,
DEFAULT_SETTINGS.videoCallExtraction.patterns currently references
DEFAULT_VIDEO_CALL_PATTERNS directly which allows runtime mutations to alter the
exported defaults; change the assignment to deep-clone
DEFAULT_VIDEO_CALL_PATTERNS when building DEFAULT_SETTINGS (use structuredClone
or JSON.parse(JSON.stringify(...))) so the settings get their own copy, and
update the migration code that copies/initializes videoCallExtraction patterns
to also deep-clone each entry rather than copying references so migrations don’t
propagate mutated defaults.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deep clone video-call defaults during migration
This migration still copies
DEFAULT_VIDEO_CALL_PATTERNSby reference—[...DEFAULT_VIDEO_CALL_PATTERNS]creates a new array but keeps the same pattern objects. Editing or reordering patterns in the settings UI will therefore mutate the exported defaults, so “reset to defaults” no longer restores the original values and those mutations get saved back as if they were defaults. Please clone the pattern objects before storing them.The same adjustment is needed in every branch where we hydrate
videoCallExtraction.patterns.🤖 Prompt for AI Agents