-
Notifications
You must be signed in to change notification settings - Fork 404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(gnoweb): user template #4024
base: master
Are you sure you want to change the base?
Conversation
🛠 PR Checks Summary🔴 Changes related to gnoweb must be reviewed by its codeowners Manual Checks (for Reviewers):
Read More🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers. ✅ Automated Checks (for Contributors):🟢 Maintainers must be able to edit this pull request (more info) ☑️ Contributor Actions:
☑️ Reviewer Actions:
📚 Resources:Debug
|
Codecov ReportAttention: Patch coverage is 📢 Thoughts on this report? Let us know! |
@gfanton I think we can start with this layout. |
Type: components.UserLinkTypeLinkedin, | ||
URL: "https://linkedin.com/" + username, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we link to LinkedIn? I need feedback from the marketing team on the reasons why.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, it's really open to discussion right now. I added a list of "most famous" links as example, in order to let people discuss the need.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can get rid of it (and other) or/and add other ones I may have forgotten (if it makes sense)
Type: components.UserLinkTypeLink, | ||
URL: "https://example.com/" + username, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't forget to remove this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, this is a bad mockup before the data will be retrieve from the right place
contributions := []components.UserContribution{ | ||
{ | ||
Title: "gno-blogpost", | ||
Description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think most packages won't have a description. We may need some of them to specify a description, possibly with comments. However, consider that this will be very irregular. I suggest you plan for the following now:
- No description
- Single-line description
- Multi-line description to be stripped
@@ -183,6 +187,103 @@ func (h *WebHandler) GetRealmView(gnourl *weburl.GnoURL) (int, *components.View) | |||
}) | |||
} | |||
|
|||
// GetUserView returns the user profile view for a given GnoURL. | |||
func (h *WebHandler) GetUserView(gnourl *weburl.GnoURL) (int, *components.View) { | |||
username := strings.TrimPrefix(gnourl.Path, "/u/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works now, but I believe we will have subpages for users, pagination, etc. I'm not sure if everything will rely on queries, but it's fine to use the current routing mechanism for now.
} | ||
|
||
// FormatRelativeTime formats a time into a relative string (e.g. "1 month ago") | ||
func FormatRelativeTime(t time.Time) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move these helpers into template.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the direction it takes. We'll rely on missing features such as the "package listing" and possibly some additional package metadata through comment extraction. I suggest we maintain this direction while considering a more minimal initial version that we can merge early and then expand.
Description
This PR introduces a new template for user and team profile pages, accessible via the new
u/
handle. This is a significant step in improving the user experience on gno.land by providing dedicated profile pages similar to GitHub's user profiles.- Design is still WIP - some features and info will be removed or added
Features
Profile Header
username
andcontributions
, other sections are optionalsMain Content Area
Sidebar
Technical Details
URL Structure
u/
handle for user profilesgno.land/u/username
Template Structure
Screenshots