File tree 2 files changed +23
-1
lines changed
2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -117,9 +117,19 @@ def generate_response(self, prompt):
117
117
118
118
def display_visited_links (self ):
119
119
"""Display the links visited for the current user query."""
120
+
120
121
with st .expander (session_state ["_" ]("Sources" )):
121
122
for link in visited_links ():
122
- st .write ("- " + link )
123
+ st .markdown (
124
+ f"""
125
+
126
+ <div class="truncate">
127
+ <span>•</span> <a href="{ link } " target="_blank" rel="noopener noreferrer">{ link } </a>
128
+ </div>
129
+
130
+ """ ,
131
+ unsafe_allow_html = True ,
132
+ )
123
133
visited_links .clear ()
124
134
125
135
def store_response (self , output , prompt ):
Original file line number Diff line number Diff line change @@ -80,3 +80,15 @@ background-image: url('app/static/Icon-Daumen-u-2.png'); /* Path to your png fil
80
80
span [data-testid = "stHeaderActionElements" ] a {
81
81
display : none !important ;
82
82
}
83
+
84
+
85
+ /* Prevents that urls displayed in the st.expander overflow the container */
86
+ .truncate {
87
+ width : 100% ; /* Allow full width of the container */
88
+ max-width : 100% ; /* Prevent exceeding the container */
89
+ white-space : nowrap;
90
+ overflow : hidden;
91
+ text-overflow : ellipsis;
92
+ display : inline-block; /* Use inline-block to allow the bullet and link in one line */
93
+ margin-bottom : 10px ; /* Space between items (line break) */
94
+ }
You can’t perform that action at this time.
0 commit comments