I built the status bar and command layer for Tab Rot. Made a statusBar.ts that creates a StatusBarItem shoved over to the right side of the bar at priority 100. It shows a little 🍂 leaf emoji followed by how many tabs are rotting — like “🍂 3 rotting” — but only when there’s actually something decaying. When the count hits zero it hides itself completely so it’s not sitting there being useless and cluttering the bar. Clicking it is supposed to focus the sidebar view later, but since I haven’t built the sidebar yet, it’s basically a button that promises something it can’t deliver. I also gated it behind the tabRot.enableStatusBar config so people can kill it if they want.Registered three commands in package.json — tabRot.restoreTab to freshen up whatever file I’m currently staring at, tabRot.restoreAllTabs to reset every tracked tab back to stage 0, and tabRot.showDecayedTabs which is supposed to focus the sidebar. I wired all the handlers in extension.ts. restoreTab grabs the active editor URI, calls tracker.restoreTab(), then immediately refreshes the decorations and status bar so the rot vanishes right away. restoreAllTabs does the same thing but for everything and pops up a little info message saying “✨ All tabs restored!” because I wanted it to feel satisfying. showDecayedTabs tries to execute tabRot.decayedTabs.focus which is a VS Code auto-generated command for tree views.I also added a context menu to contributes.menus.editor/title/context so when you right-click in the editor area you get “Restore Tab” and “Restore All Tabs” right there without having to open the Command Palette. I grouped them under 9_tabRot so they sit in their own little section instead of getting drowned in the giant VS Code right-click menu.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.