Skip to content

Commit

Permalink
🐛 fix broken timeline view
Browse files Browse the repository at this point in the history
  • Loading branch information
ebullient committed Nov 13, 2024
1 parent ba6d421 commit ed468a2
Show file tree
Hide file tree
Showing 10 changed files with 998 additions and 858 deletions.
571 changes: 313 additions & 258 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
"devDependencies": {
"@testing-library/svelte": "^5.2.4",
"@tsconfig/svelte": "^5.0.4",
"@vitest/coverage-v8": "^2.1.4",
"@types/chroma-js": "^2.4.4",
"@types/node": "^22.9.0",
"@vitest/coverage-v8": "^2.1.4",
"auto-changelog": "^2.5.0",
"builtin-modules": "^4.0.0",
"dotenv": "^16.4.5",
Expand All @@ -32,13 +33,14 @@
"jsdom-global": "^3.0.2",
"moment": "2.30.1",
"obsidian": "^1.7.2",
"svelte": "^5.1.15",
"svelte": "^5.1.16",
"svelte-preprocess": "^6.0.3",
"tslib": "^2.8.1",
"typescript": "^5.6.3",
"vitest": "^2.0.1"
},
"dependencies": {
"chroma-js": "^3.1.2",
"obsidian-daily-notes-interface": "^0.9.4"
},
"auto-changelog": {
Expand Down
10 changes: 9 additions & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ export const DAY_PLANNER_DEFAULT_CONTENT =
export const VIEW_TYPE_TIMELINE = 'timeline';
export const MINUTE_MULTIPLIER = 4;

export const COLORS = {
lineColor: '#CAD5CA',
timelineColorBegin: '#008183',
timelineColorEnd: '#4d194d',
timelineHoverColorBegin: '#83003f',
timelineHoverColorEnd: '#5d0e2e'
};

export const ICONS = [
'any-key',
'audio-file',
Expand Down Expand Up @@ -72,4 +80,4 @@ export const ICONS = [
'vault',
'vertical-split',
'vertical-three-dots'
]
]
5 changes: 3 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ export default class DayPlanner extends Plugin {
this.registerView(
VIEW_TYPE_TIMELINE,
(leaf: WorkspaceLeaf) =>
(this.timelineView = new TimelineView(leaf, this.settings))
(this.timelineView = new TimelineView(leaf, this.settings,
new PlanSummaryData([], this.isWriter())))
);

this.addSettingTab(new DayPlannerSettingsTab(this.app, this));
Expand Down Expand Up @@ -225,7 +226,7 @@ export default class DayPlanner extends Plugin {
async insertDayPlannerIntoCurrentNote(insertTemplate: boolean) {
try {
const view = this.app.workspace.getActiveViewOfType(MarkdownView);
const filePath = view.getState().file;
const filePath = view.file.path;
const dayPlannerExists = this.notesForDatesQuery.exists(this.settings.notesToDates);
const activeDayPlannerPath = this.notesForDatesQuery.active(this.settings.notesToDates)?.notePath;

Expand Down
Loading

0 comments on commit ed468a2

Please sign in to comment.