summaryrefslogtreecommitdiff
path: root/internal/client
diff options
context:
space:
mode:
authorKyren223 <kyren223@proton.me>2025-08-05 17:01:05 +0300
committerKyren223 <kyren223@proton.me>2025-08-05 17:01:05 +0300
commit7b1ee08d61c77da12f139881631ddb94bb3e6647 (patch)
treeeb269273170a511b52b44b00a3bd35656f1a6d0f /internal/client
parent274dee5b25ed249492faeea1c0a4e33aa26cb60c (diff)
Updated todos and notes
Diffstat (limited to 'internal/client')
-rw-r--r--internal/client/ui/auth/auth.go6
-rw-r--r--internal/client/ui/core/core.go1
-rw-r--r--internal/client/ui/core/state/state.go40
-rw-r--r--internal/client/ui/tosscreen/tosscreen.go4
-rw-r--r--internal/client/ui/viminput/viminput.go14
5 files changed, 14 insertions, 51 deletions
diff --git a/internal/client/ui/auth/auth.go b/internal/client/ui/auth/auth.go
index 27d9377..453e423 100644
--- a/internal/client/ui/auth/auth.go
+++ b/internal/client/ui/auth/auth.go
@@ -98,8 +98,8 @@ ___] | |__] | \| | | \|`)
)
func init() {
- // HACK: to avoid a circular dependency, so core can transition to this
- // I don't like how go has this issue, I would rather slower compilations
+ // HACK(kyren): to avoid a circular dependency
+ // so core can transition to this model
ui.NewAuth = func() tea.Model {
return New()
}
@@ -159,7 +159,7 @@ func New() Model {
m.SetSignup(false)
- m.Update(nil) // HACK: force an update
+ m.Update(nil) // HACK(kyren): force an update
return m
}
diff --git a/internal/client/ui/core/core.go b/internal/client/ui/core/core.go
index 3ccc67f..bd4fb73 100644
--- a/internal/client/ui/core/core.go
+++ b/internal/client/ui/core/core.go
@@ -180,7 +180,6 @@ func (m Model) View() string {
return m.tos.View()
case ConnectedAcceptedTos:
- // TODO(kyren): auth
return m.loading.View()
case Authenticated:
diff --git a/internal/client/ui/core/state/state.go b/internal/client/ui/core/state/state.go
index ad2b711..ca1b66c 100644
--- a/internal/client/ui/core/state/state.go
+++ b/internal/client/ui/core/state/state.go
@@ -212,7 +212,7 @@ func UpdateMessages(info *packet.MessagesInfo) {
Users: unknownUsers,
})
- // Note: this is a naive approach
+ // NOTE(kyren): this is a naive approach
// Ideally we check each message that was added/removed
// For the frequency/receiver/sender id and only remove that
// But it can be very slow when there are thousands of messages
@@ -340,7 +340,7 @@ func UpdateNotifications(info *packet.NotificationsInfo) []snowflake.ID {
// When someone messages you, and you don't have a signal with him
// already, add a signal with him so you see his messages
- // PERF: IsFrequency is expensive so contains is checked first
+ // PERF(kyren): IsFrequency is expensive so contains is checked first
if !slices.Contains(Data.Signals, source) && !IsFrequency(source) {
signals = append(signals, source)
}
@@ -402,42 +402,6 @@ func SendFinalData() {
case <-done:
log.Println("All final writes completed successfully")
}
-
- // HACK: Give a small grace period for the writes to be processed
- // Tweak this value as needed
- // time.Sleep(20 * time.Millisecond)
-
- // TODO:
- // I think the issue is that it's random which of these 2 requests goes
- // first (bcz it only does the first request after the client disconnects)
- // I could fix it server side but eh maybe not
- // this should instead use a method that blocks until a response was
- // received, which may need a new gateway method to do that as currently
- // it just always sends to the prograg
- // If this is tedious enough it might be worth it to just do it on the
- // server side
-
- // Also later on I should probably remove the calculate notifs in core
- // it can be replaced with just diff-ing incoming notifs
- // this will most likely work fine although there are some issues with
- // scopes like becoming an admin/no longer being admin or gaining
- // or losing access to frequencies and of course msg deletions
- // But it's probably the right approach (also WAYYYYYY faster)
-
- // Then there is also the issue of when switching to a frequency
- // not yet receiving the history so it says "no keep" bcz it's not loaded
- // but with history it would've said "yes keep" so the solutin would
- // be to rework it quite a bit to make it stateless or smthing
- // Then that should be most issues when it comes to notifications
- // just need to make sure local/remote notifs reset properly when
- // reaching the bottom
-
- // log.Println("BLOCKING...")
- // <-ctx.Done()
- // log.Println("CTX DANZO")
-
- // TODO: remove this before release
- // assert.NoError(ctx.Err(), "context has ran out of time!")
}
func UpdateBlockedUsers(info *packet.BlockInfo) {
diff --git a/internal/client/ui/tosscreen/tosscreen.go b/internal/client/ui/tosscreen/tosscreen.go
index 8591af2..af0d77b 100644
--- a/internal/client/ui/tosscreen/tosscreen.go
+++ b/internal/client/ui/tosscreen/tosscreen.go
@@ -128,10 +128,10 @@ func (m *Model) updateContent() {
glamour.WithWordWrap(lineWidth),
)
content := m.content
- content = strings.ReplaceAll(content, "@", "") // HACK: workaround to remove mailto links
+ content = strings.ReplaceAll(content, "@", "") // HACK(kyren): workaround to remove mailto links
content, err := r.Render(content)
assert.NoError(err, "this should never error")
- content = strings.ReplaceAll(content, "", "@") // HACK: workaround to remove mailto links
+ content = strings.ReplaceAll(content, "", "@") // HACK(kyren): workaround to remove mailto links
m.vp.SetContent(content)
}
diff --git a/internal/client/ui/viminput/viminput.go b/internal/client/ui/viminput/viminput.go
index b4f7f4a..178bce5 100644
--- a/internal/client/ui/viminput/viminput.go
+++ b/internal/client/ui/viminput/viminput.go
@@ -405,7 +405,7 @@ func (m *Model) handleKeys(key tea.KeyMsg) {
m.handleNormalModeKeys(key)
m.Save()
case InsertMode:
- // Note: we don't want to save on insert mode
+ // NOTE(kyren): we don't want to save on insert mode
// That'd mean it'd save on every keystroke which will
// be very annoying
m.handleInsertModeKeys(key)
@@ -582,7 +582,7 @@ func (m *Model) handleNormalModeKeys(key tea.KeyMsg) {
runeLines = append(runeLines, []rune(line))
}
- // Note: caps to line length, needed for len=0 col=0
+ // NOTE(kyren): caps to line length, needed for len=0 col=0
splittingCol := min(m.cursorColumn+1, len(line))
line := m.lines[m.cursorLine]
after := line[splittingCol:]
@@ -696,12 +696,12 @@ func (m *Model) handleInsertModeKeys(key tea.KeyMsg) {
return
}
- // Note: commented out because enter is used to send a message
+ // NOTE(kyren): commented out because enter is used to send a message
// even in insert mode, an alternative that discord uses is
// to use Shift+Enter for this functionality but unfortunately
// this is not supported in bubbletea (probably due to terminal limitations)
- // If there is a way to add this for Shift+Enter please notify me
- // at Kyren223@proton.me
+ // If there is a way to add this for Shift+Enter please open an issue
+ // or a pull request and notify me, or email Kyren223@proton.me
// if key.Type == tea.KeyEnter {
// line := m.lines[m.cursorLine]
@@ -1946,7 +1946,7 @@ func (m *Model) handleVisualModeKeys(key tea.KeyMsg) {
if motion == "p" {
m.Yank(copyOfPaste) // Restore
}
- // Note: we don't restore for "P" because we use it like
+ // NOTE(kyren): we don't restore for "P" because we use it like
// <leader>p (we paste over and keep what we had)
// Shift+P in visual mode is pretty useless/uncommon
// So using that instead of adding <leader>p makes more sense
@@ -2066,7 +2066,7 @@ func (m *Model) handleVisualLineModeKeys(key tea.KeyMsg) {
if motion == "p" {
m.Yank(copyOfPaste) // Restore
}
- // Note: we don't restore for "P" because we use it like
+ // NOTE(kyren): we don't restore for "P" because we use it like
// <leader>p (we paste over and keep what we had)
// Shift+P in visual mode is pretty useless/uncommon
// So using that instead of adding <leader>p makes more sense