Code Monkey home page Code Monkey logo

stacks's Introduction

Stacks CI

A terrific clipboard manager

screenshot

Download

Stack releases are getting backed up as I try to work out how "pipe clip to shell" should hang together. To minimize distractions from formal release processes, I’m currently just dropping preview releases directly in the Stacks' Discord channel. If you'd like to grab the latest version of Stacks, swing by! (link below).

Current release is >= 0.15.8

Community

  • We have a Discord channel where we chat about clipboard managers, flashcards, neo-browsers, Tauri, Rust, wasm, tools of thought, and generally fun geekery, and
  • We're using Github Discussions as a forum.

Usage

To launch Stacks⌃ + Space
Accessibility
Increase font size⌘ + +
Decrease font size⌘ + -
Navigation
Navigate down or ⌃ + n
Navigate up or ⌃ + p
Navigate left or ⌃ + h
Navigate right or ⌃ + l
Navigate to the stack below⌥ + ↓
Navigate to the stack above⌥ + ↑
Reset nav (clears filter and brings focus to the top)⌘ + 0
Item Manipulation
Move an item down⌘ + ↓
Move an item up⌘ + ↑
Bring current item and stack to the top⌘ + t
Global shortcuts
New note⌘ ⇧ + n

Development

git clone https://github.com/cablehead/stacks.git
cd stacks
npm install
npm run tauri dev

Built with:

Rust, Tauri, sled, cacache, Tantivy, Tokio, hyper, Comrak, syntect, TypeScript, Preact, scru128, tracing,

🙏💚

stacks's People

Contributors

cablehead avatar marvin-j97 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

stacks's Issues

iterating on Stacks' event stream store

If it's not obvious by the code quality, Stacks is my first substantive Rust project. In addition to learning on the go I've been sketching out a bunch of ideas.

The rough edges really show in the persistence layer, which is all in store.rs. This issue is an attempt to describe where I'd like to get to, and an invitation for input from anyone who is into this sort of thing.

Persistence in Stacks is roughly, a stream of events (think event sourcing/modeling) stored in sled and a CAS, kept on the file system via cacache's api. The actually app works against a materialized view of the event stream (view.rs).

Something I've been tripping over myself to tease out is, there's interesting meta information that is associated with the content of a clip, and other meta information associated with the particular instance of clipping some given content.

For example, the time and the app you clipped some content from is interesting. If you later interact with the same content, that's interesting too. Sometimes you "clean up" a clip, by quickly editing, in order to paste it for a given context. This is now new content with a new content hash, but it's still interesting to see when and how it relates to the original content. It seems to make most sense to track this information against the unique event sled ids (which is a scru128) in the event stream.

And then there's interesting meta information fundamentally related to the content, regardless of when and how that content is used. Primarily there's mime type and content type. Mime type is currently roughly the http mime type that makes sense to associate with the content. And the content type is additional specialization of the content, which is mostly relevant for text content. Is it HTML, JSON, Markdown, a URL, email, etc. Some other meta information that would be interesting are things like, image dimensions, Open graph data for urls, word count, tiktoken counts etc.

(still fleshing this out)

Bug: loss of current edit on new copy

Let’s say I’m editing a clip in stacks, and I close Stacks while leaving the clip editing mode open, if I make a new grab / copy some new text, and then open Stacks again, the open editing mode remains open, but the text from before is replaced by the new text I just grabbed, if that makes sense.

known issue: context menu for images

From @0n0mat0p03ia on discord:

right clicking an image clip displays a modal window. For me, nothing happens when I select Open Image in New Window, or Download Image. The Share and Copy options do work, however.

feat: privacy and security

Stacks should give users as much control as possible to prevent data they don't want being stored out of the clip store, and make it as easy as possible to locate, and permanently delete data that's accidentally captured.

For reference these are the options the excellent PastePal gives you h/t @0n0mat0p03ia

image

I think these are our available tools to prevent sensitive data entering the clipboard:

I think the clip store api might be simplest way to let users locate data across stacks (and versions of clips that may now be obscured, after being edited) and to permanently delete it. https://stacks.cross.stream/releases/v0.15.6

feat: Linux support

Do you use Linux as your daily driver, and have a passion for clipboard managers? We'd love to hear from you!

See #49 for notes on what's needed.

fix: syntax highlighting doesn't switch dark / light mode when the UI does

image

Currently, markdown rendering and syntax highlighting are handled in the Rust backend. This might be a mistake, and potentially we should move this responsibility to the webview / Javascript.

Syntax highlighting leverages syntext, as detailed here: https://github.com/cablehead/stacks/blob/main/src-tauri/src/ui.rs#L304-L313

The implementation "bakes" the color scheme directly into the generated HTML. The frontend, which caches this content, doesn't update the syntax highlighting color scheme when the main UI toggles between light and dark modes.

I think there's ~2 solutions:

  1. Use classes for syntax highlighting elements, avoiding hardcoded color values. This way, CSS classes with variables can adjust to light/dark mode changes in the main UI.

Possible approaches for this solution include:

  1. Invalidate the frontend's content cache when toggling between light and dark modes.

Stacks hangs if you add text to the clip, which content type is set to `link` without changing it's content type

Steps to reproduce:

  1. Copy https://github.com/cablehead/stacks to clipboard (the clip content type is automatically set to link)
  2. Press Ctrl-Enter to edit clip
  3. Add some text to the beginning of the clip (say, "Some title" and "Enter" to make new line)
