Skip to content
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

add sidebar and journal click-to-search #138

Merged
merged 1 commit into from
Jan 21, 2024
Merged

Conversation

cloverich
Copy link
Owner

@cloverich cloverich commented Jan 21, 2024

  • add sidebar to main view with journals
  • add "click to search", where clicking populates an in: search tag for only that journal

Closes #119

Behavior works similar to sidebar in any folder-based journaling app. Clicking folder icon next to search opens the sidebar; clicking a journal in the sidebar replaces the current search with in:<selected journal>. I don't like the UI but its functional.

Sidebar button; used folder icon since its only for selecting journals as of now...
Screenshot 2024-01-21 at 6 54 32 AM

Clicking any journal replaces the current search:
Screenshot 2024-01-21 at 6 54 57 AM

* i.e. search documents in one folder
*/
searchJournal = (journalName: string) => {
const tokens = this._tokens.filter((t) => t.type !== "in");
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, this should actually behave more like setTokens. If you:

  • have an active multi-part search
  • click sidebar and select a new journal

It should wipe the whole search, leaving only in:.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opted for a setSearch method, although perhaps simply replace is better (i.e. searchStore.replace).

- add sidebar to main view with journals
- add setSearch behavior to search store
- add "click to search", where clicking populates an in: search tag for only that journal
@cloverich cloverich merged commit 5f4186a into master Jan 21, 2024
1 check passed
@cloverich cloverich deleted the journal-sidebar branch January 21, 2024 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add journal sidebar. Click to pre-select in: search token
1 participant