release v1.10.0: compact English calendar and remove recent type filters

This commit is contained in:
olivier committed 2026-11-11 21:58:50 -05:00
1 parent c9afc16c53
commit 8d2790d916
11 files changed
+42 -122

No files matched your search

+6 -9
View File
@@ -59,7 +59,7 @@ interface WaypointSettings {
quarterly: PeriodNoteSettings;
yearly: PeriodNoteSettings;
dateSystems: DateSystemSettings[]; // day-scoped systems beyond the daily note, in menu order
recentFiles: RecentFilesSettings; // maxItems, show, omittedPaths[], omittedTags[], showTypeFilter, types[]
recentFiles: RecentFilesSettings; // maxItems, show, omittedPaths[], omittedTags[], types[]
display: DisplaySettings; // px sizing for bookmark rows, fonts, icons, calendar cells
}
@@ -82,12 +82,11 @@ interface RecentFilesSettings {
show: 'all' | 'opened' | 'changed'; // header switch, default 'all'
omittedPaths: string[]; // regex patterns (one per line)
omittedTags: string[]; // regex patterns for frontmatter/inline tags
showTypeFilter: boolean; // type pills above the list, default true
types: { type: string; icon: string }[]; // frontmatter types: row icon + pill order (empty = pills auto-detected)
types: { type: string; icon: string }[]; // frontmatter types with a row icon each
}
```
Migration in `applySettings`: a saved `filterTags: string[]` becomes `types` with empty icons; the saved `updateOn` is dropped (both kinds are always tracked).
Migration in `applySettings`: the saved `filterTags`, `showTypeFilter` (the removed type filter), and `updateOn` (both kinds are always tracked) are dropped.
```typescript
interface DisplaySettings {
@@ -357,15 +356,15 @@ Called on every change. Full DOM rebuild — `contentEl.empty()`, then Favorites
```
┌────────────────────────────────────┐
│ Q2 June 2026 ◀ Today ▶ │ ← breadcrumb (clickable) + nav
│ Q2 Jun 2026 ◀ Today ▶ │ ← breadcrumb (clickable) + nav
├──┬───┬───┬───┬───┬───┬───┬───┤
│24│sun│mon│tue│wed│thu│fri│sat│ ← header row + week# col
│24│ S │ M │ T │ W │ T │ F │ S │ ← header row + week# col
├──┼───┼───┼───┼───┼───┼───┼───┤
│25│ 1 │ 2 │ 3 │... ← day cells (clickable)
└──┴───┴───┴───┴───┴───┴───┴───┘
```
- **Breadcrumb:** Q-label, month name, year — each clickable to open that period note.
- **Breadcrumb:** Q-label, 3-letter month (`MMM`), year — each clickable to open that period note. Weekday headers are single letters.
- **Nav buttons:** ◀/▶ shift month ±1. "Today" resets to current month. The `calendar-search` button calls `showPicker()` on a hidden native `<input type="date">` (`.waypoint-calendar-pick-input`); picking a date calls `showDate()` — the calendar jumps to that month and marks the day without opening or creating a note.
- **Week number column:** Clicking a week number opens the weekly note for that week's Monday; middle-clicking opens it in a new tab.
- **Day cells:** Left-click opens the daily note, middle-click opens it in a new tab, right-click opens the day context menu (below). `.other-month` is muted; `.today` has an inset accent ring; hover receives a quiet fill. With `indicatorMode: 'any'`, `.has-note` shows the existing single neutral dot through the O(1) `plugin.hasNoteForDate(dateStr)` lookup. With `indicatorMode: 'systems'`, the view calls `getDateSystemIndicators()` once for the month and renders one tooltip-labelled coloured dot per matching daily/journal/meeting/custom system.
@@ -384,8 +383,6 @@ Renders `recentFilesFor(plugin.recentFiles, settings.show)` as Obsidian-native `
**Header switch** (`.waypoint-recent-show`): `all` / `opened` / `changed`, saved to `settings.recentFiles.show`.
**Type pills** (only when `showTypeFilter`): with `types` configured, one pill per type in that order (count may be 0); otherwise one per frontmatter `type` present, most frequent first. The pill filter is view state (`recentFilesFilter`) and resets when pills are turned off. Types with an empty name (rows being typed in settings) are ignored.
**Type icons** (`.waypoint-recent-icon`): a file whose frontmatter `type` matches a configured type with an icon shows that Lucide icon before its name. Once any type has an icon, every row reserves the slot so names stay aligned.
**Per-file features:**
+1 -2
View File
@@ -142,9 +142,8 @@
- [ ] Vault startup does not flood the list with every file
- [ ] With Max items = N, many background changes do not push out the N most recently opened files
- [ ] An existing list from before this version keeps its order (all entries appear under "opened")
- [ ] Settings → Recent Files → Type filter off hides the pills; on shows them again
- [ ] File types: add a type, pick an icon in the picker, matching recent files show the icon; names stay aligned; trash removes the type
- [ ] An old "Filter tags" list appears as File types without icons
- [ ] Settings → Recent Files has no "Type filter" toggle and no pills appear above the list; an old saved `filterTags`/`showTypeFilter` loads without error and is dropped
## Mobile
+6 -1
View File
@@ -2,11 +2,16 @@
Calendar, recent files, and custom bookmarks sidebar for Obsidian.
## v1.10.0
- Calendar weekday headings use single English letters and month names use English abbreviations.
- Removed Recent Files type-filter pills and their toggle; **File types** icons and **Omitted tags** remain available.
## Features
- **Calendar panel** — refined month grid; left-click a day opens its daily note, middle-click opens it in a tab, and right-click reveals every configured note system for that date. The date button beside **Today** jumps to any date.
- **Calendar indicators** — retain a single neutral note dot or show a coloured dot per daily, journal, meeting, or custom date system
- **Recent files** — files you opened and files that changed. The switch beside the title shows all, only opened, or only changed files. A dot marks a file changed in the background (sync, another plugin) until you open it. Give frontmatter types (meeting, daily-note…) an icon under **Settings → Recent Files → File types**; the type filter pills can be turned off.
- **Recent files** — files you opened and files that changed. The switch beside the title shows all, only opened, or only changed files. A dot marks a file changed in the background (sync, another plugin) until you open it. Give frontmatter types (meeting, daily-note…) an icon under **Settings → Recent Files → File types**.
- **Mobile** — the whole calendar stays on screen when the sidebar opens; the lists above it scroll on their own.
- **Favorites** — custom bookmarks with groups, icons, and rename
+12 -12
View File
@@ -2,22 +2,22 @@
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
*/
var ie=Object.defineProperty;var ke=Object.getOwnPropertyDescriptor;var be=Object.getOwnPropertyNames;var De=Object.prototype.hasOwnProperty;var Fe=(c,d)=>{for(var e in d)ie(c,e,{get:d[e],enumerable:!0})},Se=(c,d,e,n)=>{if(d&&typeof d=="object"||typeof d=="function")for(let i of be(d))!De.call(c,i)&&i!==e&&ie(c,i,{get:()=>d[i],enumerable:!(n=ke(d,i))||n.enumerable});return c};var xe=c=>Se(ie({},"__esModule",{value:!0}),c);var Ae={};Fe(Ae,{default:()=>ne});module.exports=xe(Ae);var f=require("obsidian");var _={name:"",folder:"",nameFormat:"YYYY-MM-DD - {title}",templateFile:"",typeProperty:"",icon:"file",indicatorColor:"#64748b"},P={calendar:{firstDayOfWeek:1,showNoteIndicators:!0,indicatorMode:"systems",dailyIndicatorColor:"#3b82f6"},daily:{folder:"periodic/daily",templateFile:"Templates/Daily note",nameFormat:"YYYY-MM-DD",typeProperty:"daily-note"},reusePeriodicNoteTabs:!1,weekly:{folder:"periodic/weekly",templateFile:"Templates/Weekly note",nameFormat:"GGGG-[W]WW",typeProperty:"weekly-note"},monthly:{folder:"periodic/monthly",templateFile:"Templates/Monthly note",nameFormat:"YYYY-MM",typeProperty:"monthly-note"},quarterly:{folder:"periodic/quarterly",templateFile:"Templates/Quarterly note",nameFormat:"YYYY-[Q]Q",typeProperty:"quarterly-note"},yearly:{folder:"periodic/yearly",templateFile:"Templates/Yearly note",nameFormat:"YYYY",typeProperty:"yearly-note"},dateSystems:[{id:"journal",name:"Journal",folder:"periodic/journal",nameFormat:"YYYY-MM-DD - [Journal]",templateFile:"",typeProperty:"journal",icon:"book-open",indicatorColor:"#22c55e"},{id:"meetings",name:"Meeting",folder:"periodic/meetings",nameFormat:"YYYY-MM-DD - {title}",templateFile:"",typeProperty:"meeting",icon:"users",indicatorColor:"#a855f7"}],recentFiles:{maxItems:50,show:"all",omittedPaths:[],omittedTags:[],showTypeFilter:!0,types:[]},display:{rowSize:26,rowSpacing:2,indentSize:16,fontSize:13,iconSize:16,calendarCellSize:32}};var y=require("obsidian");var me="{title}";function q(c){let d=c.indexOf(me);return d<0?{before:c,after:"",hasTitle:!1}:{before:c.slice(0,d),after:c.slice(d+me.length),hasTitle:!0}}function ae(c,d){if(!d)return!0;let e=d.endsWith("/")?d:`${d}/`;return c.startsWith(e)}function se(c,d,e,n){return n?!d||c.length<d.length+e.length?!1:c.startsWith(d)&&c.endsWith(e):c===d+e}function ue(c,d,e){let n=c.startsWith(d)?d.length:0,i=e&&c.endsWith(e)?c.length-e.length:c.length;return i<=n?c:c.slice(n,i).trim()||c}var Te=/[\\/:*?"<>|#^[\]]/g;function ge(c){return c.replace(Te,"-").replace(/\s+/g," ").trim()}function $(c){let{before:d}=q(c),e=d.replace(/\[[^\]]*\]/g,"");return/[YMDQGWEwdgeo]/.test(e)}var m=require("obsidian");var Y=require("obsidian");function ye(c,d,e){let n=(0,Y.moment)({year:c,month:d,day:1}),i=(0,Y.moment)(n).endOf("month"),t=(0,Y.moment)(n).subtract((n.day()-e+7)%7,"days"),a=(0,Y.moment)().startOf("day"),r=[],s=(0,Y.moment)(t);for(;s.isBefore(i)||s.month()===d;){let o=[];for(let l=0;l<7;l++)o.push({date:(0,Y.moment)(s),dayOfMonth:s.date(),isToday:s.isSame(a,"day"),isCurrentMonth:s.month()===d,isoWeekNumber:s.isoWeek()}),s.add(1,"day");if(r.push({weekNumber:o[0].isoWeekNumber,days:o}),r.length>=6)break}return r}function Ee(c,d){return d==="opened"?c.openedAt:d==="changed"||c.openedAt===void 0?c.changedAt:c.changedAt===void 0?c.openedAt:Math.max(c.openedAt,c.changedAt)}function W(c,d){let e=[];for(let n of c){let i=Ee(n,d);i!==void 0&&e.push({entry:n,key:i})}return e.sort((n,i)=>i.key-n.key),e.map(n=>n.entry)}function K(c,d){let e=new Set([...W(c,"opened").slice(0,d),...W(c,"changed").slice(0,d)]);return W(c,"all").filter(n=>e.has(n))}var E="waypoint-view";function Me(c){return c.dragManager}var z=class extends m.ItemView{constructor(e,n){super(e);this.redraw=()=>{this.contentEl.empty(),this.contentEl.addClass("waypoint-view");let e=this.plugin.settings.display;this.contentEl.style.setProperty("--wp-row-size",e.rowSize+"px"),this.contentEl.style.setProperty("--wp-row-spacing",e.rowSpacing+"px"),this.contentEl.style.setProperty("--wp-indent-size",e.indentSize+"px"),this.contentEl.style.setProperty("--wp-font-size",e.fontSize+"px"),this.contentEl.style.setProperty("--wp-icon-size",e.iconSize+"px"),this.contentEl.style.setProperty("--wp-cal-cell-size",e.calendarCellSize+"px");let n=this.contentEl.createDiv({cls:"waypoint-lists"});this.renderFavorites(n),this.renderRecentFiles(n),this.renderCalendar()};this.currentDisplayMonth=(0,m.moment)().month();this.currentDisplayYear=(0,m.moment)().year();this.dragId=null;this.dropZones=new WeakMap;this.recentFilesFilter=null;this.selectedDate=null;this.plugin=n}getViewType(){return E}getDisplayText(){return"Waypoint"}getIcon(){return"compass"}async onOpen(){this.redraw()}async onClose(){}showDate(e){this.currentDisplayMonth=e.month(),this.currentDisplayYear=e.year(),this.selectedDate=e.clone(),this.redraw()}renderCalendar(){var le;let n=this.contentEl.createDiv({cls:"waypoint-section waypoint-calendar-section"}).createDiv({cls:"waypoint-calendar"}),i=(0,m.moment)(),t=(0,m.momenLine truncated
var ne=Object.defineProperty;var ke=Object.getOwnPropertyDescriptor;var be=Object.getOwnPropertyNames;var De=Object.prototype.hasOwnProperty;var Se=(c,d)=>{for(var e in d)ne(c,e,{get:d[e],enumerable:!0})},Fe=(c,d,e,n)=>{if(d&&typeof d=="object"||typeof d=="function")for(let a of be(d))!De.call(c,a)&&a!==e&&ne(c,a,{get:()=>d[a],enumerable:!(n=ke(d,a))||n.enumerable});return c};var xe=c=>Fe(ne({},"__esModule",{value:!0}),c);var Ae={};Se(Ae,{default:()=>ee});module.exports=xe(Ae);var y=require("obsidian");var G={name:"",folder:"",nameFormat:"YYYY-MM-DD - {title}",templateFile:"",typeProperty:"",icon:"file",indicatorColor:"#64748b"},M={calendar:{firstDayOfWeek:1,showNoteIndicators:!0,indicatorMode:"systems",dailyIndicatorColor:"#3b82f6"},daily:{folder:"periodic/daily",templateFile:"Templates/Daily note",nameFormat:"YYYY-MM-DD",typeProperty:"daily-note"},reusePeriodicNoteTabs:!1,weekly:{folder:"periodic/weekly",templateFile:"Templates/Weekly note",nameFormat:"GGGG-[W]WW",typeProperty:"weekly-note"},monthly:{folder:"periodic/monthly",templateFile:"Templates/Monthly note",nameFormat:"YYYY-MM",typeProperty:"monthly-note"},quarterly:{folder:"periodic/quarterly",templateFile:"Templates/Quarterly note",nameFormat:"YYYY-[Q]Q",typeProperty:"quarterly-note"},yearly:{folder:"periodic/yearly",templateFile:"Templates/Yearly note",nameFormat:"YYYY",typeProperty:"yearly-note"},dateSystems:[{id:"journal",name:"Journal",folder:"periodic/journal",nameFormat:"YYYY-MM-DD - [Journal]",templateFile:"",typeProperty:"journal",icon:"book-open",indicatorColor:"#22c55e"},{id:"meetings",name:"Meeting",folder:"periodic/meetings",nameFormat:"YYYY-MM-DD - {title}",templateFile:"",typeProperty:"meeting",icon:"users",indicatorColor:"#a855f7"}],recentFiles:{maxItems:50,show:"all",omittedPaths:[],omittedTags:[],types:[]},display:{rowSize:26,rowSpacing:2,indentSize:16,fontSize:13,iconSize:16,calendarCellSize:32}};var f=require("obsidian");var me="{title}";function V(c){let d=c.indexOf(me);return d<0?{before:c,after:"",hasTitle:!1}:{before:c.slice(0,d),after:c.slice(d+me.length),hasTitle:!0}}function ae(c,d){if(!d)return!0;let e=d.endsWith("/")?d:`${d}/`;return c.startsWith(e)}function ie(c,d,e,n){return n?!d||c.length<d.length+e.length?!1:c.startsWith(d)&&c.endsWith(e):c===d+e}function ue(c,d,e){let n=c.startsWith(d)?d.length:0,a=e&&c.endsWith(e)?c.length-e.length:c.length;return a<=n?c:c.slice(n,a).trim()||c}var Te=/[\\/:*?"<>|#^[\]]/g;function ge(c){return c.replace(Te,"-").replace(/\s+/g," ").trim()}function W(c){let{before:d}=V(c),e=d.replace(/\[[^\]]*\]/g,"");return/[YMDQGWEwdgeo]/.test(e)}var h=require("obsidian");var B=require("obsidian");function ye(c,d,e){let n=(0,B.moment)({year:c,month:d,day:1}),a=(0,B.moment)(n).endOf("month"),t=(0,B.moment)(n).subtract((n.day()-e+7)%7,"days"),i=(0,B.moment)().startOf("day"),r=[],s=(0,B.moment)(t);for(;s.isBefore(a)||s.month()===d;){let o=[];for(let l=0;l<7;l++)o.push({date:(0,B.moment)(s),dayOfMonth:s.date(),isToday:s.isSame(i,"day"),isCurrentMonth:s.month()===d,isoWeekNumber:s.isoWeek()}),s.add(1,"day");if(r.push({weekNumber:o[0].isoWeekNumber,days:o}),r.length>=6)break}return r}function Ee(c,d){return d==="opened"?c.openedAt:d==="changed"||c.openedAt===void 0?c.changedAt:c.changedAt===void 0?c.openedAt:Math.max(c.openedAt,c.changedAt)}function R(c,d){let e=[];for(let n of c){let a=Ee(n,d);a!==void 0&&e.push({entry:n,key:a})}return e.sort((n,a)=>a.key-n.key),e.map(n=>n.entry)}function j(c,d){let e=new Set([...R(c,"opened").slice(0,d),...R(c,"changed").slice(0,d)]);return R(c,"all").filter(n=>e.has(n))}var E="waypoint-view";function Me(c){return c.dragManager}var O=class extends h.ItemView{constructor(e,n){super(e);this.redraw=()=>{this.contentEl.empty(),this.contentEl.addClass("waypoint-view");let e=this.plugin.settings.display;this.contentEl.style.setProperty("--wp-row-size",e.rowSize+"px"),this.contentEl.style.setProperty("--wp-row-spacing",e.rowSpacing+"px"),this.contentEl.style.setProperty("--wp-indent-size",e.indentSize+"px"),this.contentEl.style.setProperty("--wp-font-size",e.fontSize+"px"),this.contentEl.style.setProperty("--wp-icon-size",e.iconSize+"px"),this.contentEl.style.setProperty("--wp-cal-cell-size",e.calendarCellSize+"px");let n=this.contentEl.createDiv({cls:"waypoint-lists"});this.renderFavorites(n),this.renderRecentFiles(n),this.renderCalendar()};this.currentDisplayMonth=(0,h.moment)().month();this.currentDisplayYear=(0,h.moment)().year();this.dragId=null;this.dropZones=new WeakMap;this.selectedDate=null;this.plugin=n}getViewType(){return E}getDisplayText(){return"Waypoint"}getIcon(){return"compass"}async onOpen(){this.redraw()}async onClose(){}showDate(e){this.currentDisplayMonth=e.month(),this.currentDisplayYear=e.year(),this.selectedDate=e.clone(),this.redraw()}renderCalendar(){var le;let n=this.contentEl.createDiv({cls:"waypoint-section waypoint-calendar-section"}).createDiv({cls:"waypoint-calendar"}),a=(0,h.moment)(),t=(0,h.moment)({year:this.currentDisplayYear,month:this.cuLine truncated
\\.png$`),t.setValue(this.settings.recentFiles.omittedPaths.join(`
`)),t.inputEl.onblur=()=>{this.settings.recentFiles.omittedPaths=t.getValue().split(`
`).filter(a=>a.trim()),this.saveAndRefresh()}});let i=new DocumentFragment;i.appendText("Regex patterns for frontmatter tags to exclude. One per line."),new y.Setting(e).setName("Omitted tags").setDesc(i).addTextArea(t=>{t.inputEl.setAttr("rows",4),t.setPlaceholder(`ignore
`).filter(i=>i.trim()),this.saveAndRefresh()}});let a=new DocumentFragment;a.appendText("Regex patterns for frontmatter tags to exclude. One per line."),new f.Setting(e).setName("Omitted tags").setDesc(a).addTextArea(t=>{t.inputEl.setAttr("rows",4),t.setPlaceholder(`ignore
archive`),t.setValue(this.settings.recentFiles.omittedTags.join(`
`)),t.inputEl.onblur=()=>{this.settings.recentFiles.omittedTags=t.getValue().split(`
`).filter(a=>a.trim()),this.saveAndRefresh()}}),new y.Setting(e).setName("Type filter").setDesc("Show pills above the list to filter recent files by their frontmatter `type`.").addToggle(t=>{t.setValue(this.settings.recentFiles.showTypeFilter).onChange(a=>{this.settings.recentFiles.showTypeFilter=a,this.saveAndRefresh()})}),this.renderRecentTypes(e)}renderRecentTypes(e){let n=this.settings.recentFiles.types;new y.Setting(e).setHeading().setName("File types").setDesc("Frontmatter `type` values. A type's icon shows beside matching recent files. With the type filter on, these types are the pills, in this order; with no types listed, pills are detected automatically."),n.forEach((i,t)=>{new y.Setting(e).addText(a=>{a.setPlaceholder("meeting"),a.setValue(i.type),a.inputEl.onblur=()=>{let r=a.getValue().trim();r!==i.type&&(i.type=r,this.saveAndRefresh())}}).addExtraButton(a=>{a.setIcon(i.icon||"image-off").setTooltip(i.icon?`Icon: ${i.icon}`:"Choose icon").onClick(()=>{new G(this.app,i.icon,r=>{i.icon=r,this.saveAndRefresh(),this.display()}).open()})}).addExtraButton(a=>{a.setIcon("trash").setTooltip("Remove this type").onClick(()=>{n.splice(t,1),this.saveAndRefresh(),this.display()})})}),new y.Setting(e).addButton(i=>{i.setButtonText("Add type").onClick(()=>{n.push({type:"",icon:""}),this.display()})})}renderDisplayTab(e){new y.Setting(e).setHeading().setName("Bookmarks"),this.addSliderSetting(e,"Row size","Height of bookmark items.",this.settings.display,"rowSize",18,40,1,"px"),this.addSliderSetting(e,"Row spacing","Gap between bookmark items.",this.settings.display,"rowSpacing",0,12,1,"px"),this.addSliderSetting(e,"Indent size","Indent per nesting depth.",this.settings.display,"indentSize",8,32,2,"px"),this.addSliderSetting(e,"Font size","Label font size.",this.settings.display,"fontSize",10,18,1,"px"),this.addSliderSetting(e,"Icon size","Bookmark icon size.",this.settings.display,"iconSize",12,24,1,"px"),new y.Setting(e).setHeading().setName("Calendar"),this.addSliderSetting(e,"Cell size","Height of calendar day cells.",this.settings.display,"calendarCellSize",20,48,2,"px"),new y.Setting(e).addButton(n=>n.setButtonText("Reset to defaults").onClick(()=>{this.settings.display={...P.display},this.saveAndRefresh(),this.display()}))}addSliderSetting(e,n,i,t,a,r,s,o,l){let p=new y.Setting(e).setName(n).setDesc(`${i} (${t[a]}${l})`);p.addSlider(u=>{u.setLimits(r,s,o).setValue(t[a]).setDynamicTooltip().onChange(D=>{t[a]=D,p.setDesc(`${i} (${D}${l})`),this.saveAndRefresh()})})}async saveAndRefresh(){await this.plugin.saveSettings(),this.onSettingsChange()}renderAboutTab(e){let n=this.plugin.manifest.version,i=e.createDiv();i.style.display="flex",i.style.alignItems="center",i.style.gap="12px",i.style.marginBottom="16px";let t=i.createDiv();t.style.display="flex",t.style.alignItems="center",t.style.justifyContent="center",t.style.width="48px",t.style.height="48px",t.style.borderRadius="12px",t.style.background="var(--interactive-accent)",t.style.color="var(--text-on-accent)",t.style.fontSize="24px",(0,y.setIcon)(t,"compass");let a=i.createDiv(),r=a.createEl("h2",{text:"Waypoint Sidebar"});r.style.margin="0",r.style.lineHeight="1.2";let s=a.createDiv({text:`v${n}`});s.style.color="var(--text-muted)",s.style.fontSize="var(--font-ui-small)";let o=e.createDiv();o.style.marginBottom="20px",o.style.lineHeight="1.6",o.style.color="var(--text-normal)",o.innerHTML=["<p><strong>Waypoint</strong> is a sidebar plugin that brings three essential panels into one view:</p>",'<ul style="padding-left: 20px; margin: 8px 0;">',"<li><strong>Calendar</strong> \u2014 a monthly grid for your periodic notes (daily, weekly, monthly, quarterly, yearly). Click any day, week, or month to open or create the corresponding note.</li>","<li><strong>Recent Files</strong> \u2014 a list of recently opened files with type filtering, drag-and-drop, and right-click actions.</li>","<li><strong>Bookmarks</strong> \u2014 custom bookmarks with icons, groups, nesting, and drag-and-drop reordering. Separate from Obsidian's native bookmarks.</li>","</ul>",'<p style="color: var(--text-muted); font-size: var(--font-ui-small);">Made by Olivier. Licensed under MIT.</p>'].join(`
`)}};var ee=require("obsidian"),X=class extends ee.Modal{constructor(e,n,i){super(e);this.initialDate=n;this.onSubmit=i}onOpen(){this.titleEl.setText("Open date");let e=this.contentEl.createEl("input",{type:"date",value:this.initialDate.format("YYYY-MM-DD")});e.style.width="100%",e.style.marginBottom="12px",e.focus();let n=()=>{let t=(0,ee.moment)(e.value,"YYYY-MM-DD",!0);t.isValid()&&(this.close(),this.onSubmit(t))};e.addEventListener("keydown",t=>{t.key==="Enter"&&n()});let i=this.contentEl.createDiv({cls:"modal-button-container"});i.createEl("button",{text:"Cancel"}).addEventListener("click",()=>this.close()),i.createEl("button",{text:"Open",cls:"mod-cta"}).addEventListener("click",n)}onClose(){this.contentEl.empty()}};function oe(c,d,e){return!c||!d?null:c===d?e:c.startsWith(d+"/")?e+c.slice(d.length):null}var ne=class extends f.Plugin{constructor(){super(...arguments);this.recentFiles=[];this.savePromise=Promise.resolve();this.markdownBasenames=new Set;this.dateSystemIndicators=null;this.dateSystemIndicatorKey="";this.indicatorModeMigrated=!1;this.previouslyActive=null;this.activePath=null}async onload(){console.debug("Waypoint: loading plugin v"+this.manifest.version);let e=await this.loadData(),n=this.applySettings(e);this.applyWaypointData(e),n&&this.persistAll(),this.registerView(E,s=>new z(s,this)),this.addSettingTab(new J(this.app,this,this.settings,()=>{this.enforceRecentFilesLimit(),this.invalidateDateSystemIndicators(),this.redrawAll()})),this.addCommand({id:"waypoint-open-view",name:"Open Waypoint sidebar",callback:async()=>{let s=this.app.workspace.getLeavesOfType(E);if(s.length>0)await this.app.workspace.revealLeaf(s[0]);else{let o=this.app.workspace.getLeftLeaf(!1);o&&(await o.setViewState({type:E}),await this.app.workspace.revealLeaf(o))}}}),this.addCommand({id:"waypoint-add-bookmark",name:"Add current file as Waypoint bookmark",callback:async()=>{let s=this.app.workspace.getActiveFile();if(!s){new f.Notice("No active file");return}this.addBookmark(s.path,s.basename,"file"),new f.Notice(`Bookmarked: ${s.basename}`)}}),this.addCommand({id:"waypoint-go-to-daily",name:"Go to daily note",hotkeys:[{modifiers:["Mod","Shift","Alt"],key:"d"}],callback:async()=>{await this.openPeriodNote("day",(0,f.moment)())}}),this.addCommand({id:"waypoint-go-to-weekly",name:"Go to weekly note",hotkeys:[{modifiers:["Mod","Shift","Alt"],key:"w"}],callback:async()=>{await this.openPeriodNote("week",(0,f.moment)())}}),this.addCommand({id:"waypoint-go-to-monthly",name:"Go to monthly note",hotkeys:[{modifiers:["Mod","Shift","Alt"],key:"m"}],callback:async()=>{await this.openPeriodNote("month",(0,f.moment)())}}),this.addCommand({id:"waypoint-go-to-quarterly",name:"Go to quarterly note",hotkeys:[{modifiers:["Mod","Shift","Alt"],key:"q"}],callback:async()=>{await this.openPeriodNote("quarter",(0,f.moment)())}}),this.addCommand({id:"waypoint-go-to-yearly",name:"Go to yearly note",hotkeys:[{modifiers:["Mod","Shift","Alt"],key:"y"}],callback:async()=>{await this.openPeriodNote("year",(0,f.moment)())}}),this.addCommand({id:"waypoint-open-date",name:"Open daily note for a date\u2026",callback:()=>{new X(this.app,(0,f.moment)(),s=>{this.showDateInViews(s),this.openPeriodNote("day",s)}).open()}});let i=["next","prev"],t=["daily","weekly","monthly","quarterly","yearly"],a={next:"Next",prev:"Previous"};for(let s of t)for(let o of i){let l=`waypoint-go-to-${o}-${s}`,p=`${a[o]} ${s} note`;this.addCommand({id:l,name:p,callback:async()=>{await this.navigatePeriodNote(o)}})}this.registerEvent(this.app.workspace.on("file-open",s=>{s&&this.onFileOpen(s)})),this.registerEvent(this.app.vault.on("create",s=>this.onVaultCreate(s))),this.registerEvent(this.app.vault.on("delete",s=>this.onVaultDelete(s))),this.registerEvent(this.app.vault.on("rename",(s,o)=>this.onRename(s,o))),this.registerEvent(this.app.vault.on("modify",s=>this.onFileChange(s))),this.app.workspace.onLayoutReady(()=>{if(this.buildMarkdownIndex(),this.app.workspace.getLeavesOfType(E).length===0){let o=this.app.workspace.getLeftLeaf(!1);o&&o.setViewState({type:E})}else this.broadcastRedraw()});let r=new Date().toDateString();this.registerInterval(window.setInterval(()=>{let s=new Date().toDateString();s!==r&&(r=s,this.redrawAll())},6e5))}async onunload(){this.app.workspace.detachLeavesOfType(E)}applySettings(e){var r,s,o;let n=(e==null?void 0:e.settings)||{};this.settings=Object.assign({},P,n),this.settings.recentFiles=Object.assign({},P.recentFiles,n.recentFiles||{});let i=this.settings.recentFiles;this.settings.recentFiles.types=Array.isArray((r=n.recentFiles)==null?void 0:r.types)?n.recentFiles.types.map(l=>({...l})):((s=i.filterTags)!=null?s:[]).map(l=>({type:l,icon:""})),delete i.filterTags,delete i.updateOn,this.settings.calendar=Object.assign({},P.calendar,n.calendar||{}),this.settings.display=Object.assign({},P.display,n.display||{});for(let l of Ce)this.settings[l]=Object.assign({},P[l],n[l]||{});this.settings.dateSystems=Array.isArray(n.dateSystems)?n.dateSystems. Line truncated
${re(u)}
Check Settings \u2192 Waypoint Sidebar \u2192 Periodic Notes.`,j),null}let s=n.templateFile,o=this.resolveTemplateFile(s),l;if(o)try{l=await this.app.vault.read(o)}catch(u){return new f.Notice(`Waypoint: could not read the template "${o.path}" for the ${t} note.
`+re(u),j),null}else l=`---
`).filter(i=>i.trim()),this.saveAndRefresh()}}),this.renderRecentTypes(e)}renderRecentTypes(e){let n=this.settings.recentFiles.types;new f.Setting(e).setHeading().setName("File types").setDesc("Frontmatter `type` values. A type's icon shows beside matching recent files."),n.forEach((a,t)=>{new f.Setting(e).addText(i=>{i.setPlaceholder("meeting"),i.setValue(a.type),i.inputEl.onblur=()=>{let r=i.getValue().trim();r!==a.type&&(a.type=r,this.saveAndRefresh())}}).addExtraButton(i=>{i.setIcon(a.icon||"image-off").setTooltip(a.icon?`Icon: ${a.icon}`:"Choose icon").onClick(()=>{new H(this.app,a.icon,r=>{a.icon=r,this.saveAndRefresh(),this.display()}).open()})}).addExtraButton(i=>{i.setIcon("trash").setTooltip("Remove this type").onClick(()=>{n.splice(t,1),this.saveAndRefresh(),this.display()})})}),new f.Setting(e).addButton(a=>{a.setButtonText("Add type").onClick(()=>{n.push({type:"",icon:""}),this.display()})})}renderDisplayTab(e){new f.Setting(e).setHeading().setName("Bookmarks"),this.addSliderSetting(e,"Row size","Height of bookmark items.",this.settings.display,"rowSize",18,40,1,"px"),this.addSliderSetting(e,"Row spacing","Gap between bookmark items.",this.settings.display,"rowSpacing",0,12,1,"px"),this.addSliderSetting(e,"Indent size","Indent per nesting depth.",this.settings.display,"indentSize",8,32,2,"px"),this.addSliderSetting(e,"Font size","Label font size.",this.settings.display,"fontSize",10,18,1,"px"),this.addSliderSetting(e,"Icon size","Bookmark icon size.",this.settings.display,"iconSize",12,24,1,"px"),new f.Setting(e).setHeading().setName("Calendar"),this.addSliderSetting(e,"Cell size","Height of calendar day cells.",this.settings.display,"calendarCellSize",20,48,2,"px"),new f.Setting(e).addButton(n=>n.setButtonText("Reset to defaults").onClick(()=>{this.settings.display={...M.display},this.saveAndRefresh(),this.display()}))}addSliderSetting(e,n,a,t,i,r,s,o,l){let p=new f.Setting(e).setName(n).setDesc(`${a} (${t[i]}${l})`);p.addSlider(u=>{u.setLimits(r,s,o).setValue(t[i]).setDynamicTooltip().onChange(D=>{t[i]=D,p.setDesc(`${a} (${D}${l})`),this.saveAndRefresh()})})}async saveAndRefresh(){await this.plugin.saveSettings(),this.onSettingsChange()}renderAboutTab(e){let n=this.plugin.manifest.version,a=e.createDiv();a.style.display="flex",a.style.alignItems="center",a.style.gap="12px",a.style.marginBottom="16px";let t=a.createDiv();t.style.display="flex",t.style.alignItems="center",t.style.justifyContent="center",t.style.width="48px",t.style.height="48px",t.style.borderRadius="12px",t.style.background="var(--interactive-accent)",t.style.color="var(--text-on-accent)",t.style.fontSize="24px",(0,f.setIcon)(t,"compass");let i=a.createDiv(),r=i.createEl("h2",{text:"Waypoint Sidebar"});r.style.margin="0",r.style.lineHeight="1.2";let s=i.createDiv({text:`v${n}`});s.style.color="var(--text-muted)",s.style.fontSize="var(--font-ui-small)";let o=e.createDiv();o.style.marginBottom="20px",o.style.lineHeight="1.6",o.style.color="var(--text-normal)",o.innerHTML=["<p><strong>Waypoint</strong> is a sidebar plugin that brings three essential panels into one view:</p>",'<ul style="padding-left: 20px; margin: 8px 0;">',"<li><strong>Calendar</strong> \u2014 a monthly grid for your periodic notes (daily, weekly, monthly, quarterly, yearly). Click any day, week, or month to open or create the corresponding note.</li>","<li><strong>Recent Files</strong> \u2014 a list of recently opened and changed files with type icons, drag-and-drop, and right-click actions.</li>","<li><strong>Bookmarks</strong> \u2014 custom bookmarks with icons, groups, nesting, and drag-and-drop reordering. Separate from Obsidian's native bookmarks.</li>","</ul>",'<p style="color: var(--text-muted); font-size: var(--font-ui-small);">Made by Olivier. Licensed under MIT.</p>'].join(`
`)}};var J=require("obsidian"),Z=class extends J.Modal{constructor(e,n,a){super(e);this.initialDate=n;this.onSubmit=a}onOpen(){this.titleEl.setText("Open date");let e=this.contentEl.createEl("input",{type:"date",value:this.initialDate.format("YYYY-MM-DD")});e.style.width="100%",e.style.marginBottom="12px",e.focus();let n=()=>{let t=(0,J.moment)(e.value,"YYYY-MM-DD",!0);t.isValid()&&(this.close(),this.onSubmit(t))};e.addEventListener("keydown",t=>{t.key==="Enter"&&n()});let a=this.contentEl.createDiv({cls:"modal-button-container"});a.createEl("button",{text:"Cancel"}).addEventListener("click",()=>this.close()),a.createEl("button",{text:"Open",cls:"mod-cta"}).addEventListener("click",n)}onClose(){this.contentEl.empty()}};function se(c,d,e){return!c||!d?null:c===d?e:c.startsWith(d+"/")?e+c.slice(d.length):null}var ee=class extends y.Plugin{constructor(){super(...arguments);this.recentFiles=[];this.savePromise=Promise.resolve();this.markdownBasenames=new Set;this.dateSystemIndicators=null;this.dateSystemIndicatorKey="";this.indicatorModeMigrated=!1;this.previouslyActive=null;this.activePath=null}async onload(){console.debug("Waypoint: loading plugin v"+this.manifest.version);let e=await this.loadData(),n=this.applySettings(e);this.applyWaypointData(e),n&&this.persistAll(),this.registerView(E,s=>new O(s,this)),this.addSettingTab(new U(this.app,this,this.settings,()=>{this.enforceRecentFilesLimit(),this.invalidateDateSystemIndicators(),this.redrawAll()})),this.addCommand({id:"waypoint-open-view",name:"Open Waypoint sidebar",callback:async()=>{let s=this.app.workspace.getLeavesOfType(E);if(s.length>0)await this.app.workspace.revealLeaf(s[0]);else{let o=this.app.workspace.getLeftLeaf(!1);o&&(await o.setViewState({type:E}),await this.app.workspace.revealLeaf(o))}}}),this.addCommand({id:"waypoint-add-bookmark",name:"Add current file as Waypoint bookmark",callback:async()=>{let s=this.app.workspace.getActiveFile();if(!s){new y.Notice("No active file");return}this.addBookmark(s.path,s.basename,"file"),new y.Notice(`Bookmarked: ${s.basename}`)}}),this.addCommand({id:"waypoint-go-to-daily",name:"Go to daily note",hotkeys:[{modifiers:["Mod","Shift","Alt"],key:"d"}],callback:async()=>{await this.openPeriodNote("day",(0,y.moment)())}}),this.addCommand({id:"waypoint-go-to-weekly",name:"Go to weekly note",hotkeys:[{modifiers:["Mod","Shift","Alt"],key:"w"}],callback:async()=>{await this.openPeriodNote("week",(0,y.moment)())}}),this.addCommand({id:"waypoint-go-to-monthly",name:"Go to monthly note",hotkeys:[{modifiers:["Mod","Shift","Alt"],key:"m"}],callback:async()=>{await this.openPeriodNote("month",(0,y.moment)())}}),this.addCommand({id:"waypoint-go-to-quarterly",name:"Go to quarterly note",hotkeys:[{modifiers:["Mod","Shift","Alt"],key:"q"}],callback:async()=>{await this.openPeriodNote("quarter",(0,y.moment)())}}),this.addCommand({id:"waypoint-go-to-yearly",name:"Go to yearly note",hotkeys:[{modifiers:["Mod","Shift","Alt"],key:"y"}],callback:async()=>{await this.openPeriodNote("year",(0,y.moment)())}}),this.addCommand({id:"waypoint-open-date",name:"Open daily note for a date\u2026",callback:()=>{new Z(this.app,(0,y.moment)(),s=>{this.showDateInViews(s),this.openPeriodNote("day",s)}).open()}});let a=["next","prev"],t=["daily","weekly","monthly","quarterly","yearly"],i={next:"Next",prev:"Previous"};for(let s of t)for(let o of a){let l=`waypoint-go-to-${o}-${s}`,p=`${i[o]} ${s} note`;this.addCommand({id:l,name:p,callback:async()=>{await this.navigatePeriodNote(o)}})}this.registerEvent(this.app.workspace.on("file-open",s=>{s&&this.onFileOpen(s)})),this.registerEvent(this.app.vault.on("create",s=>this.onVaultCreate(s))),this.registerEvent(this.app.vault.on("delete",s=>this.onVaultDelete(s))),this.registerEvent(this.app.vault.on("rename",(s,o)=>this.onRename(s,o))),this.registerEvent(this.app.vault.on("modify",s=>this.onFileChange(s))),this.app.workspace.onLayoutReady(()=>{if(this.buildMarkdownIndex(),this.app.workspace.getLeavesOfType(E).length===0){let o=this.app.workspace.getLeftLeaf(!1);o&&o.setViewState({type:E})}else this.broadcastRedraw()});let r=new Date().toDateString();this.registerInterval(window.setInterval(()=>{let s=new Date().toDateString();s!==r&&(r=s,this.redrawAll())},6e5))}async onunload(){this.app.workspace.detachLeavesOfType(E)}applySettings(e){var r,s;let n=(e==null?void 0:e.settings)||{};this.settings=Object.assign({},M,n),this.settings.recentFiles=Object.assign({},M.recentFiles,n.recentFiles||{});let a=this.settings.recentFiles;this.settings.recentFiles.types=Array.isArray((r=n.recentFiles)==null?void 0:r.types)?n.recentFiles.types.map(o=>({...o})):[],delete a.filterTags,delete a.showTypeFilter,delete a.updateOn,this.settings.calendar=Object.assign({},M.calendar,n.calendar||{}),this.settings.display=Object.assign({},M.display,n.display||{});for(let o of Ce)this.settings[o]=Object.assign({},M[o],n[o]||{});this.settings.dateSystems=Array.isArray(n.dateSystems)?n.dateSystems.map(o=>{let l=M.dateSystems.find(p= Line truncated
${oe(u)}
Check Settings \u2192 Waypoint Sidebar \u2192 Periodic Notes.`,q),null}let s=n.templateFile,o=this.resolveTemplateFile(s),l;if(o)try{l=await this.app.vault.read(o)}catch(u){return new y.Notice(`Waypoint: could not read the template "${o.path}" for the ${t} note.
`+oe(u),q),null}else l=`---
type: ${n.typeProperty}
date: ${i.format("YYYY-MM-DD")}
date: ${a.format("YYYY-MM-DD")}
---
`;let p;try{p=await this.app.vault.create(e,l)}catch(u){return new f.Notice(`Waypoint: could not create the ${t} note at "${e}".
${re(u)}`,j),null}return s&&!o?new f.Notice(`Created ${t} note: ${p.basename}
Template "${s}" was not found, so a basic note was created instead.`,j):new f.Notice(`Created ${t} note: ${p.basename}`),p}async ensureFolderExists(e){if(!e||this.app.vault.getAbstractFileByPath(e)instanceof f.TFolder)return;let n="";for(let i of e.split("/"))if(i&&(n=n?`${n}/${i}`:i,!(this.app.vault.getAbstractFileByPath(n)instanceof f.TFolder)))try{await this.app.vault.createFolder(n)}catch(t){if(!(this.app.vault.getAbstractFileByPath(n)instanceof f.TFolder))throw t}}resolveTemplateFile(e){if(!e)return null;let n=e.toLowerCase().endsWith(".md")?e:`${e}.md`;return this.app.vault.getFileByPath(n)}detectPeriodType(e){for(let n of fe){let i=this.settings[te[n].key].nameFormat;if(!i)continue;let t=(0,f.moment)(e,i,!0);if(t.isValid())return{period:n,date:t}}return null}async navigatePeriodNote(e){let n=this.app.workspace.getActiveFile();if(!n){new f.Notice("No active file");return}let i=this.detectPeriodType(n.basename);if(!i){let o=fe.map(l=>`${te[l].label.toLowerCase()} "${this.settings[te[l].key].nameFormat}"`).join(", ");new f.Notice(`Waypoint: "${n.basename}" does not match any configured periodic note format.
Expected one of: ${o}.`,j);return}let{period:t,date:a}=i,r=e==="next"?1:-1,s=t==="quarter"?a.clone().add(r*3,"months"):a.clone().add(r,`${t}s`);await this.openPeriodNote(t,s)}redrawAll(){this.broadcastRedraw()}broadcastRedraw(){let e=this.app.workspace.getLeavesOfType(E);for(let n of e)n.view instanceof z&&n.view.redraw()}showDateInViews(e){for(let n of this.app.workspace.getLeavesOfType(E))n.view instanceof z&&n.view.showDate(e)}},Ce=["daily","weekly","monthly","quarterly","yearly"],te={day:{key:"daily",label:"Daily"},week:{key:"weekly",label:"Weekly"},month:{key:"monthly",label:"Monthly"},quarter:{key:"quarterly",label:"Quarterly"},year:{key:"yearly",label:"Yearly"}},fe=["day","week","month","quarter","year"];function ve(c){return c.slice(c.lastIndexOf("/")+1).replace(/\.[^/.]+$/,"")}var j=1e4,Le=5e3;function re(c){return c instanceof Error?c.message:String(c)}function V(c,d){return d?c.format(d):""}
`;let p;try{p=await this.app.vault.create(e,l)}catch(u){return new y.Notice(`Waypoint: could not create the ${t} note at "${e}".
${oe(u)}`,q),null}return s&&!o?new y.Notice(`Created ${t} note: ${p.basename}
Template "${s}" was not found, so a basic note was created instead.`,q):new y.Notice(`Created ${t} note: ${p.basename}`),p}async ensureFolderExists(e){if(!e||this.app.vault.getAbstractFileByPath(e)instanceof y.TFolder)return;let n="";for(let a of e.split("/"))if(a&&(n=n?`${n}/${a}`:a,!(this.app.vault.getAbstractFileByPath(n)instanceof y.TFolder)))try{await this.app.vault.createFolder(n)}catch(t){if(!(this.app.vault.getAbstractFileByPath(n)instanceof y.TFolder))throw t}}resolveTemplateFile(e){if(!e)return null;let n=e.toLowerCase().endsWith(".md")?e:`${e}.md`;return this.app.vault.getFileByPath(n)}detectPeriodType(e){for(let n of fe){let a=this.settings[X[n].key].nameFormat;if(!a)continue;let t=(0,y.moment)(e,a,!0);if(t.isValid())return{period:n,date:t}}return null}async navigatePeriodNote(e){let n=this.app.workspace.getActiveFile();if(!n){new y.Notice("No active file");return}let a=this.detectPeriodType(n.basename);if(!a){let o=fe.map(l=>`${X[l].label.toLowerCase()} "${this.settings[X[l].key].nameFormat}"`).join(", ");new y.Notice(`Waypoint: "${n.basename}" does not match any configured periodic note format.
Expected one of: ${o}.`,q);return}let{period:t,date:i}=a,r=e==="next"?1:-1,s=t==="quarter"?i.clone().add(r*3,"months"):i.clone().add(r,`${t}s`);await this.openPeriodNote(t,s)}redrawAll(){this.broadcastRedraw()}broadcastRedraw(){let e=this.app.workspace.getLeavesOfType(E);for(let n of e)n.view instanceof O&&n.view.redraw()}showDateInViews(e){for(let n of this.app.workspace.getLeavesOfType(E))n.view instanceof O&&n.view.showDate(e)}},Ce=["daily","weekly","monthly","quarterly","yearly"],X={day:{key:"daily",label:"Daily"},week:{key:"weekly",label:"Weekly"},month:{key:"monthly",label:"Monthly"},quarter:{key:"quarterly",label:"Quarterly"},year:{key:"yearly",label:"Yearly"}},fe=["day","week","month","quarter","year"];function ve(c){return c.slice(c.lastIndexOf("/")+1).replace(/\.[^/.]+$/,"")}var q=1e4,Le=5e3;function oe(c){return c instanceof Error?c.message:String(c)}function $(c,d){return d?c.format(d):""}
+1 -1
View File
@@ -1,7 +1,7 @@
{
"id": "waypoint-sidebar",
"name": "Waypoint Sidebar",
"version": "1.9.1",
"version": "1.10.0",
"minAppVersion": "1.4.10",
"description": "Calendar, recent files, and custom bookmarks sidebar.",
"author": "Olivier",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "waypoint",
"version": "1.9.1",
"version": "1.10.0",
"description": "Calendar, recent files, and custom bookmarks sidebar.",
"main": "main.js",
"scripts": {
+6 -4
View File
@@ -285,13 +285,15 @@ export default class WaypointPlugin extends Plugin {
const s = (saved?.settings || {}) as Partial<WaypointSettings>;
this.settings = Object.assign({}, DEFAULT_SETTINGS, s);
this.settings.recentFiles = Object.assign({}, DEFAULT_SETTINGS.recentFiles, s.recentFiles || {});
// `filterTags` (pill names only) became `types` (name + icon), and the
// single `updateOn` mode became the header filter `show`.
const legacyRecent = this.settings.recentFiles as Partial<{ filterTags: string[]; updateOn: string }>;
// Drop keys of removed features: the old type filter (`filterTags`,
// then `showTypeFilter`) and the single `updateOn` mode, now the header
// filter `show`.
const legacyRecent = this.settings.recentFiles as Partial<{ filterTags: string[]; showTypeFilter: boolean; updateOn: string }>;
this.settings.recentFiles.types = Array.isArray(s.recentFiles?.types)
? s.recentFiles.types.map(t => ({ ...t }))
: (legacyRecent.filterTags ?? []).map(type => ({ type, icon: '' }));
: [];
delete legacyRecent.filterTags;
delete legacyRecent.showTypeFilter;
delete legacyRecent.updateOn;
this.settings.calendar = Object.assign({}, DEFAULT_SETTINGS.calendar, s.calendar || {});
this.settings.display = Object.assign({}, DEFAULT_SETTINGS.display, s.display || {});
+3 -15
View File
@@ -426,29 +426,17 @@ export class WaypointSettingTab extends PluginSettingTab {
};
});
new Setting(container)
.setName('Type filter')
.setDesc('Show pills above the list to filter recent files by their frontmatter `type`.')
.addToggle((toggle) => {
toggle
.setValue(this.settings.recentFiles.showTypeFilter)
.onChange((value) => {
this.settings.recentFiles.showTypeFilter = value;
this.saveAndRefresh();
});
});
this.renderRecentTypes(container);
}
/** Frontmatter types with an icon each; also the pill list when the type filter is on. */
/** Frontmatter types with an icon each. */
private renderRecentTypes(container: HTMLElement): void {
const types = this.settings.recentFiles.types;
new Setting(container)
.setHeading()
.setName('File types')
.setDesc('Frontmatter `type` values. A type\'s icon shows beside matching recent files. With the type filter on, these types are the pills, in this order; with no types listed, pills are detected automatically.');
.setDesc('Frontmatter `type` values. A type\'s icon shows beside matching recent files.');
types.forEach((entry, i) => {
new Setting(container)
@@ -618,7 +606,7 @@ export class WaypointSettingTab extends PluginSettingTab {
`<p><strong>Waypoint</strong> is a sidebar plugin that brings three essential panels into one view:</p>`,
`<ul style="padding-left: 20px; margin: 8px 0;">`,
`<li><strong>Calendar</strong> — a monthly grid for your periodic notes (daily, weekly, monthly, quarterly, yearly). Click any day, week, or month to open or create the corresponding note.</li>`,
`<li><strong>Recent Files</strong> — a list of recently opened files with type filtering, drag-and-drop, and right-click actions.</li>`,
`<li><strong>Recent Files</strong> — a list of recently opened and changed files with type icons, drag-and-drop, and right-click actions.</li>`,
`<li><strong>Bookmarks</strong> — custom bookmarks with icons, groups, nesting, and drag-and-drop reordering. Separate from Obsidian's native bookmarks.</li>`,
`</ul>`,
`<p style="color: var(--text-muted); font-size: var(--font-ui-small);">Made by Olivier. Licensed under MIT.</p>`,
+2 -5
View File
@@ -53,7 +53,7 @@ export interface CalendarSettings {
dailyIndicatorColor: string;
}
/** A frontmatter `type` value: its icon in Recent Files and, when the type filter is on, a pill. */
/** A frontmatter `type` value and its icon in Recent Files. */
export interface RecentFileType {
type: string;
/** Lucide icon name; empty for none. */
@@ -67,9 +67,7 @@ export interface RecentFilesSettings {
show: RecentFilesShow;
omittedPaths: string[];
omittedTags: string[];
/** Type pills above the list. */
showTypeFilter: boolean;
/** Configured types, in pill order; empty = pills auto-detected from frontmatter. */
/** Frontmatter types with an icon each. */
types: RecentFileType[];
}
@@ -162,7 +160,6 @@ export const DEFAULT_SETTINGS: WaypointSettings = {
show: 'all',
omittedPaths: [],
omittedTags: [],
showTypeFilter: true,
types: [],
},
display: {
+4 -44
View File
@@ -90,7 +90,6 @@ export class WaypointView extends ItemView {
private currentDisplayYear: number = moment().year();
private dragId: string | null = null;
private dropZones = new WeakMap<HTMLElement, { above: boolean; into: boolean }>();
private recentFilesFilter: string | null = null; // null = show all, else filter by type
/** Day picked with the date picker or the "Open date" command; cleared by month navigation. */
private selectedDate: moment.Moment | null = null;
@@ -113,7 +112,7 @@ export class WaypointView extends ItemView {
// ── Top row: breadcrumb + today nav ──
const topRow = cal.createDiv({ cls: 'waypoint-calendar-top' });
// Left: Q2 · June · 2026
// Left: Q2 · Jun · 2026
const breadcrumb = topRow.createDiv({ cls: 'waypoint-calendar-breadcrumb' });
const qLabel = displayDate.format('[Q]Q');
@@ -128,7 +127,7 @@ export class WaypointView extends ItemView {
}
});
const mLabel = displayDate.format('MMMM');
const mLabel = displayDate.clone().locale('en').format('MMM');
const mEl = breadcrumb.createSpan({ cls: 'waypoint-clickable', text: mLabel });
mEl.addEventListener('click', () => {
this.plugin.openPeriodNote('month', displayDate);
@@ -200,7 +199,7 @@ export class WaypointView extends ItemView {
// Week number column header (blank)
headerRow.createEl('th', { text: '' });
const dayNames = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];
const dayNames = ['S', 'M', 'T', 'W', 'T', 'F', 'S'];
const firstDay = this.plugin.settings.calendar.firstDayOfWeek;
for (let i = 0; i < 7; i++) {
const idx = (firstDay + i) % 7;
@@ -417,47 +416,8 @@ export class WaypointView extends ItemView {
return typeof type === 'string' ? type : null;
};
// ── Type filter bar ──
// Rows still being typed in settings have no name yet.
const types = settings.types.filter(t => t.type);
if (!settings.showTypeFilter) {
this.recentFilesFilter = null;
} else {
const typeCounts = new Map<string, number>();
// Configured types keep their order and show even at 0; otherwise
// every frontmatter type present is a pill, most frequent first.
for (const t of types) typeCounts.set(t.type, 0);
for (const file of shownFiles) {
const type = typeOf(file.path);
if (type === null) continue;
if (types.length > 0 && !typeCounts.has(type)) continue;
typeCounts.set(type, (typeCounts.get(type) ?? 0) + 1);
}
if (typeCounts.size > 0) {
const filterBar = section.createDiv({ cls: 'waypoint-recent-filter' });
const allPill = filterBar.createSpan({ cls: `waypoint-recent-pill${!this.recentFilesFilter ? ' is-active' : ''}`, text: 'all' });
allPill.addEventListener('click', () => {
this.recentFilesFilter = null;
this.redraw();
});
const entries = [...typeCounts.entries()];
if (types.length === 0) entries.sort((a, b) => b[1] - a[1]);
for (const [type, count] of entries) {
const pill = filterBar.createSpan({ cls: `waypoint-recent-pill${this.recentFilesFilter === type ? ' is-active' : ''}` });
pill.setText(`${type} ${count}`);
pill.addEventListener('click', () => {
this.recentFilesFilter = this.recentFilesFilter === type ? null : type;
this.redraw();
});
}
}
}
// ── Filter the file list ──
const filteredFiles = this.recentFilesFilter
? shownFiles.filter(file => typeOf(file.path) === this.recentFilesFilter)
: shownFiles;
// Type icons. Every row reserves the icon slot once any type has an
// icon, so names stay aligned.
@@ -468,7 +428,7 @@ export class WaypointView extends ItemView {
const rootEl = section.createDiv({ cls: 'nav-folder mod-root' });
const childrenEl = rootEl.createDiv({ cls: 'nav-folder-children' });
for (const file of filteredFiles) {
for (const file of shownFiles) {
const navFile = childrenEl.createDiv({ cls: 'tree-item nav-file' });
const navFileTitle = navFile.createDiv({ cls: 'tree-item-self is-clickable nav-file-title' });
if (reserveIcon) {
-28
View File
@@ -280,34 +280,6 @@
/* ── Recent Files ── */
.waypoint-recent-filter {
display: flex;
flex-wrap: wrap;
gap: 4px;
margin-bottom: 6px;
}
.waypoint-recent-pill {
font-size: var(--font-ui-smaller);
color: var(--text-muted);
background: var(--background-modifier-hover);
padding: 1px 6px;
border-radius: 10px;
cursor: var(--cursor-link, pointer);
transition: color 80ms, background 80ms;
user-select: none;
}
.waypoint-recent-pill:hover {
color: var(--text-normal);
background: var(--background-modifier-active-hover);
}
.waypoint-recent-pill.is-active {
color: var(--text-on-accent);
background: var(--interactive-accent);
}
.waypoint-recent-files .nav-file {
padding: 2px 0;
}