Skip to content

Conversation

@malkovitc
Copy link

Summary

Fixes #904

Move the "Add Note" button from #mesh channel to location-specific channels where it's more contextually appropriate.

Test plan

  • Verify "Add Note" button appears in location channels
  • Verify "Add Note" button no longer appears in #mesh
  • Test note creation flow from location channels

🤖 Generated with Claude Code

evgeniy.chernomortsev added 2 commits December 9, 2025 03:56
Notes post permanent data to Nostr (internet), not to local mesh.
Showing this button in #mesh was confusing and risked accidental
location linking. Now only appears in geohash-based channels.

Closes permissionlesstech#904
Don't auto-update notesGeohash when location channels refresh if the
notes sheet is already open. This ensures the user sees notes for the
channel they selected, not the current building location.

Addresses review feedback from Codex bot.
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1287 to 1291
if case .location(let ch) = locationManager.selectedChannel {
// Notes icon - posts permanent notes to Nostr for this location
Button(action: {
// Kick a one-shot refresh and show the sheet immediately.
LocationChannelManager.shared.enableLocationChannels()
LocationChannelManager.shared.refreshChannels()
// If we already have a block geohash, pass it; otherwise wait in the sheet.
notesGeohash = LocationChannelManager.shared.availableChannels.first(where: { $0.level == .building })?.geohash
notesGeohash = ch.geohash
showLocationNotes = true

Choose a reason for hiding this comment

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

P1 Badge Keep location notes geohash at building precision

Selecting a non‑building location channel (e.g., city/province) and tapping the notes icon now passes the channel’s geohash straight into LocationNotesView (notesGeohash = ch.geohash). LocationNotesManager is explicitly scoped to 8‑character building geohashes (LocationNotesManager.swift lines 46–112 use Geohash.isValidBuildingGeohash to validate them), so shorter hashes produce warnings and the manager refuses later updates, leaving the sheet subscribing/posting under an invalid scope (often showing no notes). Before this change the button always used the building‑level geohash from availableChannels, so this regression affects anyone opening notes while on a higher‑level geo channel.

Useful? React with 👍 / 👎.

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.

UI/UX: "Add a note for others to find" doesn't belong in #mesh

1 participant