Снимок экрана 2024-06-04 в 23 07 55
  1. Press Ctrl-Enter to capture edit
  2. Try to use arrows up/down or any of keyboard hotkeys - Stacks does not respond.

I'm pretty sure this is because I added text to clip which content type was set to link without changing the content type back to text.

If you restart Stacks the clip type appears as text:
Снимок экрана 2024-06-04 в 23 12 48

But if you scroll to the clip which content type is set wrong (as the last clip in this scrinshot) Stacks will hang again:

Снимок экрана 2024-06-04 в 23 15 03

 

feat: flesh out quick filter

The quick filter currently only performs an exact, lower case match on a clips first 100 characters.

That's why you may have notice if you filter on text that's in a large clipping, some clips you expect to match. Under the hood, all clips are currently being index in tantivy, but that isn't hooked up to the UI at all.

We should also fuzzy matching across and entire clips contents.

Stretch goal: we should also allow using some of tantivy's search expressions for more nuanced searching..

feat: make when to auto-spawn a new stack configurable.

It's current hard coded to 1 hour of inactivity: https://github.com/cablehead/stacks/blob/main/src-tauri/src/state.rs#L68

Something that annoys me is if you come back after a long break, and pop up stacks to create a new note, that'll go into the old stack, and make it current again.

We've had a suggestion to also add the option to start a new stack on laptop resume (when you open your laptop after closing it).

Document the behavior at the same time.

UI: ability to see the stack name in the stack column

From @0n0mat0p03ia on Discord:

Feedback: as a user, I find it difficult to see at a glance when a stack was created, because only the beginning portion of the datetime is displayed (e.g., Sat, May 1...) I cannot resize the divider between the stack column and the clipped item column.

Suggestion 1: consider changing the default datetime format to a shorter format, e.g., MM-DD-YYYY HH:MM or DD-MM-YYYY HH:MM. Even better, allow the user to specify their preferred datetime format, since format usage varies by locale.

Suggestion 2: allow the user to resize the divider between the stack and clipped items column.

Suggestion 3: show a tooltip with the stack's datetime when the user hovers the mouse cursor over it. (Especially helpful if you keep the current datetime format).

feat: encrypt Stacks' store, keeping the encryption key in the macOS keychain

Hopefully this is how the macOS keychain works:

Stacks automatically retrieves a stored key from the macOS Keychain upon system restart or user login, without requiring any user intervention, by using a predefined service and account name unique to Stacks. This process is secure because the Keychain item is protected by access controls that limit access solely to the Stacks application, preventing other apps or malware from accessing it. Additionally, macOS enforces application sandboxing and encrypts Keychain data, ensuring that even if unauthorized access to the machine occurs, the Keychain contents remain protected.

From @ntawileh:

your use case is probably more user-centric, so you want to do login keychain. And yes, it can be retrieved without user interaction as long as the user is logged in and it can/should also be scoped by the binary retrieving it so other apps running in the same user context cannot fetch it

if successfully, add this to the list of things to consider for linux and windows support

feat: filtering should match stack names

https://discord.com/channels/1182364431435436042/1242200628621606965/1242532949878902866

Thanks @0n0mat0p03ia for raising this.

Currently filtering only performs an exact, case insensitive match of a clips (not a stacks) first 100 characters: #71

I didn't have it match stack name as I wasn't sure what to show if a stack name matches but no clips do. I think a good next step to try is:

I don't believe the UX is always consistent but, most of the time, if you filter and hit Esc, it keeps you where you are, but clears the filter. If I formalize that, and make it consistent, then you could search for "Job Search", find you empty stack, hit escape, that stack is selected and expanded, and you grab a single thing from the stack, OR, hit CMD-T and pull the stack to the top

Also, document this behavior when complete.

feat: ability to paste directly from Stacks

Stacks will need to request System Settings -> Privacy & Security -> Accessibility access on macOS.

We'll also need the platform specific code to perform the actual paste.

This should be configurable in settings as either the default when you hit enter, or as a hot key combo for users who want to keep the default of copy to clipboard on enter.

fix: improve window "spotlight"-ness

Stacks' makes a bunch of platform calls to configure its window as a spotlight-like window: https://github.com/cablehead/stacks/blob/main/src-tauri/src/spotlight.rs -- it'd be nicer if this was in native Swift.

https://github.com/Brendonovich/swift-rs

h/t @arn4v for the link.

The main window doesn't quite behave as well as the native macOS spotlight. As an example, when the last window in a macOS space closes, macOS will focus the previous space. If Stacks' is the only window in a space, this results in the current space annoyingly losing focus as you activate and deactivate Stacks. Hopefully there's a macOS API to say: "don't count this window towards the count of windows in a space.

Potentially helpful:

https://github.com/ahkohd/tauri-nspanel

Throw away the 1st draft preact UI: replace with Solid??

Now that the UI has settled down somewhat, and the locations and types of menus and overlays are known, it’d be great to throw away the current code and write it again. I’m pretty sure I want to use solidjs next time, but I’d definitely defer to a front-end specialist who had interest/time to contribute.

I picked preact largely because of signals, and it seemed like a way to avoid the complexity of React. At the time, I didn’t appreciate that meant I should have been using Solid!

If you’re the sort of developer who'd rather be using htmx, except when that’s not the right fit, and think solidjs is nice, but wonder how it can be lighter (vs. solidjs is nice, but it needs more, like SolidStart) - I think you’ll find this a fun place to play!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.