Bubble [main]

Comment timestamps are part of the author/actions link

=> 6a205f003f941fcfc701fef9e50fb0fc82a9a046

diff --git a/feeds.py b/feeds.py
index c2ce07a..a53fc32 100644
--- a/feeds.py
+++ b/feeds.py
@@ -252,7 +252,7 @@ def make_post_page(session, post):
     if is_comment_page:
         # Switch to the parent post, but display it in preview mode.
         focused_cmt = post
-        last_age = focused_cmt.age()
+        #last_age = focused_cmt.age()
         post_id = post.parent
         post = db.get_post(id=post_id)
         page += f'# Comment by {focused_cmt.poster_avatar} {focused_cmt.poster_name}\n\n'
@@ -267,7 +267,7 @@ def make_post_page(session, post):
             page += f'=> /help/deleted-post 🔒 Comment on a deleted post (ID:{post_id})\n\n'
         page += session.render_post(focused_cmt)
         page += f'\n=> /u/{focused_cmt.poster_name} {focused_cmt.poster_avatar} {focused_cmt.poster_name}\n'
-        page += f'{last_age}\n'
+        page += f'{focused_cmt.age()}\n'
 
         # Comment actions.
         if user:
@@ -347,8 +347,8 @@ def make_post_page(session, post):
         elif not session.c_user:
             page += f'=> /{session.context.title()} Posted in: {session.context.title()}\n'
         page += poster_link
-        last_age = post.age() if not session.is_archive else post.ymd_hm()
-        page += f'{last_age}'
+        post_age = post.age() if not session.is_archive else post.ymd_hm()
+        page += f'{post_age}'
         if session.is_likes_enabled():
             liked = []
             if post.num_likes:
@@ -474,6 +474,7 @@ def make_post_page(session, post):
 
         # TODO: This may need paging when there is a long thread.
         rendered_comments = []
+        ts_now = time.time()
         for cmt in comments:
 
             # Commits are shown as links to the Git viewer.
@@ -487,10 +488,13 @@ def make_post_page(session, post):
                 rendered_comments.append(cmt.incoming_entry())
                 continue
 
+            comment_age = cmt.age() if not session.is_archive and ts_now - cmt.ts_created < 24 * 3600 else \
+                cmt.ymd_hm(tz=session.tz, time_prefix='at ')
+
             if not session.is_archive:
-                src = f'=> /u/{cmt.poster_name}/{cmt.id} {cmt.poster_avatar} {cmt.poster_name}\n'
+                src = f'=> /u/{cmt.poster_name}/{cmt.id} {cmt.poster_avatar} {cmt.poster_name} · {comment_age}:\n'
             else:
-                src = f'=> /u/{cmt.poster_name} {cmt.poster_avatar} {cmt.poster_name}\n'
+                src = f'=> /u/{cmt.poster_name} {cmt.poster_avatar} {cmt.poster_name} · {comment_age}:\n'
             comment_body = session.render_post(cmt)
             src += comment_body
 
@@ -505,22 +509,22 @@ def make_post_page(session, post):
                     src += xref.outgoing_entry()
 
             # Hide the `age` if it's the same as the previous entry (in reading order).
-            comment_age = cmt.age() if not session.is_archive else cmt.ymd_hm()
-            if comment_age != last_age:
-                last_age = comment_age
-            else:
-                comment_age = ''
-
-            if session.user and (cmt.user == session.user.id or session.is_user_mod) and \
-                    not session.is_context_locked:
-                # Actions on your own comments.
-                age_suffix = f" · {comment_age}" if len(comment_age) else comment_age
-                if session.is_editable(cmt) and post:
-                    src += f'=> /edit/{cmt.id} ✏️ Edit{age_suffix}\n'
-                elif session.is_deletable(cmt):
-                    src += f'=> /edit/{cmt.id}/delete/{session.get_token()} ❌ Delete{age_suffix}\n'
-            elif len(comment_age):
-                src += comment_age + '\n'
+            # comment_age = cmt.age() if not session.is_archive else cmt.ymd_hm()
+            # if comment_age != last_age:
+            #     last_age = comment_age
+            # else:
+            #     comment_age = ''
+
+            # if session.user and (cmt.user == session.user.id or session.is_user_mod) and \
+            #         not session.is_context_locked:
+            #     # Actions on your own comments.
+            #     age_suffix = f" · {comment_age}" if len(comment_age) else comment_age
+            #     if session.is_editable(cmt) and post:
+            #         src += f'=> /edit/{cmt.id} ✏️ Edit{age_suffix}\n'
+            #     elif session.is_deletable(cmt):
+            #         src += f'=> /edit/{cmt.id}/delete/{session.get_token()} ❌ Delete{age_suffix}\n'
+            # elif len(comment_age):
+            #     src += comment_age + '\n'
 
             rendered_comments.append(src)
 
diff --git a/model.py b/model.py
index 6291eb1..96c6d04 100644
--- a/model.py
+++ b/model.py
@@ -371,11 +371,11 @@ class Post:
             dt = dt.astimezone(tz)
         return dt.strftime('%Y-%m-%d')
 
-    def ymd_hm(self, tz=None):
+    def ymd_hm(self, tz=None, time_prefix=''):
         dt = datetime.datetime.fromtimestamp(self.ts_created, UTC)
         if tz:
             dt = dt.astimezone(tz)
-        return dt.strftime('%Y-%m-%d %H:%M')
+        return dt.strftime(f'%Y-%m-%d {time_prefix}%H:%M')
 
     def ymd_hm_tz(self, tz=None):
         dt = datetime.datetime.fromtimestamp(self.ts_created, UTC)
Proxy Information
Original URL
gemini://git.skyjake.fi/bubble/main/cdiff/6a205f003f941fcfc701fef9e50fb0fc82a9a046
Status Code
Success (20)
Meta
text/gemini; charset=utf-8
Capsule Response Time
27.386574 milliseconds
Gemini-to-HTML Time
0.406271 milliseconds

This content has been proxied by September (3851b).