Commit Graph

4091 Commits

Author SHA1 Message Date
William Casarin
e0a2dcf3db nostrdb/Inital embedded content parser
This adds some initial code for nostrdb content parsing.

We still need to write tests for encoding and decoding, so this is
likely not working yet.

Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-11 16:39:43 -07:00
William Casarin
9ff1f69a82 nostrdb/search: switch to cursor_align function
Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-11 16:39:43 -07:00
William Casarin
623b8603c2 nostrdb/cursor: add align function
handy function for padding buffers to some byte alignment

Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-11 16:39:43 -07:00
William Casarin
d8b083010d nostrdb/cursor: fix some warnings
Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-11 16:39:43 -07:00
William Casarin
887eb4e1e2 nostrdb/cursor: fix empty string pushing in push_c_str
Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-11 16:39:43 -07:00
William Casarin
b5ad3ed1a5 nostrdb/cursor: add pull_varint_u32
This is a varint helper that doesn't pull larger than uint32

Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-11 16:39:43 -07:00
William Casarin
371e9fb406 nostrdb/cursor: add malloc_slice
This is the same as cursor_slice except we don't memset afterwards

Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-11 16:39:43 -07:00
William Casarin
aa5809d792 nostrdb/nostr_bech32: only parse up to raw bech32 buffers
We will be storing raw nostr bech32 buffers directly into nostrdb, so
adapt our bech32 code to reflect this.

When doing our content parsing pass, we will only look for strings and we
won't allocate any intermediate buffers. Only when we write this string
block to nostrdb will we actually allocate in our nostrdb output buffer
(no mallocs!)

Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-11 16:39:43 -07:00
William Casarin
30ba0d72cc nostrdb/bech32: retab
Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-11 16:39:43 -07:00
William Casarin
373cd71f69 nostrdb/block: add bolt11 invoice encoding/decoding
Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-11 16:39:43 -07:00
William Casarin
acaf327a07 nostrdb/make: cleanup a bit, separate bench running
Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-11 16:39:43 -07:00
William Casarin
9f0bf7dff5 nostrdb/fix github action
Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-11 16:39:43 -07:00
William Casarin
88d7eb8a86 nostrdb/fix build
Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-11 16:39:43 -07:00
William Casarin
76862776b8 nostrdb/varint: switch to 64 bit varints
Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-11 16:39:43 -07:00
William Casarin
4c55459c1f nostrdb/test: disable migrate for now
Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-11 16:39:43 -07:00
William Casarin
f7cdc7bc31 nostrdb/cursor: re-apply infinite loop bug fix
since I keep overwriting it by accident

Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-11 16:39:43 -07:00
William Casarin
1bc4971111 nostrdb/add libnostrdb.a
Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-11 16:39:43 -07:00
William Casarin
6ce6c79160 nostrdb/add initial content parser
Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-11 16:39:43 -07:00
William Casarin
1ffbd80c67 nostrdb: move everything to src
Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-11 16:39:43 -07:00
William Casarin
1fb88a912a nostrdb: port everything over to be in as sync as possible
for now
2025-08-11 16:39:43 -07:00
William Casarin
954f48b23d c: move c files into nostrdb in prep for switchover 2025-08-11 16:39:43 -07:00
William Casarin
cc75a8450a nostrdb: add supporting files for the bolt11 parser
A lot of this was pulled from core-lightning. Not sure what is actually
needed or not.

Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-11 16:39:43 -07:00
William Casarin
389c2c9695 nostrdb: add supporting files before the move commit 2025-08-11 16:39:42 -07:00
William Casarin
4a6121ba13 c: move compiler to nostrdb dir
we will be applying a patch here as well
2025-08-11 16:39:42 -07:00
William Casarin
a469f2e127 nostrdb/re-apply ispunct crash fix
since it was overwritten when we synced with damus

Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-11 16:39:42 -07:00
William Casarin
2f8f18b846 nostrdb/build: fix constness on config pointer in ingester thread
otherwise build fails

Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-11 16:39:42 -07:00
William Casarin
3a7cf4d08d nostrdb/rust: initial api for Ndb and NdbConfig
This is the start of our rust library for nostrdb. Implement idiomatic
interfaces for Ndb and NdbConfig.

Changelog-Added: Add initial rust library
Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-11 16:39:42 -07:00
William Casarin
e3001cc240 nostrdb/cursor: fix warning that build.rs is complaining about
Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-11 16:39:42 -07:00
William Casarin
d1ef113a8b nostrdb/api: don't expose many internals, like note
rust doesn't like packed structures, so hide this from bindgen

This also buttons up the API so less things are exposed which is good.

Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-11 16:39:42 -07:00
William Casarin
f187f4f8f2 c: move cursor.h to nostrdb subdir
everything will be in here soon
2025-08-11 16:39:42 -07:00
William Casarin
4e9583ef54 nostrdb/stream: actually use file pointer in stream api
Right now it's accidently hardcoded.

Fixes: 8376e5bca05c ("add "import -"")
Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-11 16:39:42 -07:00
Yasuhiro Matsumoto
cc95d5df6e nostrdb/add "import -"
Closes: https://github.com/damus-io/nostrdb/pull/21
Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-11 16:39:42 -07:00
William Casarin
4ca156fd83 nostrdb/build: fix additional compiler errors
When trying to build from rust

Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-11 16:39:42 -07:00
askeew
9f6da8eb79 Fix display issues with pasted or uploaded images
- Fix aspect ratio, use fit
- Remove fixed height on image frame to align close button on image
- Use overlay instead of ZStack to reduce complexity
- Add background to close button to get better contrast in light mode
- Change close-image to be a button for better accessibility

