Commit graph

79 commits

Author SHA1 Message Date
Steven
1d7efb1580 refactor(web): unify memo stats/filters with context-aware MainLayout
Create unified architecture for memo statistics, filters, and sorting
across all pages (Home, Explore, Archived, Profile) with proper
visibility filtering and consistent data flow.

Key changes:
- Rename HomeLayout → MainLayout to reflect broader usage
- Create useFilteredMemoStats hook for unified stats computation
- Create useMemoFilters/useMemoSorting hooks to eliminate duplication
- Refactor all pages to use unified hooks (~147 lines removed)
- Move Explore route under MainLayout (was sibling before)
- Fix masonry column calculation threshold (1024px → 688px+)

Architecture improvements:
- MainLayout computes filter/stats per route context
- Stats/tags based on same filter as memo list (consistency)
- Proper visibility filtering (PUBLIC/PROTECTED) on Explore
- MemoExplorer/StatisticsView accept stats as required props
- Eliminated optional fallbacks and redundant data fetching

Benefits:
- Single source of truth for stats computation
- Stats remain static (don't change with user filters)
- Reduced code duplication across 4 pages
- Better maintainability and type safety
- Proper security (no private memo leakage on Explore)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-05 08:46:52 +08:00
Steven
e915e3a46b refactor(web): refactor MemoFilters component and add comprehensive filter support
- Refactored MemoFilters.tsx for better maintainability:
  * Centralized filter configuration with FILTER_CONFIGS object
  * Added TypeScript interfaces for type safety
  * Removed separate FactorIcon component
  * Extracted handleRemoveFilter function
  * Improved imports organization

- Polished MemoFilters UI styles:
  * Changed to modern pill/badge design with rounded-full
  * Enhanced spacing and color schemes
  * Added smooth transitions and hover effects
  * Improved interactive remove button with destructive color hints
  * Better text readability with font-medium

- Added comprehensive filter support to all pages:
  * Explore page: Added full filter support (was missing)
  * Archived page: Enhanced from basic to full filter support
  * UserProfile page: Enhanced from basic to full filter support
  * All pages now support: content search, tag search, pinned, hasLink, hasTaskList, hasCode, and displayTime filters

- Consistency improvements:
  * All pages using PagedMemoList now have identical filter logic
  * Respects workspace settings for display time (created/updated)
  * Unified filter behavior across Home, Explore, Archived, and UserProfile pages
2025-10-30 22:52:58 +08:00
Steven
e0b1153269 fix(web): resolve MobX observable reactivity issue in filter computation
Fixes filtering functionality that was broken due to improper use of
useMemo with MobX observables. The issue occurred because useMemo's
dependency array uses reference equality, but MobX observable arrays
are mutated in place (reference doesn't change when items are added/removed).

Changes:
- Remove useMemo from filter computation in Home, UserProfile, and Archived pages
- Calculate filters directly in render since components are already MobX observers
- Fix typo: memoFitler -> memoFilter in Archived.tsx

This ensures filters are recalculated whenever memoFilterStore.filters changes,
making tag clicks and other filter interactions work correctly.

Fixes #5189

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 06:59:13 +08:00
Steven
b4ea7d843f feat: enhance memo sorting functionality to support multiple fields 2025-10-20 23:41:58 +08:00
Steven
435cc7b177 feat: implement masonry layout with responsive columns and memo height tracking 2025-10-14 19:46:09 +08:00
johnnyjoy
c5767bf9d6 fix: eslint 2025-07-23 22:22:12 +08:00
johnnyjoy
db63b1949a chore: fix creator id format 2025-07-23 22:18:47 +08:00
johnnyjoy
6e45e9f8b6 refactor: deprecate old filter 2025-07-22 21:25:57 +08:00
Johnny
f907619752 chore: move frontend store 2025-07-07 22:44:08 +08:00
Steven
9972a77d9e refactor: memo service 2025-06-18 19:58:38 +08:00
Johnny
e6fe088ac0 chore: fix missing observer 2025-06-01 09:22:33 +08:00
Steven
c23aebd648 refactor: memo filter store 2025-05-27 21:14:18 +08:00
Johnny
56ad8ab3bd refactor: view store 2025-03-06 21:38:54 +08:00
Johnny
d6be20b917 feat: implement masonry view 2025-03-02 23:27:12 +08:00
johnnyjoy
be5e24c0eb refactor: renovate list memos endpoint 2025-02-02 18:43:26 +08:00
johnnyjoy
2a861ea430 refactor: tweak resource state in api 2025-01-10 22:20:23 +08:00
johnnyjoy
ac7121c21a chore: update archived page 2025-01-10 20:24:05 +08:00
RoccoSmit
6cbe957db2
fix: show future relative dates (#3946)
Show future relative dates
2024-09-22 22:24:46 +08:00
johnnyjoy
339c38750f refactor: paged memo list container 2024-09-22 19:30:39 +08:00
Michel Heusschen
2dbf92f7f1
perf: reduce bundle size by 21% with direct icon imports (#3844) 2024-08-28 22:55:28 +08:00
Steven
9a27fdf855 chore: tweak load more button 2024-08-12 23:52:23 +08:00
Steven
158745704e feat: add memo display setting menu 2024-08-03 01:22:40 +08:00
Steven
26fa172641 chore(frontend): add order by time asc 2024-07-31 23:51:20 +08:00
Steven
a50f3b9382 chore: fix memos sorting 2024-07-27 22:15:47 +08:00
Steven
b9006f8ce0 chore: tweak date utils 2024-07-27 17:21:22 +08:00
Steven
edc3b578d6 feat: implement search multi tags 2024-07-26 08:40:40 +08:00
Steven
cd38ec93ed feat: implement memo filters 2024-07-26 00:46:48 +08:00
Steven
1ad5d9bf0a chore: update confirm dialog 2024-07-01 23:22:39 +08:00
Steven
076aa2f8aa chore: remove memo filter 2024-06-05 23:18:14 +08:00
Steven
719c22fef8 chore: update i18n 2024-05-29 07:39:16 +08:00
Steven
3e5e5b1f80 chore: fix search memos 2024-05-15 22:42:31 +08:00
Steven
584c669068 chore: tweak max width 2024-05-09 22:10:27 +08:00
Steven
1d99dad435 feat: update timeline page 2024-05-09 07:56:00 +08:00
Steven
d0655ece53 refactor: update memo tags 2024-05-08 20:03:01 +08:00
Steven
f9258e41a0 chore: tweak max width 2024-05-07 22:10:08 +08:00
Steven
155c5baf2c refactor: add markdown service 2024-04-29 08:00:37 +08:00
Steven
1b291422e7 refactor: api version 2024-04-28 00:44:29 +08:00
Steven
5ab845d92e chore: fix linter 2024-03-30 00:02:34 +08:00
Steven
c7aaf791e6 chore: tweak props naming 2024-03-29 22:49:19 +08:00
Steven
722e356044 chore: update memo store 2024-03-19 20:55:33 +08:00
Steven
5f2d6b22be chore: tweak memo structure 2024-03-18 23:23:53 +08:00
Steven
ded4da07a3 feat: use @github/relative-time-element to display time 2024-03-13 23:47:34 +08:00
Steven
12f4d3a10d chore: tweak default page size 2024-02-29 23:42:06 +08:00
Kazuki H
5ac17fc012
fix: displaying archived memos (#2933)
* fix: web: Archived: Show displayTime instead of updateTime

Archiving a memo is considered "updating" it, so the time it was
archived will be displayed, instead of the time it was created.

* fix: web: Archived: Add an option to fetch more memos

Just like on other pages, add a button to fetch more memos. Otherwise,
the user would only be able to load the latest 10 memos, as defined in
DEFAULT_MEMO_LIMIT.
2024-02-07 17:53:23 +08:00
Steven
fdd17ce849 chore: update memo content key 2024-02-01 20:40:43 +08:00
Steven
8ce6a32aac feat: use gomark wasm in frontend 2024-01-31 22:25:24 +08:00
Steven
ed32b20c9e chore: update frontend dependencies 2024-01-27 17:28:06 +08:00
Steven
d7889d9903 chore: tweak url filters 2024-01-26 08:39:53 +08:00
Steven
08ac60cc70 chore: update memo relation dialog 2024-01-25 08:59:10 +08:00
Steven
2a4ebf5774 chore: add search bar in archived page 2024-01-18 15:28:37 +08:00