Changelog-Fixed: Fix aspect ratio on pasted or uploaded images
Signed-off-by: Askeew <askeew@hotmail.com>
Closes: https://github.com/damus-io/damus/issues/2913
2025-08-08 16:31:30 -07:00
ericholguin
65a22813a3 refactor: Adding structure
Huge refactor to add better structure to the project.
Separating features with their associated view and model structure.
This should be better organization and will allow us to improve the
overall architecture in the future.

I forsee many more improvements that can follow this change. e.g. MVVM Arch
As well as cleaning up duplicate, unused, functionality.
Many files have global functions that can also be moved or be renamed.

damus/
├── Features/
│   ├── <Feature>/
│   │   ├── Views/
│   │   └── Models/
├── Shared/
│   ├── Components/
│   ├── Media/
│   ├── Buttons/
│   ├── Extensions/
│   ├── Empty Views/
│   ├── ErrorHandling/
│   ├── Modifiers/
│   └── Utilities/
├── Core/
│   ├── Nostr/
│   ├── NIPs/
│   ├── DIPs/
│   ├── Types/
│   ├── Networking/
│   └── Storage/

Signed-off-by: ericholguin <ericholguin@apache.org>
2025-08-06 10:24:00 -07:00
fdbf271432 Add relay count and relay view to events
Changelog-Added: Added relay count and relay view to events

Closes: https://github.com/damus-io/damus/issues/1029
Signed-off-by: Terry Yiu <git@tyiu.xyz>
2025-07-21 16:45:49 -07:00
b26eedc633 Fix note content rendering to not remove whitespace before hashtag
Changelog-Fixed: Fixed note content rendering to not remove whitespace before hashtag

Closes: https://github.com/damus-io/damus/issues/3122
Fixes: f436291209 ("Fix note content rendering to not remove whitespace before hashtag")
Signed-off-by: Terry Yiu <git@tyiu.xyz>
2025-07-21 16:37:36 -07:00
793970beaf Add relay hints to tags and identifiers
Changelog-Added: Add relay hints to tags and identifiers
Signed-off-by: Terry Yiu <git@tyiu.xyz>
2025-07-18 15:51:25 -07:00
transifex-integration[bot]
049d9170be Translate Localizable.strings in de
100% translated source file: 'Localizable.strings'
on 'de'.
2025-07-18 14:52:31 -07:00
transifex-integration[bot]
fd10c5672a Translate Localizable.strings in de
100% translated source file: 'Localizable.strings'
on 'de'.
2025-07-18 14:52:31 -07:00
transifex-integration[bot]
37bd9447f0 Translate Localizable.stringsdict in de
100% translated source file: 'Localizable.stringsdict'
on 'de'.
2025-07-18 14:52:31 -07:00
transifex-integration[bot]
e8457d7486 Translate Localizable.stringsdict in de
100% translated source file: 'Localizable.stringsdict'
on 'de'.
2025-07-18 14:52:31 -07:00
transifex-integration[bot]
280297ad35 Translate Localizable.stringsdict in de
100% translated source file: 'Localizable.stringsdict'
on 'de'.
2025-07-18 14:52:31 -07:00
transifex-integration[bot]
7da3ead01e Translate Localizable.strings in de
100% translated source file: 'Localizable.strings'
on 'de'.
2025-07-18 14:52:31 -07:00
3ddb2625e9 Fix #nsfw tag filtering to be case insensitive
Closes: https://github.com/damus-io/damus/issues/3131

Changelog-Fixed: Fixed #nsfw tag filtering to be case insensitive
Signed-off-by: Terry Yiu <git@tyiu.xyz>
2025-07-11 10:48:10 -07:00
Swift
f53ffae767 Fix stretchy banner header in Edit profile
Put the views into ScrollView
Fixed banner offset in Geometry reader

Changelog-Fixed: Fixed stretchy banner header in Edit profile
Signed-off-by: Swift Coder <scoder1747@gmail.com>
2025-07-09 15:06:23 -07:00
Daniel D’Aquino
b9168f9914 Merge pull request #3121 from damus-io/translations
Translations
2025-07-09 10:43:04 -07:00
Daniel D’Aquino
63ff2b6f9e ui: Stabilize ImageCarousel height when swiping between images
This commit enhances the ImageCarousel component to maintain a consistent
height when navigating between images of different aspect ratios. The
changes prevent the UI from "jumping" during carousel navigation, which
improves the overall user experience.

Key improvements:
- Added `first_image_fill` property to store dimensions of the first image
- Modified height calculation to prioritize the first image's dimensions
- Refactored image fill calculation into a reusable `compute_item_fill` method
- Added proper view clipping to prevent content overflow
- Simplified filling behavior for more predictable layout

These changes provide a smoother, more stable carousel experience by
maintaining consistent dimensions throughout image navigation.

Changelog-Changed: Improved the image sizing behavior on the image carousel for a smoother experience
Closes: https://github.com/damus-io/damus/issues/2724
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-07-09 10:26:32 -07:00
transifex-integration[bot]
7d9468388b Translate Localizable.strings in th
100% translated source file: 'Localizable.strings'
on 'th'.
2025-07-08 05:48:12 +00:00
transifex-integration[bot]
66b555e0ff Translate Localizable.strings in nl
100% translated source file: 'Localizable.strings'
on 'nl'.
2025-07-07 22:04:41 -04:00